A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: goto a specific frame inside a movieclip

  1. #1
    Member
    Join Date
    Oct 2002
    Posts
    62

    goto a specific frame inside a movieclip

    I have a time line with 2 frames only. On frame 1 I have a Movie Clip that contains a gallery and its called "gal1" on frame 2 I have another Movie clip called "gal2". Now I have 2 buttons to call each of these galleries which this code in them:

    on(release){
    _root.gal1.gotoAndStop("1");
    }

    But when I am in gal1 and I want to click on the second botton to call gal2 with the same exact code attached to button2, it doesnt work!!!

    can anyone help?

  2. #2
    Billionaire Philanthropist
    Join Date
    May 2010
    Posts
    11
    Ok i I understand your problem, just fill me in if I'm missing any crucial details...
    you'll need to create three layers on the root scene i.e. Scene One.

    on the top layer label it "actions" and give your two keyframes a "stop();" action within actionscript

    on the middle layer are you buttons, again assuming you've labeled them btnGal1 and btnGal2. put them inside a seperate movie clip called "buttons_mc".

    finnaly layer three is you galleries. With this is gets a little tricky, first off you MUST give the movie clips that contain your galleries Instance Names (simply click on the movie clip itself and type in (e.g. Gal1) into the text Area labeled "Instance Name" and then hit enter.

    Repeat the action with the movie clip containing Gallery Two, and give it an instance name of "Gal2".

    Also remember to give the frames that contain your gallery movie clips, frame labels... i.e. GalleryOne and GalleryTwo respectively.

    Now for the actionscript behind the buttons.
    Go into the movieclip containing your buttons and behind btnGal1 in actionscript type the following

    on (release) {
    this._parent.gotoAndPlay("GalleryOne");
    gal1.gotoAndPlay(1);
    }

    behind the second button, which presumably will lead to Gallery Two
    type the following in actionscript

    on (release) {
    this._parent.gotoAndPlay("GalleryTwo");
    gal1.gotoAndPlay(1);
    }

    hope this helps, if not let me know i will try to resolve it as best i can.

  3. #3
    Member
    Join Date
    Oct 2002
    Posts
    62
    Thank you so much.

    Ok i did as you advised. Many of the issues are solved but

    when I am viewing Gal1 after few pics when I click on Gal1 button I want to start over the Gal1 but it stays where it is, even though you have the code: gal1.gotoAndPlay(1); placed in there but somehow when you are already in there viewing for example fram 21, you click this again it wont take you habe to 1!

    I have attached the file if I can not explain it clear.
    http://poursohi.com/gallerysite1.fla.zip

  4. #4
    Senior Wabbit
    Join Date
    Jul 2008
    Location
    Winchester, Uk
    Posts
    215
    Hmm I see your using CS4 or 5 so cant view the files, but try naming the frame, as numbers are not very reliable.
    See if this works if not if you save down to format cs3 or lower I can take a look

    Trust my code, and not my english.

  5. #5
    Member
    Join Date
    Oct 2002
    Posts
    62

  6. #6
    Senior Wabbit
    Join Date
    Jul 2008
    Location
    Winchester, Uk
    Posts
    215
    Fixed your issue you were only missing the _root
    Though I have also changed a few other parts removing some stops and changing gotoAndPlay to gotoAndStop.
    Also reorganized the navigation.
    Reducing the zip from 1.3MB to 1MB (with swf inc)

    If you need anything else just contact me anytime.

    your file
    www.hobo-town.com/Flashkit/Gallery.zip

    Trust my code, and not my english.

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