-
[CS3] AS3 - Cannot return to frame 1 on mouse over
Why cant i return to frame 1, when i mouseover the movieclip?
My code is like this:
var go:int = Math.round (2+Math.random()*1);
gotoAndStop(go);
search_mc.addEventListener(MouseEvent.MOUSE_OVER, search);
search_mc.addEventListener(MouseEvent.MOUSE_OUT, startMC);
function search(event:MouseEvent):void {
gotoAndPlay(1);
}
function startMC(event:MouseEvent): void {
gotoAndPlay(go);
}
if (go == 2) {
addEventListener(Event.ENTER_FRAME, textMC1);
}
if (go == 3) {
addEventListener(Event.ENTER_FRAME, textMC2);
}
trace(go);
function textMC1(event:Event) {
if (this.text1_mc.foo == 1) {
this.text1_mc.foo = 0;
this.cursor_mc.play();
removeEventListener(Event.ENTER_FRAME,textMC1);
}
}
function textMC2(event:Event) {
if (this.text2_mc.foo == 1) {
this.text2_mc.foo = 0;
this.cursor_mc.play();
removeEventListener(Event.ENTER_FRAME,textMC2);
}
}
addEventListener(Event.ENTER_FRAME, cursorMC);
function cursorMC(event:Event) {
if (this.cursor_mc.currentFrame == 100) {
this.fade_mc.play();
removeEventListener(Event.ENTER_FRAME,cursorMC);
}
}
addEventListener(Event.ENTER_FRAME, fadeMC);
function fadeMC(event:Event) {
if (this.fade_mc.foo == 1) {
this.fade_mc.foo = 0;
gotoAndPlay(go);
removeEventListener(Event.ENTER_FRAME, fadeMC);
}
}
Thanks for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|