Answered
Using ComboBox data property with addChild
I'm using AS3 with a ComboBox component and when the items
inside the comboBox are clicked on, I want to add items from the
library to my stage.
What I'm trying to do is access the data property of the addItem method and pass that into the addChild method. Since it's passing the data property in as a string, it won't work. And I'm unable to find a workaround other than a bunch of if statements based on the selectedIndex property of the comboBox. I prefer not to use the if statements... it's messy and even more so when I have to removeChild. Below is my code which is not working because the data property is being passed in as a string which isn't accepted by the addChild method. Any suggestions?
What I'm trying to do is access the data property of the addItem method and pass that into the addChild method. Since it's passing the data property in as a string, it won't work. And I'm unable to find a workaround other than a bunch of if statements based on the selectedIndex property of the comboBox. I prefer not to use the if statements... it's messy and even more so when I have to removeChild. Below is my code which is not working because the data property is being passed in as a string which isn't accepted by the addChild method. Any suggestions?