This content has been marked as final. Show 4 replies
I copied your code and tried it, placing a text box on the stage. It didn't work at first, then I tried doing a few things and got it working, then I removed those things I did and it kept working. Then I copied your code again and pasted it over everything and it worked fine... it's a mystery!
You may have just been doing that for test purposes, but you don't meed all of the if statements since you can assign textbox.text the value of the label of my_cb.
HI Ned! Thanks so much for testing it and replying! Yes, you're right, I did the if statements as a test, because when/if this works, I'll change those statements to something else. What I really need to do is pass the data to a string which will complete a URL.
I guess the fact that this works sometimes and not other times isn't a good thing ;-) but it's important to know. Your testing sure helps to offer a clue toward the answer... whatever it might be. Does anyone have any idea why this code would work sometimes and not others? Or if anyone can point to the another way to reliably collect data from a combobox and put it into a variable, it would be most appreciated. Thanks all!
Ned, it's so strange. I thought I'd try what you did and I changed a few things and then changed them back and now it works... I don't get it, but I'm going with it for now! Specifically, I gave the textbox a variable of my_cb, and then took it away again, and now its happy. Thanks again for your help!
The only things I did were first... changed the following line as such...
var itemNumber = Number(my_cb.getSelectedItem().data);
which worked, then I changed it again to...
var itemNumber:Number = my_cb.getSelectedItem().data;
which worked, then I just changed it back to...
var itemNumber = my_cb.getSelectedItem().data;
ala just repasting your entire code segment, which worked... so???
Maybe it just didn't feel like working on a weekend, but finally gave in?