Copy link to clipboard
Copied
hello there
i want to make a play/pause button
the same button for two functions
i am using this code...
import flash.events.MouseEvent;
stop();
start_button.addEventListener (MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
nextFrame(); // if you want to go to frame 2 and stop
play(); // if you want to go to frame 2 and play
}
it works for playing but not for pausing........
whats the action script for playpause in the same button?
anybody help me
import flash.events.MouseEvent;
stop();
var toggle:Boolean
start_button.addEventListener (MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
if(toggle){
nextFrame(); // if you want to go to nextframe and stop
} else {
play(); // if you want to go to nextframe and play
}
toggle=!toggle; // or place this as first line of onClick, if you want to change how the button starts
}
Copy link to clipboard
Copied
import flash.events.MouseEvent;
stop();
var toggle:Boolean
start_button.addEventListener (MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
if(toggle){
nextFrame(); // if you want to go to nextframe and stop
} else {
play(); // if you want to go to nextframe and play
}
toggle=!toggle; // or place this as first line of onClick, if you want to change how the button starts
}
Copy link to clipboard
Copied
hello man it worked
thank you a lot
i ll mark as correct
finished this issue
i post another issue separate
in order to maintain your answer
Copy link to clipboard
Copied
good to hear!