Question
Movement with actionscript
Hi,
I am using action script to do some simple movement of text. I created some text, made it a movie clip and gave it an instance name of q1. I put it on the stage and did a right click on it, and selected "actions." I added the following actionscript code for the movement:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
}
This worked great and moved the text up the screen to a certain point and stopped. Just what I wanted. But now, when the text stops moving, I want the entire movie to go to frame 2. This seems like it should be easy to do, but I can not figure out how to recognize that the motion has stopped and to go to frame 2. I tried this,but it had no effect:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
gotoAndPlay(2);
}
Anyone know how to do this? Thanks!
Bob
I am using action script to do some simple movement of text. I created some text, made it a movie clip and gave it an instance name of q1. I put it on the stage and did a right click on it, and selected "actions." I added the following actionscript code for the movement:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
}
This worked great and moved the text up the screen to a certain point and stopped. Just what I wanted. But now, when the text stops moving, I want the entire movie to go to frame 2. This seems like it should be easy to do, but I can not figure out how to recognize that the motion has stopped and to go to frame 2. I tried this,but it had no effect:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
gotoAndPlay(2);
}
Anyone know how to do this? Thanks!
Bob
