Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2011
    Posts
    154
    Thanks
    5
    Thanked 0 Times in 0 Posts

    play/pause button help?

    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:

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

  • #2
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hello,

    You can try adding this code in the first frame:

    Code:
    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.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.

  • #3
    Regular Coder
    Join Date
    Nov 2011
    Posts
    154
    Thanks
    5
    Thanked 0 Times in 0 Posts
    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
    Last edited by resin; 05-02-2012 at 01:59 PM.

  • #4
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Quote Originally Posted by resin View Post
    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.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •