Can Flash AS3 listbox data contain variable info?
Posted
by Anne
on Stack Overflow
See other posts from Stack Overflow
or by Anne
Published on 2010-05-25T05:08:55Z
Indexed on
2010/05/25
5:11 UTC
Read the original article
Hit count: 385
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
© Stack Overflow or respective owner