simple error #1034, forgot how to solve this.
I have the following code:
import flash.events.Event;
import flash.display.MovieClip;
var speed:int=100;
var arr:Array=new Array();
var s:String=new String();
var m:MovieClip=new MovieClip();
addEventListener(Event.ENTER_FRAME,onEnterFrameHandler);
addEventListener(Event.ENTER_FRAME,onEnterFrameHandler2);
function onEnterFrameHandler(e:Event):void{
d0.x=Math.sin(90+speed)+speed;
speed+=1;
d0.y=0;
}
function onEnterFrameHandler2(e:Event):void{
for (var i:int=1;i<100;i++){
trace(i);
s="w"+i;
//s=s.toString();
arr.push(s);
trace(s);
m=arr;
m.x=Math.sin(90*i);
m.y=m.x;
trace(m);
}
}
-----------------------------------------
TypeError: Error #1034: Type Coercion failed: cannot convert "w1" to flash.display.MovieClip.
at WDVM_Flash2_fla::MainTimeline/onEnterFrameHandler2()
-------------------------------------------
I am trying to get an array of objects named w1 through w"X" to move dynamically. I've tried to set the Movie Clip "m" to an array element but apparently this is what throws the error. How do I fix this properly? Thanks in advance.