This content has been marked as final. Show 7 replies
use a for loop to cycle through the number of pictures loaded, and inside the for loop add the components using the addChild method onto the canvas or whatever container it needs to be added to.
That sounds good but a short example would be really helpful if i am not asking too much?
i have just finished completing something very similar in flash using actionscirpt. I have post the code for that here if you like and maybe you can apply what you learn to your flex app. For my app, i use an xml file that contains the path the the folder on the system where each image is located. I load the xml file into flash search for the number of nodes, duplicate a movieclip the appropriate number of times and load each image into the newly created movieclips. LIke Clark_Kent101 said use a for loop to determine how many nodes are in the xml.
That sounds great Barry, you can post it here if it's not problem and i am sure i can learn a lot from that code.
Sure thing, here is an example:
for (var i:int = 0; i < _xmlImages.length; i++)
var imgObj:your_component_name = new your_component_name();
imgObj._imgSrc = _xmlImages .src;
The _xmlImages is an array collection with a field called 'src' which I access and assign to the image control in the component called 'your_component_name'. The _imgSrc variable is a public bindable variable in the component which is binded to the source of the image control nested in the component called 'your_component_name'.
Hope this helps.
Thank you very much Tony, this will help me a lot !
No problemmo :)