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!

looping an animated button with onclick event

Status
Not open for further replies.

Seabone

Technical User
Jan 12, 2001
15
CA
Hey there,
Simple question. I have a button that is animated. I want the animation to loop until the person clicks on it and then I want it to go to scene 2.
Seems I can either loop it or jump to scene 2 but not both!
Please help!!!
Thanks
 
Can't you just use an 'on-press' action to 'tell' the movie-clip to 'stop', followed by a 'goto next scene' action ?

dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Edit the actions of your button's instance. On "press" or "release" or "press,release" go to scene 2.
You should animate the button itself. Adding an animate layer(a mc) on the "over" state keyframe.

B-)
pink3.gif

"Blowin' for stars!"
 
next scene = scene2 (whatever) dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Ok, here's what I did once.

Plop a movie clip into the "over" state of your button for the animation and add an on(release) action to your button that tells it to go and play scene 2.

I think that was already said by Mr. oldnewbie, but darn, you guys can be confusing when relating your huge bounties of knowledge! :)

Holy tek-tips batman! :-0
 
Katie, (sorry for using your thread on this one Seabone)

remember you were creating the business solutions site with the jungle scenes? Did you finish that and get everything smooth? can you post the link because I'm lazy and the threads were a long time ago ;-) . Been wondering how it was looking these days.

cheers
dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Long time ago.... Before the 3 feet of snow.... ;-)

I actually just caught up with the way that thread was going....

thread250-59305

Added a bit.... still feel like holding my hand? :)
Holy tek-tips batman!:-0
 
Hey guys, (KatieKat and Davdesign)
Maybe you guys should get a 'thread'! LOL

Thanks for your responses but I'm still stuck.
I've created the animation in the over state but it only plays once. I put an action on the last frame of the animation 'go to and play current scene frame 1' to get it to loop..I don't know of another way to get the anim. to loop. The 'instance' of the down (or over) state is greyed out. So, I made the instance of the animation 'on release go to and play scene 2' but when I test movie...it won't loop.
again, I just want the anim. to loop so that when you open the page it is looping until release of the mouse, then go to scene 2!
Thanks again
 
Did you make your animation a movie clip? I can't imagine how else it might be done....

You have to put the looping in that Movie Clip! So in the last frame of the movie clip animation, put the go to & play action, that should work! :)

Then, when you are editing your clip, put it in the down instance for your button.

I think I might be confused as to what you want. Let me guess:
A button that just sitting there is animated, and then when you click it, it stops being animated and does whatever? Or do you want it to sit there, and when someone mouses over it, there is an animation, then you click and it does whatever?
Clarify? Holy tek-tips batman!:-0
 
try this,

create a transparent button and drag it onto the main stage.

Create your tween in a movie-clip. Put a stop action in the first frame, a "loop" label in the second frame and a "go to and play 'loop'" action in the final frame.

drag this mc onto the main stage over the button and give it an instance name say "moovee"

edit the actions on your button:

on (rollOver) {
tellTarget ("moovee") {
gotoAndPlay ("loop");
}
}
on (rollOut) {
tellTarget ("moovee") {
gotoAndStop (1);
}
}
on (press) {
gotoAndPlay ("Scene 2", 1);
}


should work like a dream.

dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Hi guys,
I tried some of your suggestions but I realized that maybe I wasn't be crystal clear...
I have a really small animation of an pulsating object. I don't want it to change until a click and then I want scene 2 to kick in.
I don't want a roll-over or for it to stop at any point.
Simply keep pulsating until a release.
I made the animation a movie clip. The last frames action is 'go to and play current scene frame 1' (to loop it)
The instance of the movie clip is 'on release go to and play scene 2 end on'
I placed the clip in all the states so it won't change during roll-over...
I double-clicked the over state but the 'scenes' are greyed out so I can't choose for it to go to scene 2!?????
The instance is also greyed out in the over state.
Where can i tell it to go to scene 2 which i have placed in the last frame of the animation..doesn't work!
So sorry..:(
Seabone
 
Ok, so you have a button, and in one of your button instances, (I'm assumiming "up") you put an animation. And you want it to just sit there doing it's animation until it's clicked, right? First take all the actions out of your movie clip except the ones that you need to make it loop. Ok, now just put your button on the movie stage, right click on it, and click "actions". Then add your "on (release)" action. Instead of putting your actions in your movie clip, put them on your button. This should work for you. ;-) Holy tek-tips batman!:-0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top