PDA

View Full Version : targetting mulitple movies


avelives
02-06-2003, 11:12 AM
i should probably know how to do this, but some how i cant just cant get it to work.

I have a main stage with two movies they each are self contained
one is the menu and one is title and information area.
after pressing a launch button the menu and info screen appear,
the navigation is a seperate movie and i want it to load into the main movie and be able to target the info movie (to create an
updating dynamic text area)

how do i get buttons to target frames or objects outside of their movie??

tost
02-06-2003, 11:38 AM
if your navigation is loaded into the main movie, it's path is
_root.navigation
and your menu and and information mc are on root too
_root.menu
_root.info
from inside "navigation", you can 'reach' "menu" by using
_root.menu

take a look at the paths tut (http://www.actionscript.org/tutorials/beginner/paths/index.shtml)

cheers :)
tost

avelives
02-06-2003, 04:33 PM
thanks man but the 'menu movie' which loads into the main timeline, well it has three frames and various stop and play functions apllied to two smaller movies which run an intro sequence, until it gets to frame three which is when the buttons appear.
now in order to have each frame play its movie and move on to the next i had functions such as:

this.onEnterframe=function(){
_root.gotoAndstop(relevant frame number);
}
these were apllied to the last frame of the two smaller movies,
so once theyd played the menu timeline plays the next movie and then moves on again to the buttons frame where it stops for good.
These functions work fine when i test the menu movie on its own
but they serioulsy mess with the main timeline when loaded in.
I realise this is because _root becomes the main timeline but how do i get the menu movies functions to affect only itself and not the main timeline.
i should add im loading the movie into a content area and im not specifing a level (should i??)
Cheers for your help, i can post the source files if my explanation is gibberish.

tost
02-06-2003, 06:21 PM
be carefull with this:
this.onEnterframe=function(){
_root.gotoAndstop(relevant frame number);
}
it means "starting from now, tell root to goto and stop (frame), and repeat that every frame."
_root.gotoAndstop(relevant frame number);
would do just the same. the onEnterframe function works fine in this situation, but it will be heavier on the cpu 'cause its executed every frame over again, the 2nd one only once.

now
to access a movie one lever higher, just use "_parent."
the final code in the last frame of the smaller movies would be

_parent.gotoAndstop(relevant frame number);

if this would be a game then you would go to the next level now:
advanced paths tut (http://www.actionscript.org/tutorials/intermediate/advanced_pathing/index.shtml)
:D
grtz
tost

avelives
02-07-2003, 04:35 PM
thanks i have cleared up the code as you suggested and on second glance i have learned that i needed far less code than was necesary.
Cheers man