Groups | Blog | Home
all groups > flash actionscript > october 2004 >

flash actionscript : Buttons inside Movie symbols


Dr.Bob
10/20/2004 9:57:21 PM
I've got a movie symbol that scrolls a navigation box down when you mouse over
it. The links inside the Navigation Box (movie) don't want to advance the root
timeline when clicked, I assume they want to advance the independent movie
symbol timeline instead (to frame 150 for example).

So I did extensive research and found the following action script that seems
to work some of the time. I placed this in the root timeline actions layer.
(not in the movie symbol)

this.test_movie.test_button.onPress = function () {
gotoAndStop(150);
};

This works a few times, then stops working. What could be stopping the
function? Can I force it to reset? Where should I be checking for faulty code?

Thanks,

Bob
flashForum
10/20/2004 10:04:04 PM
The way I get around this is with instance names of movie clips. I'm sure
there are more savvy ways around it. Instead of your main timeline, create
several clips, and give those clips instance names. Then just refer to them
via their instance names. For example, say you have on your main timeline a
menu bar movie, and a content movie. Here is the code I would use on the
buttons that are withing the menu clip. There are OOP ways of doing this, but
I'm not there yet :)

on(release){
content.gotoAndPlay("frameLabel");
}

Where conent is the instance name of your content movie clip.
Dr.Bob
10/20/2004 10:55:04 PM
Thank you very much, I believe that fixed it. I made FrameLabels for each
different section of the main timeline movie and referred to them inside the
animated navigation bar by using:

on (press) {_root.gotoAndStop("CONTACT", 170)
}

This is working! Cheers!
AddThis Social Bookmark Button