A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: gotoAndStop only moves forward along timeline, not backward???

Hybrid View

  1. #1
    Member
    Join Date
    Aug 2003
    Posts
    84

    gotoAndStop only moves forward along timeline, not backward???

    Ok, this is kinda weird... I have pretty standard buttons and then just tell the timeline to go to a specific label. But it only moves forward along the timeline, not backwards. I have the below ActionScript on the first frame @ "Home", and its the only key on that layer for the whole time, so I assume that all these buttons should work no matter the current frame along the timeline. If I click on Btn_2ndThing, nothing happens when I then try to click on Btn_1stThing, but if I click on Btn_1stThing FIRST, then it will go to Btn_2ndThing. make sense?

    Actionscript at Home frame:

    onEnterFrame = function(){
    Btn_Home.onRelease = function()
    {
    gotoAndStop ("Home");
    }
    Btn_1stThing.onRelease = function()
    {
    gotoAndStop ("1stThing");
    }
    Btn_2ndThing.onRelease = function()
    {
    gotoAndStop ("2ndThing");
    }
    }

    The names of the buttons is also consistant throughout the timeline..

    Help!

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    are your buttons included on every frame and do you have any keyframes on the buttons layer? if you do have keyframes on that layer remove them. Also you don't need to wrap your button functions in onEnterFrame so you can remove the first and last line of your code.

    good luck!
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Member
    Join Date
    Aug 2003
    Posts
    84
    I think the onEnterFrame is what is actually screwing things up. I failed to mention that I have other layers with other actionscripts that have other Button commands onEnterFrame. I take it that when it gets to a frame with onEnterFrame, it "forgets" the other buttons? anyways, it seems to be working now that I've removed the onEnterFrame from everywhere...

    not sure why I added that in the first place, I think I had a reason for it about 6 months ago, but forgot why...

  4. #4
    Member
    Join Date
    Aug 2003
    Posts
    84
    Ok, I spoke too soon, its not working, and now I remember why I sorta remember why I used the onEnterFrame, to get it to work. Even though I have the button actionscript along the entire timeline, its not working.

    I have a seperate layer for the buttons, and yes there are keys on them, but thats because I am changing the buttons from frame to frame

  5. #5
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    can u post the fla?
    Evolve Designs Interactive Media
    the natural selection

  6. #6
    Member
    Join Date
    Aug 2003
    Posts
    84
    Here is an example. If you click on 1stButton, it shows you Goalie and Referee. Then click on Goalie and you won't be able to click on Referee (or make it go there anyways). Vice versa is a little weird as well.

    I would assume that since the Actionscript is the same along the whole timeline after 1stButton that you should be able to click on either button at any time while they are shown.

    I'm probably doing something stupid...
    Attached Files Attached Files

  7. #7
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    one of your ref buttons didn't have a capital R, works fine now
    Last edited by EvolveDesigns; 12-28-2007 at 03:51 PM.
    Evolve Designs Interactive Media
    the natural selection

  8. #8
    Member
    Join Date
    Aug 2003
    Posts
    84
    ahh crap, sorry I tried to recreate the problem and evidently created a different one with a typo. I was hesitant to send out this fla since my work doesn't let me do that, but here it is without any of the stuff that they care about. This one is screwy... If you click on EAD you can't click on BodyShop, if you click on Lighthouse, you can't click on anything to the left of it... same goes for the 2nd row of buttons.

    thanks for your help! its much appreciated.
    Attached Files Attached Files

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center