I'm using AS3 on Flash CS4.
Instead of having this:
Actionscript Code:
DS1.stop();
DS2.stop();
DS3.stop();
DS4.stop();
DS5.stop();
DS6.stop();
DS7.stop();
DS8.stop();
I wanted to use a for loop to do it for me as I have about 100 movieClips like this that I want to stop. So I thought it I put them all into an array I could use the for loop to go through and stop them all. The code below is trying to do this but bringing up an error:
TypeError: Error #1006: value is not a function.
at railMap_fla::MainTimeline/frame1()
in the output window when I test it. But when I ran the trace it traced out each of the movieClips.
Actionscript Code:
var DepotsArray:Array = new Array (DS1,DS2,DS3,DS4,DS5,DS6,DS7,DS8);
for (var i:int=0;i<DepotsArray.length;i++){
//trace(DepotsArray[i].name);
DepotsArray[i].name.stop();
}
please any help would be appreciated.