Hi guys,
Got a slight problem so looking for an answer as it has been a very long time since I used AS and now everything has event listeners so I am a bit lost but trying.
I am in CS5 and wanting to catch up with AS3.
This code works
But I am trying to condense itCode:/*this.reset.addEventListener(MouseEvent.CLICK,Rand); function Rand(event: MouseEvent) { shapes1.gotoAndStop(1+Math.floor(Math.random()*5)); shapes2.gotoAndStop(1+Math.floor(Math.random()*5)); shapes3.gotoAndStop(1+Math.floor(Math.random()*5)); shapes4.gotoAndStop(1+Math.floor(Math.random()*5)); shapes5.gotoAndStop(1+Math.floor(Math.random()*5)); shapes6.gotoAndStop(1+Math.floor(Math.random()*5)); shapes7.gotoAndStop(1+Math.floor(Math.random()*5)); shapes8.gotoAndStop(1+Math.floor(Math.random()*5)); shapes9.gotoAndStop(1+Math.floor(Math.random()*5)); }*/
Any help would be appreciated.Code:this.reset.addEventListener(MouseEvent.CLICK,Rand); function Rand(event: MouseEvent) { for (i=1;i<10;i++){ shapes[i].gotoAndStop(1+Math.floor(Math.random()*5)); }


Reply With Quote


Bookmarks