PDA

View Full Version : Help with Animated buttons


u6crash
12-04-2004, 05:00 AM
In my Flash movie I'm trying to create a simple moving button so that when the user clicks, an instance of a movie clip becomes visible. Here's how I've gone about creating the button.

The button is created by a symbol graphic. The button has the following code:on (press) {
_root.mainmovie.q._visible = true;}

on (release) {
_root.mainmovie.q._visible = false;}

The button is then animated by being put into a looping movie clip where a motion tween is used. However, the click and release only works some of the time, as if the code were only applied to a single frame or something, but it is clearly applied to the whole button. I have also tried to apply the code directly to the movie clip, but I believe the on code is reserved specifically for buttons. I have also tried creating the movie clip with motion a motion tween on the graphic, and then dropping that movie clip into the button.

Am I going about this completely wrong? Any help would be great. Thank you.

redruby
12-04-2004, 05:38 AM
Make sure your movie clip has the same instance name in all keyframes, i.e. in frame 1 the instance name must be "q" and also to the succeeding keyframes. I guess your movie clip has an instance name only in frame1.

u6crash
12-04-2004, 06:27 AM
Thanks a lot. That wasn't quite my problem, but it lead to the revelation I needed. :)