I am reading information from binary sockets.
I have an array of movie clips, each with a different instance name:
ex: MCarray:Array=new Array (mc1,mc2,mc3,mc4,mc5);
I have already done all the coding for the arrays so theres no confusion there.
I need a statement that says:and so on....Code:"if the incoming variable refers to mc1+2, then make mc1 go to frame 2" "if the incoming variable refers to mc2+2, then make mc2 go to frame 2" if the incoming variable referrs to mc3+2, then make mc3 go to frame 2"
does that make sense? anyway the problem with that is that i just want ONE statement because I will eventually have over a hundered movie clips, and so I don't want to make a hundred if-then statements for each function.
there must be a way to say
any ideas? thanksCode:my.addEventListener(ProgressEvent.SOCKET_DATA, myfunction); function myfunction(e:ProgressEvent):void{ if("incoming variable=one of the movie clips from the array"+"2"){ MCarray.(make that movie clip which was named go to frame 2); } }




Reply With Quote
