Sound pause/repeat function and chronology in a button

Hi, I just created a slide show flash with a background sound.  All my images are clip individual film (for the tween class), and I created a button pause/resume for the background sound.  However, when I have a break the sound, always moving images.  I want to know if it is somehow that can interrupt/resume sound and timeline at the same time (pick up where he stopped) within a single button?

Here's the code I'm doing for the pause/resume button: I use CS5.5, AS3.

================================================================================

var resumeTime:Number = 0.00;
var mySound:Sound = new Butterfly_Waltz;
var channel1:SoundChannel = new SoundChannel();

pause_btn.addEventListener (MouseEvent.CLICK, pauseSound);
play_btn.addEventListener (MouseEvent.CLICK, playSound);

channel 1 = mySound.play ();

function pauseSound(e:MouseEvent):void
{
resumeTime = channel1.position;
CHANNEL1. Stop();
pause_btn. Visible = false;
play_btn. Visible = true;
}

function playSound(e:MouseEvent):void
{
channel 1 = mySound.play (resumeTime);
play_btn. Visible = false;
pause_btn. Visible = true;
}

====================================================================================

Can I add directly the action at these buttons (pause_btn & paly_btn) code rather changing function?  Can a button has two eventlistener?

Hope that someone could help me.

Thank you!

If you want to sound controls also control playback from the timeline, then just add the control of timeline code to existing functions.  Calendar control is simply using play() and stop() function calls.

function pauseSound(e:MouseEvent):void
{

Stop();
resumeTime = channel1.position;
CHANNEL1. Stop();
pause_btn. Visible = false;
play_btn. Visible = true;
}

function playSound(e:MouseEvent):void
{

Play();
channel 1 = mySound.play (resumeTime);
play_btn. Visible = false;
pause_btn. Visible = true;
}

If your slide show is inside another movieclip, then you're targeting just the movieclip with the call play() and stop(), as in yourMC.stop ();

Tags: Adobe Animate

Similar Questions

  • I have installed and uninstalled SP6 from a CD and the CC PS repeatedly today and can not get either the version of the function.

    I have installed and uninstalled SP6 from a CD and the CC PS repeatedly today and can not get either the version of the function. I get the following messages: could not load actions because an unexpected end of file was encountered could not initialize Photoshop because an unexpected end of file was encountered could not initialize Photoshop because the preferences file was invalid (it has been deleted). I should have a clean install of programs. I tried one at a time in case they are somehow interfere between them.

    Try to run Photoshop and immediately press on and hold the keys Ctrl + Alt + Shift Windows CMD + Option_Shift Mac. Photoshop invite and ask you want to your preferences removed. Answer Yes.

  • Windows Media Player - how to set the repeat function?

    I set a schedule to play music using Windows Media Player, if I set the repeat function, then it will play the file audio repeatly, but first I would annex plays a sound at a specific time only once without repeat and play another his repeatly at another time, someone has suggestions on how to set this option on the calendar?

    Thanks in advance for your suggestions

    Hello

    What version of Windows Media Player you have installed?

    Try to create individual selections with each audio file. Later, try using the repeat function.

    If you use Windows Media Player 11, you can follow this link.

    Shuffle and repeat items in Windows Media Player


    Reference:
    How to schedule tasks in Windows XP

    Hope the helps of information.

    Please post back and we do know.

  • Pause/repeat of a game in AS3

    Hey everybody,

    I am working currently on what makes a game for Android and IOS, and I want to know the code easier to pause all entities in the game except sound. When you click pause, I want him to make up a screen break, pause the game and then the screen display of break which has options sound effects and music as well as a button to resume.

    When you click the button, the pause screen disappears and the game is then resumed.

    Can someone help me?

    Sorry

    yourButton.addEventListener (MouseEvent.CLICK, pauseGame);

    function pauseGame(e:MouseEvent):void {}

    s tage. frameRate = 0;

    }

    yourOtherButton.addEventListener (MouseEvent.CLICK, resumeGame);

    function resumeGame(e:MouseEvent):void {}

    Stadium. frameRate = 15;

    }

  • Audio jack play and pause/stop when you press the various buttons

    Hi all

    I do a simple radio interface and I have 6 buttons which I want to have that specific preset song playing of the button located in the library screening and stop/pause the current song when you press any preset button.

    I tried to use the attachSound, with associated identifiers but don't know if it's the right way to go. He plays songs, but does not stop their...

    {mc_FM1preset1.onRelease = Function ()}
    {if(!this.) Toggle)}
    this.gotoAndStop ("release");
    radio_FM1. Text = FM1preset1
    FM1value = 1

    PlayFM1_1 = new Sound (this);
    PlayFM1_1.attachSound (FM1preset1_song);
    PlayFM1_1.start (0, 1);

    PlayFM1_6.pause;
    PlayFM1_5.pause;
    PlayFM1_4.pause;
    PlayFM1_3.pause;
    PlayFM1_2.pause;

    }
    }


    }
    {mc_FM1preset2.onRelease = Function ()}
    {if(!this.) Toggle)}
    this.gotoAndStop ("release");
    radio_FM1. Text = FM1preset2
    FM1value = 2

    PlayFM1_2 = new Sound (this);
    PlayFM1_2.attachSound (FM1preset2_song);
    PlayFM1_2.start (0, 1);

    PlayFM1_6.pause;
    PlayFM1_5.pause;
    PlayFM1_4.pause;
    PlayFM1_3.pause;
    PlayFM1_1.unload;

    }
    }

    then I tried just to put each piece in its own clip and using this code, but it still doesn't stop/pause the song.

    Stop();

    {mc_preset1.onRelease = Function ()}
    mc_song1. Play();
    mc_song2. Stop();
    }


    {mc_preset2.onRelease = Function ()}
    mc_song2. Play();
    mc_song1. Stop (1);
    }

    Does anyone have any suggestions? Any help would be great! Thank you!!!

    Basically, I just need to know how to do the supported mc or button to STOP / to PAUSE the song that plays

    Thank you!!!

    -PAt

    the sound class has no property of break.  It has a stop() method, you must use:

    {mc_FM1preset1.onRelease = Function ()}
    {if(!this.) Toggle)}
    this.gotoAndStop ("release");
    radio_FM1. Text = FM1preset1
    FM1value = 1
           
    PlayFM1_1 = new Sound (this);


    PlayFM1_1.attachSound (FM1preset1_song);
    PlayFM1_1.start (0, 1);
           
    PlayFM1_6.stop ();
    PlayFM1_5.stop ();  etc.
    PlayFM1_4.pause;
    PlayFM1_3.pause;
    PlayFM1_2.pause;
           
    }
    }

    }
    {mc_FM1preset2.onRelease = Function ()}
    {if(!this.) Toggle)}
    this.gotoAndStop ("release");
    radio_FM1. Text = FM1preset2
    FM1value = 2
           
    PlayFM1_2 = new Sound (this);
    PlayFM1_2.attachSound (FM1preset2_song);
    PlayFM1_2.start (0, 1);
           
    PlayFM1_6.pause;
    PlayFM1_5.pause;
    PlayFM1_4.pause;
    PlayFM1_3.pause;
    PlayFM1_1.unload;
           
    }
    }

  • KB2572073 security update is to repeatedly download and installation

    Hello
    KB2572073 security update is to repeatedly download and installation. When I check on Windows Update reports installed successfully. How can I fix it?

    Hello
    Thanks a lot for your answer. I followed the actions in the link provided, but the problem persisted. To fix it I had to remove the .NET Framework and then reinstall it by using the following procedure. That solved my problem.

    Thank you very much for your help.

    Step 1: Remove the .NET Framework using the removal tool

    ================================

    1. download the tool from the following link:

    http://CID-27e6a35d1a492af7.SkyDrive.live.com/self.aspx/Blog_Tools/dotnetfx_cleanup_tool.zip

    2. save the zip (dotnetfx_cleanup_tool.zip) file from the link above on the local desktop and extract it.

    3. double-click on cleanup_tool.exe to run the tool.

    4. follow the instructions given.

    In the "cleaning product:", please select ".NET Framework - all versions.

    5. click on 'clearing '.

    6. restart the computer.

    Note: Once we have removed the .NET Framework, some applications that have need of .NET Framework runtime database could lose their functions. It's just a temporary problem. The function will return to normal after the reinstallation of .NET Framework.

    After completing these steps, please go to the following suggestions to reinstall .NET Framework 1.1 and its updates.

    Step 2: Install the .NET Framework 1.1 and its updates

    ============================================

    Please download and install the following updates in the order.

    Microsoft .NET Framework Version 1.1 redistributable package

    http://download.Microsoft.com/download/a/a/c/aac39226-8825-44Ce-90E3-bf8203e74006/Dotnetfx.exe

    Microsoft .NET Framework 1.1 Service Pack 1

    http://download.Microsoft.com/download/8/b/4/8b4addd8-E957-4dea-BDB8-c4e00af5b94b/NDP1.1sp1-KB867460-x86.exe

    Security Update for Microsoft .NET Framework Service Pack 1 (KB2416447)

    http://download.Microsoft.com/download/6/D/C/6DC6FFA8-4585-4192-A366-85712491322D/NDP1.1sp1-KB2416447-x86.exe

    «Note: when the window "file download" appears, please click 'Save' and follow the directions to save the file to the desktop.» After downloading all the installation files, please double-click on each to install.

  • Repeat freezing and Action Center "video hardware error error issues."

    I am not very computer savvy, but I had this problem and will provide what I can.  Since 7 September, I've been having repeated, very random questions from my computer to freeze.  I have to force close down to reboot.  It happens the same way every time, where sound begins to hum and the slider's been hanging around, and it freezes completely.  What happened 9 times the date, the last being only 30 minutes ago.  I tried to update everything possible I can drivers for windows updated.  I play every day an MMO and tried swapping game pads in case it could have been the cause, but it has not fixed.  I have been able to reduce it to scroll to the bottom of Web pages that are strong images and it begins to freeze, and I am currently using Firefox.  I couldn't find anything in case the system log of the observer who matched each gel, except once with that I think that the Action Center was looking for a problem and he came:

    Problem: Video hardware error

    Files helping to describe the problem:

    SysData.XML WD-20141002 - 1521.dmp

    WERInternalMetadata.xml

    I've done checks of viruses, malware, RAM test, even taken in a computer store to identify the problem and everything came back with no results.  I'm at a loss where to go next, or what to try.

    My profile: http://i.imgur.com/H2PaXGo.png

    I currently have two monitors, ASUS, but these if overwrite problems began before I had two monitors so I ruled that out.

    Edit: Nothing else seems to be wrong, it restarts normally and worked quite well other than the gel.

    Update the drivers for the chipset of your motherboard site and get the latest drivers for your graphics machine

    Do NOT use windows update to recommended, which includes drivers

    If the problem repeats itself then clean boot PC & retest

    https://support.Microsoft.com/kb/929135?WA=wsignin1.0

  • Library CC animate sounds how to tie and how to stop and play?

    Library CC animate sounds how to tie and how to stop and play?

    for example:

    allSounds = ["snd_1", "snd_2"]; ("snd_1" - the name of link)

    myInstance = createjs. Sound.Play(allSounds[0]);

    allSounds = ["snd_1", "snd_2"];

    allInstances = [];

    allSounds.forEach (function (item) {}

    var audioInstance = playSound (item);

    allInstances.push (audioInstance);

    });

  • Oracle form functions and procedures in the APEX, how?

    I'm working to recreate in the APEX, already existing read only forms in Oracle Forms. Report features interactive APEX among other things, in fact worth as well as to target a different audience than utilizies versions of Oracle Form. Versions of Oracle Forms use a lot of pre and post query triggers, PLSQL functions.

    In Oracle Forms that places, these functions can be found in the "Units of program" section of the form. A feature typical of this kind, based on a particular Mission ID route, collecting names of regular passengers, is shaped with a comma and a space after each of them, in a single string that is returned and displayed the list of passengers of a line.

    I have all of this written code so I can move most of the main request of the Oracle form in an interactive report. These functions and triggers called in the form of the "Units of program" section of the Oracle form rather than stored in the database schema in a package, where they would go inside the APEX? Can I create a 'shortcut' in the APEX and call it from the interactive report "Source Région"? I can create the PLSQL function at the level of the region of the interactive report or page level? Or, my best bet creates a package that is stored in the database, all these functions and/or proecedures I might need the original form of Oracle?

    Some advice would be greatly appreciated.

    RLBickham wrote:
    I don't think I've been pretty clear in the description of the specific thing I want to do, simply, it does not reach the level of forms of conversion of the APEX. It is basically a problem of PLSQL function.

    I have an interactive report which is currently 90 percent of what I want however, each line, which represents a Mission may have several feet. Each arm has two places or ICAO codes attached to it. Based on the number of Mission, I want to loop through the array of leg, collect all the codes of ICAO for this Mission, put them together in 1 variable separated by a coma and add this variable to display the columns in this interactive report as the last column.

    In Oracle Forms, I have a function registered in the database, which is called in the main query. Maybe I ask a question that does not need to be asked, but anyway my question is can I put this function currently in the database somewhere within the interactive report and somehow reference it via Http, or should I just stick with set of functions and procedures in the packages stored in the database and called the conventional way?

    You could switch the function to the database and call it from the report query, but it sounds as if it were superfluous. In the report query using any form of Re: 4. How can I convert rows to columns? is appropriate for your version of the (unspecified) database.

    -----

    When you have a problem, you will get an answer faster, more efficient including information as much information as possible from the outset. This should include:

  • Full version of APEX
  • Complete operating system DB, version, edition, host
  • Architecture of Web server (EPG, SST or APEX listener/host operating system)
  • Browser (s) and version (s) used
  • Theme
  • Model (s)

  • Region/section type (s) (particularly as to distinguish if a 'report' is a standard report, an interactive report, or indeed a 'update report' (i.e. a tabular presentation))

    With APEX, we also had the chance to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproduce things is the best way to solve most of the questions, particularly those relating to the layout and Visual formatting. If you expect a detailed response it is appropriate that you take on an important part of the effort by getting as much as possible with an example of the problem on apex.oracle.com before asking for help on specific issues, then we can see firsthand.

  • Can I create a XSL function and use it in the Word template

    I have a complex logic (complicated if I tell 400 to 500 times) to determine if I should have an expression null. If the value is null or equal to 0 show n/d is the value.
    If I have to repeat over and over again, and it turns out to be necessary an update, it would be a nightmare. But I don't have time to waste on a wild-goose chase either. If I have to do some thing of a few than thousands of times, I better start basically.

    Can I create a function in the word template, then call anywhere in the word for each field template, that I need to check?
    Have a link to a tutorial that does this?

    If you really want to have a function, you have the choice of using submodels (RTF or XSL)

    You can check for the steps detailed here
    http://www.Oracle.com/technetwork/middleware/bi-Publisher/overview/BIP-subTemplate-1-132933.PDF

    But if you have functions or use the code directly you still need to change your fields of 400-500.

    either

    or

  • I use the random function and he know instructions 'case' must end with a ':' but it is!

    I use the random function and he know instructions 'case' must end with a ':' but it is! I put

    case 10000 timer += 2; popupName._visible = true; :

    then I put

    case of 10000 {timer += 2; popupName._visible = true ;}:}

    but he still know it.

    What I am doing wrong?

    First of all, whenever you have more than three similar lines, you should probably refactor something.  Especially when you have 10,000 lines. This should have sounded the alarm, but I guess you are new to this.

    Second, when you have such a long code, paste everything here. Please, I beg you. It's a pain to navigate the thread.

    And here's what I * think * you really want:

    If (random (10001) == 10000) {}

    timer += 2;

    popupName._visible = true;

    }

    It simply means: "take a random number between 0 and 10001 (exclusive). If this number is 10,000, do something. If not, ignore this code block. »

  • How to remove the sound notification of opening and closing foxfire

    Whenever I open or closed foxfire 36.0.4 I hear a gong, would like to turn off.

    Thank you all, just fixed it. I have pro with sense of power system mechanic.
    It has a checkbox for the sound notification. Uncheck and bong went
    opening and closing of firefox. Still don't know why he touched just this one
    browser and not others.

  • My Macbook Air uses El Capitan 10.11.5. This operating system repeatedly freezes and the computer must be turned on / repeatedly.  How to solve this problem?

    My Macbook Air uses El Capitan 10.11.5. This operating system repeatedly freezes and the computer must be turned on / repeatedly.  How to solve this problem?

    Hello

    Check if the hard disk needs repair.

    Open the disk utility, located app in HD > Applications > utilities

    Select Macintosh HD on the left then click the first aid tab, and then click Run.

  • Is it possible to play different sounds for the emails and instant messages?

    Hello

    I was wondering if it was possible to play different sounds for the emails and instant messages. I use Thunderbird quite often with emails and instant messages imported from Gtalk.

    I think it would be very convenient to be able to distinguish the two sounds, because they do not involve the same things.

    Thank you very much.

    Olivier Hubert.

    There are only six modules of cat, three of them are on notifications. Choose the one you think will do the job for you. https://addons.Mozilla.org/en-us/Thunderbird/Extensions/chat/?sort=popular

  • I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    BabsMKE wrote:

    I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    settings - do not disturb - off

Maybe you are looking for