Skip to main content
July 29, 2009
Question

How to navigate from btn of mc_B to FRAME of mc_A using frame labels?

  • July 29, 2009
  • 3 replies
  • 794 views

I’m using Flash MX (the pre-02004 version) to design a photo portfolio that will be distributed on CDs to potential clients.

It’s broken up into subject galleries, each of which is its own movie clip.  The pages of those gallery movie clips are all separate movie clips, too, regardless of whether they contain single images or layouts of images.  Frame labels with stop codes separate each gallery_mc.

Within each gallery, previous and next buttons allow page-to-page navigation.  From the last page of gallery_A_mc (e.g.), I can to go to the first page of gallery_B_mc by using the following ActionScript:

on (release) {

            this._parent.gotoAndStop("gallery_B_FrameLabel");

}

The problem I’m having, though, is when I’m on the first page of gallery_B_mc, and I want to make the previous button go to the last page of gallery_A_mc.

on (release) {

            this._parent.gotoAndStop("gallery_A_FrameLabel");

}

// Doesn’t work, obviously, because it launches the first page of gallery_A_mc.

on (release) {

            this._parent.gotoAndStop("gallery_B_FrameLabel.gallery_B_mc", 5);

}

// I’d think that this should make it go to frame 5 of gallery_B_mc, which is on the gallery_B_FrameLabel, but it doesn’t make it go anywhere.

on (release) {

            this._parent.gotoAndStop("gallery_B_mc”, 5);

}

// Also doesn’t make it go anywhere.

Can anyone offer me a suggestion?  I’ve been reading books and doing tutorials, and have learned a lot, but I can’t seem to resolve this linkage issue. 

Thanks in advance for any assistance you’re able to provide.

_dwh_

This topic has been closed for replies.

3 replies

August 2, 2009

.

Incidentally, I did make this work by putting the prev and next buttons onto the main timeline, and by scrapping the gallery mc's -- cutting each page mc out of the gallery mc's and putting them onto the main timeline.  That way, the prev button on the first page (frame) of subject B can now go to the last page of subject A with a stop code and an:

on (release) {

     prevFrame();

}

I'd still like to know how this could be done with the original architecture, though (with the prev / next buttons and the image page mc's on the timelines of individual galleries, and with the galleries tagged by frame labels on the main timeline).

.

August 1, 2009

Every object has an instance name.

Does anyone else have any suggestions

about how to link these two things?

kglad
Community Expert
Community Expert
July 29, 2009

label the frame you want to naviagate to when the previous button is pressed and use that in your goto parameter.

July 29, 2009

Thanks very much for responding, kglad!

//

Your suggestion sounds like an obvious solution, but I still can’t get it to work.  I labeled the last frame of gallery_A_mc as gallery_A_lastPage, but I’m still having trouble getting the previous button on frame 1 of gallery_B_mc to find that location.  I tried the following, and several other guesses, with no luck:

//

on (release) {

            this._parent.gotoAndStop("gallery_A_lastPage");

}

//

on (release) {

            _root.gotoAndStop("gallery_A_lastPage");

}

//

on (release) {

            gotoAndStop("gallery_A_lastPage");

}

//

//

Again, I really appreciate that you took the time to help.  I’ll be jumping for joy when I finally do get this project working.

kglad
Community Expert
Community Expert
July 29, 2009

if you're attaching code to a true button and that button is on the same timeline as gallery_A_mc, use:


on (release) {

           gallery_A_mc.gotoAndStop("gallery_A_lastPage");

}


if you don't know the path from your button to gallery_A_mc, you can paste the output from:

place trace(this) inside your button release and place trace(this) on gallery_A_mc's timeline.