ecco ho risolto e non mi viene in mente null'altro
Allora l'esempio è per un caricamento di combobox da file esterno txt
nel file txt c'è
codice:
&item=5&
&nome0=CANALI&url0=#
&nome1=AUTO E MOTO&url1=http://www.quattroruote.it
&nome2=CASE&url2=http://www.portaportese.it
&nome3=FORUM&url3=http://forum.html.it
&nome4=CUCINA&url4=http://www.invoglia.it
&nome5=RICERCHE GLOBALI SU INTERNET&url5=http://www.google.it
dentro flash (ricorda di creare un campo di testo dinamico "test" )
codice:
vettore = new Array() // creo per inserire le lunghezze dei testi
system.useCodepage = true // per utilizzare tutti i caratteri
// Dichiaro
elenco = new LoadVars();
// Carico
elenco.load("combobox_populate_canali.txt");
// Assegno
elenco.onLoad = function(success) {
for (i=0; i<=Number(this.item); i++) {
elemento = this["nome"+i];
_level0.test.autoSize=true
_level0.test.text=elemento
// calcolo la larghezza + 50 per la scrollbar
_level0.larg=Math.round(_level0.test._width)+50
// penso all'ordinamento nell'Array in modo di avere 050, 060, 180 ecc
if(_level0.larg<100){_level0.vettore.push("0"+_level0.larg)
}else{
_level0.vettore.push(_level0.larg)
}
link = this["url"+i];
_root.myCombo1.addItemAt(i, elemento, link);
}
// ordino l'array
_root.vettore.sort();
_root.mycombo1.setSize(_root.vettore[_level0.vettore.length-1])
//trace(_root.mycombo1._width)
};
// controllo cambio valore
comboBox = new Object();
comboBox.cambia = function(component) {
getURL(myCombo1.getSelectedItem().data, "_blank");
};
//chiamo la funzione al cambio
myCombo1.setChangeHandler("cambia", comboBox);
// Formatto tutto
// è necessario importare il Fon nella libreria e linkage
globalStyleFormat.textFont = "hooge" // font importato nella libreria
globalStyleFormat.embedFonts = true
globalStyleFormat.textSize = 8;
globalStyleFormat.textBold = false
globalStyleFormat.textItalic = false
globalStyleFormat.textColor = 0xFF3366
globalStyleFormat.face = 0x003366;
globalStyleFormat.scrollTrack = 0x003366
globalStyleFormat.arrow = 0xffffff;
globalStyleFormat.highlight = 0xffffff;
globalStyleFormat.highlight3D = 0x333333;
globalStyleFormat.shadow = 0xffffff;
globalStyleFormat.darkshadow = 0xffffff;
globalStyleFormat.selection = 0x003366;
globalStyleFormat.applyChanges("textColor","textFont","embedFonts","face", "textSize", "textBold","textItalic", "scrollTrack", "arrow", "highlight", "highlight3D", "shadow", "darkshadow", "selection", "font");