Control animation play() and stop() from class
hello,
i have created functions manage timed pause/play in animation , trying make class them, not work, play() , stop() functions use have no effect. functions work intended when not in class.
here code:
package anim { import flash.utils.timer; import flash.events.timerevent; import flash.display.movieclip; public class case extends movieclip { public var tempsmulti:number = 1.0; public function case():void { trace("init"); stop(); } public function settempsmulti(temps:number):void { this.tempsmulti = temps; } public function attends(tps:number):void { trace("attends"); var temps:number = tps * this.tempsmulti; var timer:timer = new timer(temps, 1); stop(); timer.addeventlistener("timer", this.suivant); timer.start(); } private function suivant(event:timerevent):void { trace("suivant"); play(); } } }
i checked functions executed trace() , case, problem comes play() , stop() functions, , not receive error @ compilation or runtime.
thanks help.
the movieclip you're trying control case instance?
More discussions in ActionScript 3
adobe
Comments
Post a Comment