...

View Full Version : play/pause button help?



resin
04-29-2012, 08:41 AM
Currently I have a simple play button, which plays a sound when clicked. Each time its clicked it plays that sound again. But what I need is a button that plays the sound on the first click, and then pauses the sound on the second click. And then clicking once more will resume playing the sound where it had left off. I've been searching all over for an answer but not having any luck. I also need the sound to play automatically when the webpage is loaded. This is what I have currently:



<object type="application/x-shockwave-flash" data="/test.swf" width="50" height="50">
<param name="movie" value="/test.swf">
</object>

Taro
04-29-2012, 03:03 PM
Hello,

You can try adding this code in the first frame:



play_btn.onRelease = function(){
_root.play();
}
stop_btn.onRelease = function(){
_root.stop();
}


Then create a new layer, added with two buttons with it, called play_btn and stop_btn.

resin
05-02-2012, 08:16 AM
Hello, thanks for your reply. I actually found another way to do through a tutorial I found. I couldn't figure out your way. But still thanks :)

Taro
05-02-2012, 09:18 PM
Hello, thanks for your reply. I actually found another way to do through a tutorial I found. I couldn't figure out your way. But still thanks :)

Hello,

No problem. There are probably other ways to stop or start flash animations. I was familiar with one using the OnClick() function [or the Action-script version of it] where it stopped and played simply by clicking in the stage.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum