How best to handle a start button and a play-pause toggle button?

Hello,
Still new to AS3, on a project for a client. I'd appreciate advice on how best to handle the navigation for 5 movieclips set inside 5 separate frames on the main timeline. I have a play button on frame 1 to start the animation, but I'd like to include a play/pause toggle button on the other frames to finish the navigation. Everything works except the toggle button, when clicked, does toggle but does not stop the animation. I've copied the code, including the toggle button code on frame 4 below. How best to handle both a start button and a play-pause toggle button?
Thanks for any help in advance.
Frame 1:
PlayBtn_mc.buttonMode = true;
stop();
PlayBtn_mc.addEventListener(MouseEvent.CLICK,startMovie);
function startMovie(event:MouseEvent) {
gotoAndPlay(2);
Frame 2:
stop();
Frame 3:
stop();
Frame 4:
RewindBtn_mc.buttonMode = true;
RewindBtn_mc.addEventListener(MouseEvent.CLICK,rewind);
function rewind(e:MouseEvent) {
prevFrame();
FFBtn_mc.buttonMode = true;
FFBtn_mc.addEventListener(MouseEvent.CLICK,forward);
function forward(e:MouseEvent) {
nextFrame();
ToggleBtn_mc.buttonMode = true;
ToggleBtn_mc.addEventListener(MouseEvent.CLICK, doToggle);
function doToggle(myevent:MouseEvent):void {
ToggleBtn_mc.play();
Frame 5:
(Loops back to Frame 1)

I can't tell you how appreciative I am of all your assistance.
Could you double-check on this, I may have stumbled upon somthing- I tweaked your last code, which toggled, but didn't seem to call the scene_test_mc into action.
But I copied below what both toggles the play/pause button and calls the mc into action. Could you verify this as reliable code and not a fluke that will break? Thank you so much! :
ToggleBtn_mc.buttonMode = true;
ToggleBtn_mc.addEventListener(MouseEvent.CLICK, doToggle);
scene_test_mc.buttonMode=true;
scene_test_mc.addEventListener(MouseEvent.CLICK, doToggle);
function doToggle(myevent:MouseEvent):void {
var mc:MovieClip=MovieClip(myevent.currentTarget);
if(mc.currentFrame==1){
mc.gotoAndStop(2);
scene_test_mc.play();
} else {
mc.gotoAndStop(1);
scene_test_mc.stop();

Similar Messages

  • How can we handle CLOB in Universe and WebIntelligence

    Hi,
    Could  you explain how can we handle CLOB in Universe and WebIntelligence?If we use CLOB in either of this,how is the  Report performance ?Is the perfomance of report degraded? Appreciate your help.
    Thanks,
    Swapna

    Hi,
    There is no way around this, long texts are big chunks of data that have to be moved from the database to the webi report.
    Depending on how many rows of data you retrieve this can become a problem in various spots.
    1) network traffic (lots of data to move over the network).
    2) webi report memory (lots of data that needs to be stored in memory to work with the data).
    So you need to limit the query in either the number of rows being retrieved,
    or in the size of the data that is retrieved per row.
    Depending on your use of message text, you can limit long text object to a smaller number of characters.
    (Universe, Parameters, Controls...)
    Depending on your version of database and BO, the default of this value is 1000 or unrestricted.
    It might be that you just need an idea of the message and can limit this to 100 chars or similar, which should help performance.
    It is also possible that the text is always 'long' padded with spaces, in this case it can help to trim the message column in the universe already.
    Good luck,
    Marianne

  • How best we can use the Rollback and RollbackAlways mechanism in Visual Studio Release Management Template

    Hello All,
    We need a clarification on Rollback and RollbackAlways in Release template.
    We checked a scenario for Rollback and RollbackAlways:
    In Release Template, we have the first activity as “Configure Application Pool” and then followed by a rollback action of “Create Application Pool”
    and “Create Web Site” then followed by "Code Deployment" via TFS build.
    We tested with 2 scenario’s:
    With App Pool and Web Site already existing: when triggered the build, configure
    app pool succeeded, then Rollback action was skipped (as previous action was successful), finally deploy the code executed (code deployed) and build got succeeded.
    Deleted App Pool and Web Site: when triggered the build, configure app pool failed (as no app pool existed), Rollback action executed (as previous action failed) – created app pool and web site then finally
    deploy the code executed (code deployed)
    But build failed (Error: Configure app pool action failed).
    Ideally the build should succeed as the roll back action got executed and code deployed successfully.
    Please correct us if our understanding is wrong.
    Also, Kindly let us know how best we can use the Rollback and RollbackAlways mechanism in Release Management
    Looking forward for your positive response.
    Thanks in advance.
    Regards,

    Hi Shashank,
    Rollback Always runs if any of the actions in the template failed. Rollback will run if action just above rollback fails or if any of the actions below the Rollback fails.
    Article here (http://www.incyclesoftware.com/2014/03/understanding-rollbacks-release-management/) clearly explains how Rollback and Rollback
    Always work.
    I think you come across this issue since you are using build to do the "code deployment" action. You should use the release template to do that. 
    As far as I know you cannot use Rollback to achieve condition check (App pool exist in your case) action.
    For this you can create your own Power Shell component (which checks if the app pool exist and is not create it) and add it as a tool in RM server (RM Server Inventory).
    Another option is you can follow the workaround in below thread "Answer" quoted below. That is execute Remove app pool regardless if it exist or not (which does not fail) and then create app pool.
    I was able to get it working by removing the app pool which does not fail if it doesn't exist. Removing then creating seems the long way around but it works.
    Flow:
    Remove Application Pool
    Create Application Pool
    https://social.msdn.microsoft.com/Forums/en-US/43bf21c8-e233-4e58-a5a8-2592b78bc466/vs-2013-release-management-create-application-pool-fails-if-it-already-exists?forum=tfsbuild
    Cheers!
    Chaminda

  • How to get handle of a button that i created through Customisation?

    How to get handle of a button that i created through Customisation?
    I tried this in processformrequest ..failed :(
    String str2 = paramOAPageContext.getParameter("AutoDialler");
    if (str2 != null) {
    System.out.println("Inside AutoDialler Hurray");
    }

    this works well
    but can you give documentation support of whatever you are saying?
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    OASubmitButtonBean oasb= (OASubmitButtonBean)paramOAPageContext.getWebBeanFactory().createWebBean(paramOAPageContext,"BUTTON_SUBMIT");
    oasb.setID("xxSubmitAutoDialler");
    oasb.setUINodeName("xxSubmitAutoDialler");
    oasb.setEvent("xxSubmitAutoDialler");
    oasb.setText("xxSubmitAutoDialler");
    paramOAWebBean.addIndexedChild(oasb);
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    if ( strEvent.equals("xxSubmitAutoDialler"))
    //IMPORTANT Get this by calling the Function that loops for records.
    System.out.println("Inside processFormRequest Hurray");
    }

  • Just bought my 1st mac. I have some wma format music files which wo'nt play on i tunes. How best to convert these files so they will play on iTunes?

    just bought my 1st mac. I have some wma format music files which wo'nt play on i tunes. How best to convert these files so they will play on iTunes? Any suggestions much appreciated

    Try using VLC Media Player 2.0.6. EasyWMA 3.3.5  or Music Converter 1.5.1 should be able to convert them to .mp3.

  • How best to handle multiple web sites using iWeb 08

    I currently am using iWeb08. I am maintaining two websites; The church site resides on a Rogers server. I use Transmit as a FTP loader. The other site is an engineering society's website that is posted on Apple's server. I have an ME account just for the latter group. iWebsites is used to alternate between the two sites. The church group has a .ca web address.
    Is it worth upgrading to iWeb 09? How does iWeb09 handle 2 websites? I wish I could publish both to the Mac account but have not figured out how. I must retain the rogers account for viewing the church site
    Has anyone deleted iWebsites from OX10.5.6? How was it done? I know that backups are mandatory before attempting these changes.
    Thanks,
    Bill

    In its current form, iWeb '09 doesn't handle publishing well at all!
    I keep all my sites on separate domain files, each in their own folder. Any site is launched in iWeb by double clicking the domain file. I start each new site from a new, blank domain file.
    I keep all my website folders in a folder in a second dock so that I can launch any site with two mouse clicks - faster than you can launch iWebsites!
    You can publish as many sites as you want to one MobileMe account but you can only have domain name forwarded as Cname. Any more have to use masking with all its inherent problems.
    I would be more inclined to dump MobileMe and publish both sites to a decent hosting company.
    The new iWeb '09 FTP works for some. I have tested it with my server - Host Excellence - which doesn't force you to upload to a Public_html folder and this goes as planned.
    Having said that, I still publish to a local folder as I optimize and upload my files using Web Site Maestro. Once you have published your site for the first time, this application will then use its Smart Handling feature to process the changed files only.
    Unless all your viewers use Macs you have to optimize to get your pages to download in that browser that all the Fred Flintstones of the world use.

  • How to use an external start button for 6024E w/ sc-2345, I would like it to function like a start button in LabView but I don't know how to connect the external button to the sc-2345's connector block

    I am confused as to how to connect my external start botton. I would like it to function like a start button on a front panel of a VI. I would like to use the +5V on pin 14 but I really don't know where to go from here. Any guidence for a novice would be most appreciated.

    phod,
    This is the LabVIEW Real-Time forum, so I suggest that in the future that you post this type of question to the Multifunction DAQ forum.
    For the simplest solution you will have to connect your button to a digital line of your board, consult the sc-2345 user manual for a diagram of where these lines are exposed. You will have to connect your start button in series with a line that is high, such as your 5V pin or another digital line. Then connect this to a digital line that will be your start trigger.
    Your program can poll the digital line that is connected to your button in a while loop and when it goes high, it lets the rest of the program execute. For the programming, I suggest you take a look at the shipping examples that come with LabVIEW. If yo
    u have LabVIEW 7.0 go to Help>>Find Examples. Open Hardware Input Output>>Traditional DAQ>>Digital Input and Output>>E Series for some examples of digital I/O programming with E-series boards.
    Hope that gets you started.
    Gerardo

  • Moved to smaller SSD - how best to handle iTunes situation

    I had about 40GB of iTunes data.
    After, installing the new SSD, my music folder is currently empty.
    How best can I move my iTunes essentials to the SSD and leave most of the music on the external drive where the original cloned HDD sits?
    Thank you!

    I don't have iTunes11.  I am assuming it behaves similarly to earlier versions as regards to library behavior.
    So what I was hoping I can do is a scenario where I iTunes can launch alright, but not play music until I connect the drive with the music. So when I need the music, I will have to attach the USB drive.
    I am confused by what you are trying to accomplish here. Your phone can't sync if your music is on another drive and that drive isn't attached.  There would be few reasons to have your media on one drive and still start iTunes.  You can do it but anything requiring that media won't work, such as syncing.
    Responses to:
    1) If iTunes will automatically launch when the phone is attached then it should continue to do so, but you will need to make sure the drive is attached first.
    2)  No need for symbolic links and those don't fool iTunes anyway.  If your whole library is on an external drive, start iTunes with the option key held down and guide it to the iTunes Library.itl file in the itunes folder on that drive.  It will automatically use that library whenever iTunes starts.  However, should you forget to attach the drive before starting iTunes it will probably make or revert to any copy on the internal drive and you will have to restart it with the option key held down, etc.  Yes, this is annoying but unfortunately Apple is heading two different directions with their computers and drives getting smaller while marketing multimedia which requires larger drives than previously. Of course their solution is Match but personally if I don't have a copy on a drive totally under my control I am not comfortable.

  • How do I decrease the start up and shut down time?

    Processing pin wheel becoming more prevelant an time for start up and shut down is increasing.

    Start by using this utility that is already on your Mac:
    Using Activity Monitor to read System Memory and determine how much RAM is being used
    What Mac OS X are you using?
    How much Green in the pie chart? How much Blue?
    How many pageOuts since last startup?

  • How to use SQL filtercondition 'Start with' and 'connect by' in ADF's LOV?

    Hello every!
    I can not use 'Start with' and 'connect by' with parameter in creating ADF's LOV?
    How could I do with it?
    Alex

    assuming you are using adf 11g,
    You need to use View Criteria with the View Object attribute that has a LOV model.
    Follow this, to get some idea http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-oracle-adf-11g-update.html
    hope this helps,

  • How to make a movie start automatically and loop continuously

    Hi there,
    Two beginner questions here for a kind helpful person out there. I have searched the Encore help option but the answers all refer to menu options.
    I have exported a simple movie from Premiere into Encore. There is no menu. It if for a museum and the client wants to simply insert the DVD and for it to launch itself and then play on a continuous loop. They don't want any interactivity.
    So, my question is how do I apply a simple, 'on insert - play' rule and 'on end - go back to beginning and play' so that this happens automatically?
    Thanks in advance for any help.
    M

    Hi peachespeaches,
    rightfully, at the Menu>properties>Motion>just make sure the "Loop #:" stated "Forever" and your "Loop Point" and "Duration" will automatically adjusted when you insert the movie clip on the background of your Menu. I'm using a CS5 Encore... Trying out for very long time yet couldn't achieve it... However, I use to do it on Encore 1.5, no problem at all, it works! Just don't know why it doesn't on CS5 Encore... I'm suspecting that the software I'm holding might have some problem? Hope you are using CS5 Encore also, could you try on and let me know if it works on your side?
    Jaze,
    [email protected]

  • Play pause toggle button

    Hi,
    I'm new to Flash. Kindly help anyone.
    Need assistance to create toggle button. Here attaced two screenshots.
    1. inner-animation.jpg - it contains all movie clips and play pasue controls.
    2.main-animation.jpg - this is the main timeline ( inside all movie clips & control buttons)
    3.playbuton-inside.jpg - its a button symbol ( as well as pause )
    4. There also bg music and sounds for some particular animation.
    Here all working fine. But i need play & pause animation as a toggle button.
    Here is the code i added for pause:
    play();
    pause_btn.onRelease=function(){
    stop();
    Here is the code i added for pause:
    stop();
    play_btn.onRelease=function (){
    play();

    You are using AS2 code, so you should be posting in the AS2 forum (http://forums.adobe.com/community/flash/flash_actionscript?view=discussions).  If the intention is to use AS3 code, then you need to change things.
    If the intention is to use the same single button for both pause and play, then what you normally would do is establish a boolean variable that you se to determine whether the clicking of the button should play or stop the movie...
    var playMovie:Boolean = true; // assumes the movie is stopped at the start
    pause_play_btn.onRelease = function (){
       if(playMovie){
           play();
           // manage play/pause btn
       } else {
           stop();
           // manage play/pause btn
       playMovie = !playMovie; // reverse the value of the playMovie variable
    In that code where I show "// manage play/pause btn" is where you need to do whatever you need to make the pause/play button appear as intended... either hiding one or the other, or changing its frames to show the appropriate image.

  • Animation couldnt control with Play pause toggle button..

    I have multiple movie clip with bg sound.I have used the code AS3 for toggling the animation ( Play & Pause ).Automatically the animation starts and button also togggled on click but couldnt control the animation .
    I need some solutions like when the intial stage the animation wont start etither the button click to play.After that the flow as it is in action ( ON Click ). Kindly anyone guide me to solve it. i'm very new to flash. this is my first project and ihave to finish it soon..
    btns.visible = false;
    btns.addEventListener(MouseEvent.CLICK,onEl);
    dfr.addEventListener(MouseEvent.MOUSE_OVER,onEls);
    dfr.addEventListener(MouseEvent.MOUSE_OUT,onEld);
    btns.addEventListener(MouseEvent.MOUSE_OVER,onEls);
    btns.addEventListener(MouseEvent.MOUSE_OUT,onEld);
    var _vrSts:int = 0;
    function onEl(eve:Event):void    {
        if(_vrSts)    {
            trace('status:'+_vrSts);
            _vrSts = 0;
            btns.gotoAndPlay(1);
        }else    {
            trace('status:'+_vrSts);
            _vrSts = 1;
            btns.gotoAndStop(2);
    function onEls(eve:Event):void    {
        btns.visible = true;
    function onEld(eve:Event):void    {
        btns.visible = false;

    Hi Ned!
    i done it. here is the solution.One issuse is" End of the animation it goes to 1st frame with pause button, but intially there has play button."
    stop();
    btns.visible = true;
    btns.addEventListener(MouseEvent.CLICK,onEl);
    dfr.addEventListener(MouseEvent.MOUSE_OVER,onEls);
    dfr.addEventListener(MouseEvent.MOUSE_OUT,onEld);
    btns.addEventListener(MouseEvent.MOUSE_OVER,onEls);
    btns.addEventListener(MouseEvent.MOUSE_OUT,onEld);
    var _vrSts:int = 0;
    function onEl(eve:Event):void    {
        if(_vrSts)    {
            //trace('status:'+_vrSts);  
            _vrSts = 0;
            //btns.label = "Play";
            btns.gotoAndPlay(1);
            btns.visible = false;
            //if(currentFrame == 445)
                //gotoAndPlay(1);
                if(currentFrame == 445) {
                gotoAndPlay(1);    
                btns.gotoAndStop(1);    
            else
               stop();
            //btns.gotoAndStop(1);
        }else    {
            //trace('status:'+_vrSts);
            //stop();
            _vrSts = 1;
            btns.gotoAndStop(2);
            //btns.label = "Pause";
               play();
    function onEls(eve:Event):void    {
        btns.visible = true;
    function onEld(eve:Event):void    {
        if(_vrSts)
            btns.visible = false;

  • ?ipod no longer turns off by pressing and holding play/pause on click whee

    ipod had turned off before, but now cannot turn it off. It continues to stay on. I've tried to use hold switch to see if that helps, but ipod still won't turn off, and it uses up my battery. hold play/pause button doesn't seem to work?

    Did you try resetting it? I had the same problem with my 30gb video and it worked.

  • E4X and Namespaces - How best to handle?

    Hi,
    I need to use E4X to create a list of nodes of a particular type from an xml document returned form a Web Service. The document uses multiple namespaces, so I can't access its content, event nodes which aren't prefixed with a namespace.
    I can get round this problem by using:
    namespace all = "http://www.w3.org/2005/Atom"
    use namespace all;
    in the class which parses out the nodes, however, I want to wrap the nodes in an XMLListCollection and set them as a list's dataProvider, and becuase the node's themselves have namespaces declared, it seems that the list can't access the nodes (which all have a label property) and displays the whole node instead.
    What is the correct way to handle this situation?
    Thanks.

    Hi Alex,
    Thanks for the reply. Overlooked that completely.

Maybe you are looking for

  • The Sims 2 after OS 10.4.3 update

    Does anyone know of, or has experienced, a problem with The Sims 2 after updating to OS 10.4.3? The game worked fine in 10.4.2, but now the Sims tool bar won't stay displayed unless the mouse pointer is in the lower left corner of the screen, as soon

  • G3 beige minitower doesn't see HDD

    I just tried putting a new hard 80GB unformatted drive into a Beige G3 minitower (300Mhz) whose original HDD failed long, long ago. The G3 itself had not been booted in nearly two years. Everything about the machine seems to be working fine--the flop

  • Cannot add file to Documentum. "Create" operation failed for object id=null

    Upgraded ro Frame 11 recently and now I cannot add a new document to Documentum. I get the following error. I still have Frame 10 installed and can check in the document with it, but Frame 11 does not recognize it as a FrameMaker file.

  • Where Client ID and Client Secret of SharePoint .app file will be stored

    Where Client ID and Client Secret of SharePoint .app file will be stored, i had published my app in the production, and now i need to enhanced the app, and i want to publish my app again, so where can i get my previous Client ID and Client Secret

  • TS3320 "too many redirect occurred" error message on iPad using a bookmark

    I get the error message "too many redirect occurred" when using a bookmark to connect to a site. Safari is disabled in settings. This worked fine for about 5 months. Recently it stopped working. Now the site will only open going straight through Safa