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

Movie Clip symbol inside Buttons

Status
Not open for further replies.

wilcdr

Programmer
Jan 4, 2001
19
CA
Hi all,

I am trying to do this:

I have a movie clip symbol, and I put this movie clip symbol inside all the state of a button symbol.

Now, the mouse events will only be triggered if the mouse event happens within the bounds of the object in the first frame of the movie clip symbol. In essence, the Hit state of the button symbol doesn't animate with the movie clip!

If you want to see what I mean, do a simple test... create a movie clip symbol that has a rectangle, and do a motion tween on the rectangle so it go across the screen from left to right. Now, put this movie clip symbol you have just created into a button symbol. Then, drag the button symbol onto the scene. Test the movie, you will see that mouse event is only triggered when the mouse is over the left position, and when the rectangle get animated across the screen, the hit state of the button doesn't go with it.

How do I fix this?

Thanks!

Willy
 
hi

When you're creating your clip:

>>> create a layer ABOVE it and draw a rectangle to the shape of the required button,covering the movieclip.

>>> Press F8 and convert this rectangle to a button.

>>> Press Ctrl+I and change the Alpha of the button to zero.

>>> Change your button's Actions to suit.

I've made an example for you at :
And you can get the fla at:

Hope it helps
dD davdesign@hotmail.com

^^^^^^^^^^^^^^^^
 
Hi,

Thanks for your time!

I have one additional question. From what you have said, I figured out a way to have the button following the actual moving thing now. But the only reason I did it the other way myself (embedding the movie clip in a button symbol) is because I need to use it to call tellTarget() to tell a symbol in the scene to do something.

If I have a button inside the movie clip, and then have an instance of this movie clip in the scene, I cannot do a on (rollover) event or any other mouse events for that matter on the movie clip. And if I try to set the action on the button inside the movie clip, it will not recognize targets in the scene.

Any suggestions?

Thanks!

Willy
 
Thanks for your help!

I didn't know you can do a "..\targetname" to get up a level from the movie clip to get the target name, since it didn't show up when I browse for the targe I assume it cannot access anything outside.

I guess I still have lots of things to learn about Flash! ^_^

Willy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top