|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
navigating to a new scene from a MC on the main TL
Good afternoon all, Quick question I have a MC with a button in it MC=mymc, and the button=mybtn.
Now let's say I have this button wihtin the MC on the main timeline. If I wanted to go to a frame labeled start (on the main timeline) the code would be: on(release) { _root.gotoAndPlay("start"); //start being the frame label } If I wanted to go to another scene how would I code that? I tried _root.gotoAndPlay("Scene2","start2"); //start2 being the frame label I even tried _root.mymc.gotoAndPlay..... no luck. I know the button is working beacuse I have a stopAllSound() on it and the audio it stoppingwhen I click on the button. I'd appreciate any feedback. Cheers, RC |
|
#2
|
|||
|
|||
|
OK all after doing some research here is what I found out...
When using the goto comand it only references the most local time line of the current mc and not the main timeline. Apparently even when using the _parent.goto or _root.goto it still does not work becuase of the object Hieracrhy is not recognized within Flash.(I didn't come up with this concept). SOooooo the work around for this is to eiterh put your buttons on the main timeline "or" point to a frame on the current timline that is 1 past the last keyframe and drop code into those frame sending the playback head to the other scenes. To sum it all up gotoAndPlay will not jump directly to other scenes when placed on buttons inside of movie clips. |
|
#3
|
||||
|
||||
|
Here is an .fla to show you how to achieve this.
Last edited by jmichels : March 11th, 2004 at 07:09 PM. |
|
#4
|
|||
|
|||
|
Quote:
Thanks jmichels. That worked like a charm Cheers, RC |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > navigating to a new scene from a MC on the main TL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|