addFrameScript (as3)
[ 2009-06-23 00:59:44 | Author: liuhuan ]
In as3, it's possible for us to add script to timeline dynamicly.
package {
import flash.display.*;
public class AddScript extends MovieClip {
public function AddScript() {
addFrameScript(0, frame1, 8, frame9, 15, frame16, 21, frame22, 25, frame26, 28, frame29);
}
private function frame1() {
trace("start");
}
private function frame9() {
trace("hit floor");
}
private function frame16() {
trace("hit floor");
}
private function frame22() {
trace("hit floor");
}
private function frame26() {
trace("hit floor");
}
private function frame29() {
stop();
trace("stop");
}
}
}
import flash.display.*;
public class AddScript extends MovieClip {
public function AddScript() {
addFrameScript(0, frame1, 8, frame9, 15, frame16, 21, frame22, 25, frame26, 28, frame29);
}
private function frame1() {
trace("start");
}
private function frame9() {
trace("hit floor");
}
private function frame16() {
trace("hit floor");
}
private function frame22() {
trace("hit floor");
}
private function frame26() {
trace("hit floor");
}
private function frame29() {
stop();
trace("stop");
}
}
}
Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=992
There is no comment on this article.
You can't post comment on this article.