gforce7
October 21st, 2008, 11:58 AM
I had the following array of movie clips:
var photoFill:Array = [card0_mc.photoFill_mc, card1_mc.photoFill_mc, card2_mc.photoFill_mc, card3_mc.photoFill_mc]
with trace(photoFill); I get:
[object MovieClip],[object MovieClip],[object MovieClip],[object MovieClip]
what I want to do is build the Array through a loop based on the length of another Array like this:
var photoFill:Array = new Array
for(var n:int = 0; n < cardDensity.length; n++){
photoFill.push("card"+n+"_mc.photoFill_mc");
}
but now with trace(photoFill); I get:
card0_mc.photoFill_mc,card1_mc.photoFill_mc,card2_ mc.photoFill_mc,card3_mc.photoFill_mc
It's turned it into a string which is giving me an error when I try to reference photoFill[i].height in another loop. The Error is:
ReferenceError: Error #1056: Cannot create property height on String.
How can I turn the string back into objects?
Thanks
var photoFill:Array = [card0_mc.photoFill_mc, card1_mc.photoFill_mc, card2_mc.photoFill_mc, card3_mc.photoFill_mc]
with trace(photoFill); I get:
[object MovieClip],[object MovieClip],[object MovieClip],[object MovieClip]
what I want to do is build the Array through a loop based on the length of another Array like this:
var photoFill:Array = new Array
for(var n:int = 0; n < cardDensity.length; n++){
photoFill.push("card"+n+"_mc.photoFill_mc");
}
but now with trace(photoFill); I get:
card0_mc.photoFill_mc,card1_mc.photoFill_mc,card2_ mc.photoFill_mc,card3_mc.photoFill_mc
It's turned it into a string which is giving me an error when I try to reference photoFill[i].height in another loop. The Error is:
ReferenceError: Error #1056: Cannot create property height on String.
How can I turn the string back into objects?
Thanks