Problems with Next and Back Buttons ActionScript 3.0

Hi,
I have set up a Back, Play and Next buttons in a slideshow I am making.  The next and back buttons work correctly until it gets to the end. 
If I press the Next button it goes back to what appears to be Frame 1 and will not go to the next slide. If I press the Back button it will then go to Frame 201 and If I press next again it will go to Frame 1.  It will only go back and forth in between those frames.
If I press the Back button from the beginning it goes through the slide show correctly then it gets stuck at Frame 1.  If I press next button it goes to Frame 121 and gets stuck in between 121 and 1.
I can't figure this out please help.
My code on Frame 1 is:
stop();
play_btn.addEventListener(MouseEvent.CLICK,playslideshow);
function playslideshow(event:MouseEvent) { gotoAndPlay(2); }
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
  gotoAndStop(40);
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_8);
function fl_ClickToGoToAndStopAtFrame_8(event:MouseEvent):void
  gotoAndStop(281);
My code on Frame 40 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_7);
function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):void
  gotoAndStop(121);
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_9);
function fl_ClickToGoToAndStopAtFrame_9(event:MouseEvent):void
  gotoAndStop(1);
My code on Frame 121 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);
function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
  gotoAndStop(201);
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_10);
function fl_ClickToGoToAndStopAtFrame_10(event:MouseEvent):void
  gotoAndStop(40);
My code on Frame 201 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_4);
function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
  gotoAndStop(281);
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_11);
function fl_ClickToGoToAndStopAtFrame_11(event:MouseEvent):void
  gotoAndStop(121);
My code on Frame 281 is:
forward_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
  gotoAndStop(1);
back_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_12);
function fl_ClickToGoToAndStopAtFrame_12(event:MouseEvent):void
  gotoAndStop(201);

I found the solution!  Flash CS5 Tutorial 6 Click On Button Go To Another Frame.avi - YouTube
I had to Convert to Keyframes each frames I wanted to jump to on the buttons layer.  Then highlight the button and give each another instance name! Like forward1_btn, forward2_btn, back1_btn, back2_btn...  I did that and adjusted the action-script for each button.
Frame 1
stop();
play_btn.addEventListener(MouseEvent.CLICK,playslideshow);
function playslideshow(event:MouseEvent)
gotoAndPlay(2);
forward1_btn.addEventListener(MouseEvent.CLICK, Shoot_1);
function Shoot_1(event:MouseEvent):void
  gotoAndStop(40);
back1_btn.addEventListener(MouseEvent.CLICK, Back_1);
function Back_1(event:MouseEvent):void
  gotoAndStop(281);
Frame 40
forward2_btn.addEventListener(MouseEvent.CLICK, Shoot_2);
function Shoot_2(event:MouseEvent):void
  gotoAndStop(121);
back5_btn.addEventListener(MouseEvent.CLICK, Back_5);
function Back_5(event:MouseEvent):void
  gotoAndStop(1);
And so on...

Similar Messages

  • How do I use edge commons composition loader to load multiple compositions with a next and back button?

    I am working on an interactive book and have set up each page as a separate composition in edge.
    I am using  the edge commons JS library to load multiple compositions into a main composition.
    You can see how this works here: Edge Commons - Extension Library for Edge Animate and Edge Reflow | EdgeDocks.com
    The way the edge commons tutorial is set up requires a button for each composition i want to load. I am interested in loading multiple compositions with a "next" and "back" button, and a "swipe left, "swipe right" gesture on the content symbol that each composition is loaded into. I also need the swipe features on the content symbol not to interfere with the interactive elements on the loaded composition.
    Please suggest a solution that will work without adding additional scripts beyond edge commons and jquery.

    Sort of. I'm using this code inside an action for a button symbol. But it doesn't work perfectly. Trying to debug it.
    Let me know if you have any luck.
    //Check to see if pageCounter already exists
    if (typeof EC.pageCounter === 'undefined') {
      // it doesn't exist so initialize it to first page
        EC.pageCounter = 2;
    //check if the page is only 1 digit -- patch for single digit
    if (EC.pageCounter < 9) {
       // it is, so we need to pad a 0 on the front.
      EC.pageCounterString = "0" + EC.pageCounter;
      //e.g.  01 ...09,11,12,13....115,222352,,....
    else {
      EC.pageCounterString = EC.pageCounter;
    EC.loadComposition(EC.pageCounterString + "/publish/web/" + EC.pageCounterString + ".html", sym.$("container"));
    EC.pageCounter = EC.pageCounter + 1;
    //TODO for back  -1

  • Catalyst Image Gallery: Next and Back button.

    I see a lot of tutorial uses thumbnail images to select specific stage or images using datalist.
    What I'm looking for is how to create a button that function as a 'next' and 'back' button.

    Would this tutorial answer what you are after?
    http://chrisgriffith.wordpress.com/2010/08/14/building-a-scrolling-thumbnail-component/
    Chris

  • Issues with 'next' and 'previous' buttons grayed out in 'Preview'

    First off.. HELLO MAC FORUM!! Woo hoo!!
    I just got a MacBook Pro and I'm LOVING it.. I'm having one small issue that I can't find help with after googling.. when I'm in 'Preview' viewing pics my 'next' and 'previous' buttons are grayed out and I've looked in preferences and don't see where to change this so that I can click through the pics in a folder.. it's pretty annoying and there absolutely HAS to be a way to get this going.. help please!!

    WHEN 'NEXT'.
          PERFORM scroll_end.
    WHEN 'PREVIOUS'.
         PERFORM scroll_left.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_7100  INPUT
    *&      Form  scroll_end
          text
         -->RT_COLUMNS text
    form scroll_end tables rt_columns type kkblo_t_columns.
      ENDFORM.
    *&      Form  scroll_left
          text
         -->RT_COLUMNS text
    form scroll_left tables rt_columns type kkblo_t_columns.
      ENDFORM.
    i've tried this....the previous error gone..but now i have another error said " the type kkblo_t_columns. is unknown ".
    really exhausting :P

  • Had problem with bookmarks, history, back button and google links not working.

    For the last five days i've had problems with firefox. First, i noticed that it was running incredibly slowly and then that all the links in the google search were not working. Then i noticed that neither was the history, bookmarks or back button. I went on to facebook chat to ask for help. First, I was told to reinstall firefox, which didn't work. Then i was told to do a "clean" install where you rename the old firefox folder in the programs folder so that it makes sure when it's installed that everything is new and nothing is corrupted. That didn't work either. I then disabled my antivirus software and firewall to see if that was causing the problem. It was not. Then I installed an anti-malware program to remove any adware or spywar,e which it did remove from my computer, but it didn't solve the problem. The chat person was at a loss and I don't blame him/her because so was I.
    The reason I'm writing this is in case anyone else has the same problem. The only way I solved it was first by uninstalling and making sure to check the little box asking if you want all personal data and such associated with firefox also removed (which removes cookies as well) and then I finally thought to delete all the cookies from the rest of my computer also. Once all the cookies were gone and i had fully uninstalled firefox and personal data, I reinstalled it with a newly downloaded file and it is once again functioning properly. Hope this is helpful to anyone who's been ripping their hair out. :)

    '''I have the same problem!!
    But in my case, not just Google links.
    The problem happens with all the websites links.
    Please...
    Help us!!
    Thnx'''

  • Having issues with longMessage and back button usage

    Hello,
    I have part of an app that consists of 2 pages. The first page is a set of checkboxes and an Analyze (submit) button. when the user hits Analyze, I commit the transaction and forward to the second page which displays the checkboxes they checked and some other information regarding those choices. If a user wants to change their answers, they use the browser's back button and change their choices, then click Analyze again. This is working fine.
    I now want to add a longMessage to each checkbox above with some additional information about each choice. I've setup these up and they work fine; the dialog box launches just fine when they click the little (i) icon.
    So that's the status quo; here's my problem:
    Scenario
    1. User clicks one of the longMessage icons
    2. clears that box by clicking OK
    3. then hits Analyze to progress to the second page
    4. now user hits browser's Back button to go back to questions
    5. PROBLEM
    At this point, all my checkboxes are blank. If I try to re-check one and hit Analyze, I get an error stating "No current row for View (XXXLProcNavVO1)"
    If I don't ever click a longMessage icon, everything works fine. I can only replicate this if I follow the exact steps in the scenario.
    So what is wrong? Why am I losing my current row in my VO when I use the longMessage?
    I've included my CO from page 1 for reference below.
    Thanks!
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package lanl.oracle.apps.icx.por.req.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    //import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.jbo.domain.Number;
    import oracle.jbo.Row;
    import oracle.apps.fnd.framework.OARow;
    * Controller for ...
    public class LANLProcNavCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject vo = (OAViewObject)am.findViewObject("XXXLProcNavVO1");
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction (this
    // is used to ensure correct Back button behavior).
    TransactionUnitHelper.startTransactionUnit(pageContext, "createProcNavForm");
    // This test ensures that we don't try to create a new doc if
    // we had a JVM failover, or if a recyled application module
    // is activated after passivation. If these things happen, BC4J will
    // be able to find the row that you created so the user can resume
    // work.
    if (!pageContext.isFormSubmission())
    am.invokeMethod("initPVO");
    String stringReqHeaderId = pageContext.getParameter("REQ_ID");
    Number defaultReqHeaderId = null;
    try
    defaultReqHeaderId = new Number(stringReqHeaderId);
    catch(Exception e)
    throw new OAException("ICX", "XXXL_INVALID_NUMBER");
    // set this value for subsequent form buttons pressed
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0,defaultReqHeaderId);
    vo.executeQuery();
    if (vo.getRowCount() == 0)
    vo.insertRow(vo.createRow());
    Row voRow = (Row)vo.first();
    voRow.setNewRowState(Row.STATUS_INITIALIZED);
    voRow.setAttribute("ReqHeaderId",defaultReqHeaderId);
    OAViewObject pvo = (OAViewObject)am.findViewObject("LANL838cPVO1");
    OARow prow = (OARow)pvo.first();
    prow.setAttribute("lReqID",stringReqHeaderId);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject vo = (OAViewObject)am.findViewObject("XXXLProcNavVO1");
    // Pressing the "Apply" button means the transaction should be validated
    // and committed.
    if (pageContext.getParameter("Analyze") != null)
    // Simply telling the transaction to commit will cause all the Entity Object validation
    // to fire.
    // Note: there's no reason for a developer to perform a rollback. This is handled by
    // the framework if errors are encountered.
    am.invokeMethod("apply");
    // Assuming the "commit" succeeds, navigate back to the prev page with
    // and display a "Confirmation" message at the top of the page.
    TransactionUnitHelper.endTransactionUnit(pageContext, "createProcNavForm");
    // OAException confirmMessage = new OAException("XXXL", "XXXL_PROCNAV_CREATE_CONFIRM", null, OAException.CONFIRMATION, null);
    // Per the UI guidelines, we want to add the confirmation message at the
    // top of the search/results page and we want the old search criteria and
    // results to display.
    // pageContext.putDialogMessage(confirmMessage);
    vo.clearCache();
    vo.reset();
    pageContext.forwardImmediately("OA.jsp?page=/lanl/oracle/apps/icx/por/req/webui/LANLSupplDocSummaryPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackDoc");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "createProcNavForm");
    pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/icx/por/req/webui/ShoppingCartPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    }

    Hi
    in this scenarion control is not going inside the condition
    if (vo.getRowCount() == 0) and therefore VO is not getting initialized
    why u are counting the row of VO to initialize the VO ,if possible pls remove this condition check ,problem will be solved .pls let me know in case of any issues.
    thanx
    Pratap

  • HT5295 changing function of next and back buttons on podcast app

    is there a way to set the next or back functions to skip ahead or back 15 or 30 seconds?  So instead of going to the next track, when i would press the next button on a bluetooth device, the podcast would skip 30 seconds.

    No.

  • Problem with SAVE and RESET button in WAD

    Hi all,
    We have two queries embedded in save template and we have created two different save and reset buttons for each query. But if i execute save or reset for one query it is working for both the queries. Can i restrict the SAVE and RESET button for a particular query.

    Hi Tilak,
         It appears that though there are two reset buttons, the HTML code for the webtemplete is not arranged to restrict the reset function of the button for each dataprovider used. This may cause the reset function to act globally on all dataproviders . In the XHTML code, please pass a unique instruction to each reset function, such that each instruction corresponds to a unique dataprovider.
    Thanks,
    Nithin Reddy

  • Having a problem with "open" and "import" buttons!

    Hello all,
    I am having some trouble with a basic function in Logic. When I go to "file" and select "import," the window of options appears. However, when I select a file and click the "import" button, literally nothing happens. I have had a similar problem, when I go to the "file" menu and select "open." A window will appear for me to browse to the logic file I want to open, but when I click "open," nothing happens. However, if I manually go to the file and double-click it, then the file will open. The drop-down is set to "All logic document types," though I have tried "all Logic songs" with the same problem. Please help!
    Best,
    Jon

    you know whats funny, this project has to do with arrays of objects and not inheritance. We learned inheritance last week but the lab we are doing which is this, is for arrays of objects. sorry for the confusion lol. so you can completely ignore this, it actually has it in big bold letters at the top of the web page for the lab.

  • Problems with iweb and safari - 'buttons' not working in safari/firefox...

    Hello. Help! I've been using iweb for a while with no probs - but on trying to launch my most recent site I'm finding the navigation buttons (graphic images not text buttons) work fine in iweb on my mac, plus fine on a PC but only partially in safari/firefox browsers... see sarahgreen.me and you will see that none of them work on the home page. Is this some kind of bug? I was wondering if it is anything to do with there being too many objects on the page or something? They are fine on a PC.
    Thanks for any ideas.
    Sarah

    In iWeb do Command-Shift-L to see the layout of the page.
    The content in the Navigation layer is blocking the content of the Header layer. The body layer is empty.
    Move ( +Use Command-drag+ ) EVERYTHING in the Navigation layer and EVERYTHING in the Header layer INTO the Body layer.
    Put content where it belongs.
    Message was edited by: Wyodor

  • Problem with guitar and backing track

    Hi, i link my guitar with the jack cable, but when i go to play i don't hear the sound of my guitar and i don't hear the sound of the backing track too. Why? Somebody can help me?

    You'll have to give us more details! Like:
    - What is "the jack cable"?
    - How are you recording?
    - Are you recording to a guitar track or a real instrument track?

  • Problem with Next Page(P+) button for VF02 during BDC(Call Trans)

    Hi guys,
    I have doing a BDC program that manipulates the pricind condition of a billing documents(VF02). Naturally we all know the process involves ticking the checkbox of the line item and press "Pricing" to enter the screen number 620(Pricing Condition page).
    My problem is that if I try to call the BDC_OKCODE of 'P+' via call transaction in mode 'N', the process doenst run as planned. However, If I use mode 'A', and simulate the process, the BDC appears to work fine.
    My superviosr claims the problem is due to related to the table control of the pricing page. My question is what can be done here?
    Thanks guys and good day.

    Yep, the position to really helped me in a couple of transactions that would have given me a real problem otherwise. 
    I have heard about Srinivas suggested before, I never actually had to use it so I didn't want to tell you to do that if I don't know that it works.  But now we know.
    Good one Srinivas.
    Regards,
    Rich Heilman

  • All kinds of problems with syncing and backing up

    Can anyone help?
    My iPad gets only so far through the sync process before I get a window telling me my iPad has disconnected or that the disc cannot be found. The only way I can get it to sync is to reset it and sync from scratch, which means re-downloading all my apps.
    Also, before anyone says it, I've tried just backing up the iPad but it won't do that either. I keep getting told the iPad disconnected before it's finished and ends up not copying anything
    Hope someone out there has a suggestion
    Cheers
    Pete

    Hi Ian
    I checked the USB and it all looks alright. I tried syncing again and got told:
    "An error occured while reading from this device"
    which is the normal one i get.

  • How can i create forward and back buttons for a dreamweaver slideshow?

    Hi
    I am an illustrator attempting to create a website in dreamweaver (basically it will be an online portfolio). I would like to have a box/slideshow with images of my work that someone can browse through by clicking 'next' and 'back' buttons. Does anyone know how to do this? I have been trying to find out how to do this for ages - i dont want to use flash if possible as i am worried about making the site too complicated. I know how to make swap image thumbnails, but i think my site would be more user friendly (and look more professional) if i could have next and back buttons. Would this involve complicated css code (which scares the life out of me!) or is there a relatively easy way to do it? I have got two 'dreamweaver for idiots' books, but neither of them cover this topic. Can anyone help?

    If you are using CS4, there is a Command to create a Web Album... this does it automatically for you.
    Otherwise, you can create this manually.  Say you have 3 pages,
    page1.html  (is the index page of the album)
    page2.html
    page3.html
    Therefore, using ordinary text links
    Home would link to page1.html
    Previous would link to page3.html
    Next would link to page2.html
    You would need to make adjustments naturally to each page as you move along with the gallery pages, changing the previous and the next links as needed.  Below is a a basic example of setting up the links in a simple table structure.  You would also then style the table layout as you see fit - yes, using css preferably  :-)
    <table>
    <tr>
    <td><h2>MY GALLERY OF PHOTOS</h2>
    <a href="page3.html">Previous</a> | <a href="index.html">Home</a> | <a href="page2.html">Next</a>
    </td>
    </tr>
    <tr>
    <td>
    <br>
    <a href="../images/img_2401_jpg.jpg"><img src="../images/img_2401_jpg.jpg" border=0></a><br>
    </td>
    </tr>
    </table>
    Here's an article on creating an album using the DW Command I mentioned earlier. You could create the album and then copy and paste the code into a current page if you've already designed on.,... not too difficult, I just tested it.  You do however, need to have Fireworks to process the images.
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda91 10b1f693f21-7ad1.html
    You could also check out the Lightbox effect which is very popular:
    http://www.lokeshdhakar.com/projects/lightbox2/
    Or do a google search for 'jquery'.  There are different album effects using that framework as well.
    Hope some of this helps  :-)
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    Book: Ultimate CSS Reference
    http://www.sitepoint.com/launch/005dfd4/3/133
    http://twitter.com/nadiap

  • I bought an iPhone 5 around fifteen days back and it has already started to give problem with the on/off button. I have to press it five six times to switch it on or off. I am so frustrated by the fact that if I bring it to the service centre, I am going

    I bought an iPhone 5 around fifteen days back and it has already started to give problem with the on/off button. I have to press it five six times to switch it on or off. I am so frustrated by the fact that if I bring it to the service centre, I am going to get a refurbished phone in place of my brand new phone which I just bought. The idea of a used phone repulses me. Any solutions ?

    sumeshdua wrote:
    The idea of a used phone repulses me.
    Why?  Your current phone is used... it has been since the instant it was removed from the shrink wrap and turned on.
    sumeshdua wrote:
    Any solutions ?
    Live with the phone as is.
    Take the device to Apple for evaluation... it may not need replacement.
    Even if it does, neither you or the Apple tech should be able to tell if the replacement is new or refurbished.

Maybe you are looking for

  • Installing All (9iDB,9iDS and report server) in same machine

    I want to use one machine only. I have installed 9i database, and on same 9iDS. and created a report server on same machine i am facing a problem all application runs very fine but on running report from forms by using webs.show_document() a new page

  • Quantity not updated in Asset master after Good Receipts

    Hi, Can someone tell me is it SAP bug after Good Receipts done, base on the following scenarios, if PO specify with Quantity 1 and unit of measurement PC: 1) Asset created without specifiying the quantity and unit of measurement 2) Asset created with

  • Sybase Input Parameter ?

    folks i am trying to execute a sybase stored procedure it expects one input parameter , below is the stored procedure name and the input parameter, sp_case '@sCase_ID' From my program if i pass in <b>Case_ID</b> to this stored procedure , It's compla

  • Chart

    hi all, can any body help me how i can use DATAWEBBEAN chart in jsp thru jdeveloper. thanks in advance Shakeel

  • Receive error message : Prop Res dll not loaded

    I receive the above error message when trying to print a PDF file with Adobe Reader 11.0.03