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!

Movie as button?

Status
Not open for further replies.

tviman

Programmer
Jul 25, 2002
2,123
US
I'm a little confused... I have a movie clip that I want to act as button. So, do I put the movie clip in the button or the button in the movie clip?

There's always a better way. The fun is trying to find it!
 
Adam...

Thansk for your quick reply. I guess I should have asked this in my original post... if the button is in the movie clip, do I set the button actions in the clip or on the stage? If it's on the stage, how do I assign actions to a movie clip?

There's always a better way. The fun is trying to find it!
 
You don't need to have a button inside the movie clip, to have the movie clip react like a button.

A simple graphic movie clip, on stage, with the instance name of "clip1" would react as a button, if you simply added the following handlers on a frame action...

stop();
clip1.onRollOver = function(){
trace("OVER!");
};
clip1.onRelease = function(){
trace("YO!");
};
 
Although, in the above situation, if you did have a button nested in the clip with it's own actions, they would be overridden by the clips actions as defined above.

If you want the clip to react independently from the button, you'd better use a hitTest on the clip itself, and that wouldn't affect the button's actions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top