Can Flash AS3 listbox data contain variable info?
- by Anne
I'm populating a listbox like this:
dp.addItem( {label:"red dress", data:"OV4MP/23OL.swf"} );
Instead of data:"OV4MP/23OL.swf", I would like to make part of the data file name a variable from a dynamic textbox named centerPt that belongs to the parent movieclip, so I did this:
dp.addItem( {label:"red dress", data:"OV4MP/23"+MovieClip(parent.parent).centerPt.text+".swf"} );
When I trace the selectedItem.data using:
trace("you have selected: "+ overlays.selectedItem.data);
trace(MovieClip(parent.parent).centerPt.text);
I'm getting:
you have selected: OV4MP/23.swf. What I should get is OV4MP/23OL.swf. It is not picking up what is in the dynamic centerPt.text field which are the letters OL eventhough that text field is tracing correctly.
Is it possible that data can not hold a variable?
Thank you in advance for any help.
Anne