A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: gotoAndPlay(1)

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    3

    gotoAndPlay(1)

    You've all heard this before, I'm really a newbie so please help with this super-simple movie.
    I've banged my head for three days, tried AS2, AS3, many different pieces of code from posts on the web and I CAN NOT for the life of me figure out how to make my little two-frame movie go back to frame 1.
    On the main timeline, in frame 1 I have ten images that look like vertical blinds. I made them all buttons with the image inside them movie clips. These buttons take you to other frames on the timeline, no problem.
    What I want to do is be able to simply go back to frame 1. I created a new button named btn_back, put that on say, the image on frame 2 but nothing I've tried will allow that button to go back to frame 1. Just doesn't work.
    Here is the latest simple AS2 code I'm trying:
    stop();

    btn_1.onRelease = function () {
    gotoAndStop(2);
    }

    btn_back.onRelease = function () {
    _root.gotoAndStop(1);

    }

    Why won't this work?

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    It might be easier if you upload your fla?

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    I managed to get this to work finally but putting the AS on the actual button but I've read that this is not exactly best practice.
    I'd rather operate in a best practice manner so can anybody speak to this?
    Also, I'd be happy to post the FLA if that would be helpful in accomplishing what I want to do without using AS on buttons.

  4. #4
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    The best practise is to place your code on the timeline. Take a look at these links:

    http://770c1363.tinybucks.net
    http://4f5e6ad6.tinybucks.net

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    Thanks so much for taking the time.
    I looked at the links you provided and those are very helpful indeed. I plan to study this further and also plan to use the best practices described in them going forward.
    Meantime, I beg you to look at this FLA and tell me, if you will, why I can't go back to frame 1 in this movie using btn_back.

    http://files.me.com/tgapen/qbwj38

    Too large to upload here.

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