topical media & game development
actionscript-example-TextTo300.ax
actionscript-example-TextTo300.ax
(swf
)
[ flash
]
flex
package {
import flash.display;
import flash.events;
import flash.text;
public class actionscript-example-TextTo300 extends TextField {
public function actionscript-example-TextTo300 () {
}
public function moveTextRight (e:Event):void {
if (x <= 300) {
x += 10;
if (t.x > 300) {
t.x = 300;
}
} else {
stop();
}
}
public function start ():void {
// Start playing the animation
addEventListener(Event.ENTER_FRAME, moveTextRight);
}
public function stop ():void {
// Pause the animation
removeEventListener(Event.ENTER_FRAME, moveTextRight);
}
}
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.