-
What is wrong with this AS3
import flash.utils.Timer;
import flash.events.TimerEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var done:Boolean;
skip_btn.alpha = 0;
pause_btn.visible = false
play_btn.alpha = 0;
skip_btn.addEventListener(MouseEvent.CLICK, ClickToSkip);
function ClickToSkip(event:MouseEvent):void{
MovieClip(this.root).gotoAndStop(1, "First page");
SoundMixer.stopAll();
}
play_btn.addEventListener(MouseEvent.CLICK, ClickToStop);
function ClickToStop(event:MouseEvent):void{
stop();
play_btn.visible = false
pause_btn.visible = true
}
pause_btn.addEventListener(MouseEvent.CLICK, ClickToPlay);
function ClickToPlay(event:MouseEvent):void{
play();
play_btn.visible = true
pause_btn.visible = false
}
stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMoved);
function MouseMoved(event:MouseEvent):void{
if (!done) {
var playFI:Tween = new Tween(play_btn,"alpha",Strong.easeOut,0,1,2,true)
var skipFI:Tween = new Tween(skip_btn,"alpha",Strong.easeOut,0,1,2,true)
}
done = true;
}
What is wrong with this, for some reason my playbutton and pausebutton dont seem to pause the frame, they do change form however. i used ctrl + enter to test my scene. forum.png
Please help me out
-
.
Hi,
I think you have some code slightly mixed up,
PHP Code:
pause_btn.addEventListener(MouseEvent.CLICK, ClickToStop); function ClickToStop(event:MouseEvent):void { stop(); event.currentTarget.visible = false; play_btn.visible = true;
}
play_btn.addEventListener(MouseEvent.CLICK, ClickToPlay); function ClickToPlay(event:MouseEvent):void { play(); event.currentTarget.visible = false; pause_btn.visible = true; }
-
thanks but....
Originally Posted by fruitbeard
Hi,
I think you have some code slightly mixed up,
PHP Code:
pause_btn.addEventListener(MouseEvent.CLICK, ClickToStop);
function ClickToStop(event:MouseEvent):void
{
stop();
event.currentTarget.visible = false;
play_btn.visible = true;
}
play_btn.addEventListener(MouseEvent.CLICK, ClickToPlay);
function ClickToPlay(event:MouseEvent):void
{
play();
event.currentTarget.visible = false;
pause_btn.visible = true;
}
It was my intention to mix up the stop for play since i wasn't bothered, but thanks anyway. But that wasn't the problem. When i run the code and press the actual pause button. it doesn't stop at the current frame, yet the skip button does work. There are no syntax errors or any compiler errors. really stuck here...
-
.
Hi,
Well attach your *.fla for us to see, hard to say without exploring.
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
|