views:

299

answers:

1

Flaah CS4, AS2

I am making an interactive tour. On the main timeline I have two movieclip, "ABOUT" and "RENTALS".

I would like a button, "btnFLRcafe" in the "ABOUT" movieclip to connect to "RENTALS" and start playing on the timeline at a frame named "CAFE".

This is the code that I have on "btnFLRcafe":

on(release){ _root.gotoAndStop("RENTALS"); _root.mcRENTALS.gotoAndPlay("CAFE"); }

When the button is pressed it navigates to "RENTALS", but starts playing from the beginning of the timeline. It seems that the second part of the code is being ignored.

What am I doing wrong?

A: 

After the first gotoAndStop call, it takes 1 frame before mcRENTALS is loaded.

There is a couple of ways to get around this.

You can wait for the onEnterFrame callback, and then make the second call.

You could also keep About and Rentals in the same frame, and just hide and show them. Then you wont have to wait for them to load (since they are never unloaded).

You could also set a global value that a framescript in mcRENTALS will read, and then jump to the correct frame.

Though all of those solutions have a bit of a "hack" to them. Depending on the time you have available and how much coding you want to do, I would suggest you to do it in ActionScript 3 instead. You can pass the subsection a parameter to a constructor of the mainsection. And besides that, ActionScript 3 is just easier once you get into it.

Lillemanden
I had to stick with AS2, so I put the movieclips on the same frame and used conditionals to make them visible and invisible. My initial problem is solved. I have some other issues now bc I had to move some stuff around, but I think it's something that I can fix!Thanks!
jecca411