Originally posted by findShorty if i'm understanding you right, you want to add 18 items to the combo box, all of them named var1-var18?
the following code will do that for you:
code:
importVars.onLoad = function () {
for (var i=0; i<18; i++) {
comBo.addItem("my label "+i,importVars["var"+(i+1)]);
}
}
but the labels are already in place, if i change them the user wont know the difference between mylabel0 and mylabel1
and i have looked into that thread oldnewbie (even responded to it) thanks, the problem is he wanted multiple text files, i just want one to load variables
keep in mind my main goal posted couple threads above, if this isnt possible, lets try and think of a way around it, it may come down to me using one txt file for each combo item
Then your last tester2 works I guess, if you clear out the Var box in the textfield's properties... While you're at it, you can also unselect the "Selectable" tab (Ab), useless in your case!
i believe we have just come to the fact that we are all stumped, please no more replys to this post, im going to have to go a different route, thanks for all the effort and possible solutions guys
Looking at the calibre of the people responding, it seems a bit hard to believe what you want can't be achieved.
Before you give up, read through all of their responses and see what you can collect. If that doesn't work, think about if you can rephrase the question to include the missing part of the puzzle.
I haven't followed this thread closely due to its surreal nature, but I haven't read anything that seems impossible - or even difficult - to achieve.
and of course a loadit function for each combobox is necessary..
however this does achieve what i want, i hav 30 variables and the size of the file is approx. 350 kb.. if this can be simplified in any way would be my ultimate question.. i have looked into ways to achieve this through XML and have become just as stumped, even though that way looks a lot more efficient, anyone with an example of that?...good luck if youre not giving up, i guess i have no choice.. ..thanks
Anyway you can attach, e-mail or provide a link to download from your server, the full and complete .fla for this thing?
That said, again I believe your own second zip you attached here, assuming you made the corrections I proposed, seemed to work fine. That's why seeing the real thing (if it is!"), is a must.
Just spent a few hours on your file... And my conclusion is that the simplification you're asking for isn't pinpointed!
Are you more preoccupied by overall size (your 75kbs pages.swf is not that bad for what you have going on...), is it simplification of code (eliminating multiple if statements for example, which wouldn't translate in a significant difference in file size...), or the fact that this would be easily dynamically updatable (assuming nothing was hard coded...)?
If you're going to hard code everything, might as well hard code your actual data in your combos, rather than going through variables you'll then have to evaluate for them to correspond to the actual data. If you want all of this to be easily updatable through text files (without ever editing the core of the movie), then everything should be dynamic including the number of items, their names and their associated data.
A simple dynamic combo with however number of items outputs at about 16kbs and I don't think (even without testing it!) that the way they're coded would make a significant difference in file size.
thanks much oldnewbie for everything youve worked on with this code, i guess when it comes down to it, my main concern is the updatable files, im going to shy away from the hardcoding and use the XML format to load items into the comboboxes and just use text files for individual items, turns out the answer i was looking for wasnt in the code, but in the the actual necessity of what needed to be accomplished, your last post was by far the most rewarding for the completion of this project, thank you