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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button doesnt work in a movie symbol

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
US
I cannot get a button inside a movie symbol to take the user to the main scene.

Does a button not interact with scenes when placed in a movie clip?


I'm trying to create a sub menu pop up window when the user passes the mouse over a menu item. Then the user should be able to click on a sub-menu pop up item. But that sub menu item doesnt do anything.

Help?
 
Once again!

To address the main timeline from movie clips, the best method is to target a labeled frame!

Suppose you want to go to Scene 2, frame 1. Select frame 1 of Scene 2 and in the Frame panel, label the frame with an unique label, my_start2, for example.
From the button in your movie clip, you would then target that frame through that unique label as follows:

_root.gotoAndPlay("my_start2");

Simple as that!

Regards,
new.gif
 
Sorry about the newbie question, but it doesnt seem like your solution works.
Please tell me where I screwed up.

The scene I want to go to is "main".

Here is my "on release" code:

on (release) {
_root.gotoAndPlay("main");
}

What Am I doing wrong?

-Albert
 
Heres the solution.

on (release) {
tellTarget ("_root") {
gotoAndPlay ("main", "entry");
}
}

It seems like your code should have worked but I am no expert in Flash Actionscript syntax.

Thank you for your help!
 
The tellTarget action is deprecated in Flash 5. The dot syntax is recommended!
So...

on (release) {
tellTarget ("_root") {
gotoAndPlay ("main", "entry");
}
}
...Is basicly the same and would be better scripted as:

on (release) {
root.gotoAndPlay ("entry");
}

Furthermore your use of "main" as a scene parameter is useless, and will only work from the main timeline, not from movie clips (if this is still the case!). The only reason it's working, is due to your second parameter, which is most probably a label, and that is exactly what I suggested using!

Regards,
new.gif
 
Yea but your method does not work. I tried it every which way and I got the same results.

I agree that its probably a better way but I must be doing something wrong. It doesnt work for me.
 
And this is from a button inside a movie clip?

If "entry" is in fact a frame label, and it's now working with the tellTarget action, do me a favor, try sticking in a frame number instead of the label, something like:

on (release) {
tellTarget ("_root") {
gotoAndStop ("main", 10);
}
}

Normally, your movie should end up stopped on frame 10 (put some text on frame 10 - so you know it's really going there!) of your main scene! I doubt it will!

If it does, than your button is not within a movie clip!

Regards,
new.gif
 
I tried it. It starts at frame 10 and plays through. Looks good.

This all came from when I created a movie called "mvAboutUs"
then added a graphic in it that I changed in the instance window to target as a button. Then I tried to have that button take the user to a frame in the main scene.

Maybe this will help figure out why it doesnt work with the shorter code version.

 
um............
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Hold on to that copy of Flash! It's worth a lot!

Your button is simply not in a movie clip!

It's on the main timeline! It's the only way, your script would work!

But if it does... Well, great! You don't have a problem anymore!

Just remember my script, when you repeat this and it doesn't work!

Regards,
new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top