Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

buttons within movie clip symbol won't work

Status
Not open for further replies.

Glass

Technical User
Oct 26, 2001
2
US
I have been working on large site entirely in flash with many scenes. I have created a control panel (with rollout buttons) as a movie clip symbol and pull it into scenes as needed. The problem is the buttons on the rollout will not work when imported from the library onto a frame. Actually I was able in experiments to use the rollout buttons to toggle high or low quality but they don't work for navigation. I don't want the control panel to be context sensitive and because the buttons roll out, they can not be edited when part of an instance(as far as I can tell). Pleeaase help!

Thanks.
 
Once again... A .fla is worth a thousand words!
Upload it somewhere, so those of us willing to help, may have a look at it! Or e-mail it! Address available on click of handles!

Regards,
mywink2.gif
ldnewbie
 
Don't know how many times I've posted a solution to this problem, nor how many times I'll have to post it again, but here goes...

When working in the main (_root) movie, using the gotoAndPlay ("Scene x", 1); action will work fine from any scene to any other scene!

But when the main movie (_root) is targeted from within a movie clip (or from an external .swf, loaded on another level) this simply won't work!.
The reason for this is that a movie clip (or an external .swf loaded on another level) sees the timeline of the main movie (_root) as ONE big scene even it it holds dozens of other scenes.

Two solutions to this problem:

1- Target the cumulative number of frames held by all the scenes previous to the one you're targeting. In other words, if your targeting Scene 4 (whatever it's name may be...) and that your Scene 1 holds 100 frames, Scene 2 holds 65 frames and Scene 3 holds 100 frames, you would target frame (100+65+100 = 265)+ 1 (the first frame of Scene 4), thus frame 266 this way:

on (press){
_root.gotoAndPlay(266);
}

You are thus targeting frame 266 of the main movie's (_root) timeline.
But while working on your project, if you add frames or remove some in the previous scenes to the targeted one, you will then need to adjust every targeted frame number from every movie clip calling one, accordingly... Not an easy task! Which brings up a second and better solution...

2- Target a frame label! Using my first example above... If you want to go to Scene 4, simply label (after selecting it, name it in the Frame panel) the first frame of Scene 4 with a unique label, start4 for example. This label will allways be attached to that particular frame (unless you change it or delete the frame), even if you add or remove frames from the previous scenes, making this solution much more sure and reliable.
In this case use this syntax:

on (press){
_root.gotoAndPlay("start4");
}

One final note on loaded movies on other levels:
The same two techniques can be used when targeting the main movie, but this time the _levelx parameter must be used.
Thus targeting a scene in the main movie on _level0 from an external .swf loaded on _level1 you would replace _root by _level0:

on (press){
_level0.gotoAndPlay(266);
}
on (press){
_level0.gotoAndPlay("start4");
}

This time the reason being that each .swf has it's own _root (or _level0), thus using _root from a movie clip inside a .swf loaded on another level, would target that movie's own _root and not _level 0 of the main movie.
Hope this last note is clear... It should!

Regards,
mywink2.gif
ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top