Flash Button Animated "Over" state...

  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

How do I make an animated flash button that goes both "in" and out? I can get the button on the "over" state to "Light up" but not to "unlight" after the mouse has been moved off.
I have tried to use an "Invisible" button (which is halfway through the "over" animation. With only the "hit" state) but I don't like this, and it's not as effective as I'd like it to be...
Is there an easier way? (did that make sense?)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • R.L.D.
  • Student
  • Student
  • User avatar
  • Posts: 83
  • Loc: Astoria,Queens

Post 3+ Months Ago

what you're trying to do works better if you use a movieClip ..
create a movie clip with the animation you want going one way..
put (stop();) scripts on the first and last frames of your animation..
then go back to your scene , click on your movieClip and put this on the action panel ::

Code: [ Select ]
onClipEvent (enterFrame) {

// if the mouse IS over the clip ...
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {

// if the last frame of the tween hasn't been reached...
if (this._currentframe<this._totalframes) {

// keep playing the next frame to the last and stop...
this.nextFrame();
        }
// if the mouse is NOT over the clip
    } else {

// if we're past the first frame of the tween...
if (this._currentframe>1) {

// play the previous frame until it reaches frame 1 and stop...
this.prevFrame();
}
}
}
  1. onClipEvent (enterFrame) {
  2. // if the mouse IS over the clip ...
  3. if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  4. // if the last frame of the tween hasn't been reached...
  5. if (this._currentframe<this._totalframes) {
  6. // keep playing the next frame to the last and stop...
  7. this.nextFrame();
  8.         }
  9. // if the mouse is NOT over the clip
  10.     } else {
  11. // if we're past the first frame of the tween...
  12. if (this._currentframe>1) {
  13. // play the previous frame until it reaches frame 1 and stop...
  14. this.prevFrame();
  15. }
  16. }
  17. }


give it a try :)
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

that's my fav transition, too...
so, just for posterity, here's my steez... first off, there's room for some kind of action on the button... also i've never had problems with leaving off the script that checks if it's at the first or last frames, 'cos it just seems to stop itself.

Code: [ Select ]
onClipEvent (enterFrame) {
this.onRelease = function(){
//    put whatever action you want applied to the button here
//    for instance:
     _root.gotoAndPlay("action");}
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
  1. onClipEvent (enterFrame) {
  2. this.onRelease = function(){
  3. //    put whatever action you want applied to the button here
  4. //    for instance:
  5.      _root.gotoAndPlay("action");}
  6. if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  7. this.nextFrame();
  8. } else {
  9. this.prevFrame();
  10. }
  11. }


peace.
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

R.L.D. wrote:
what you're trying to do works better if you use a movieClip ..
create a movie clip with the animation you want going one way..
put (stop();) scripts on the first and last frames of your animation..
then go back to your scene , click on your movieClip and put this on the action panel ::

Code: [ Select ]
onClipEvent (enterFrame) {

// if the mouse IS over the clip ...
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {

// if the last frame of the tween hasn't been reached...
if (this._currentframe<this._totalframes) {

// keep playing the next frame to the last and stop...
this.nextFrame();
        }
// if the mouse is NOT over the clip
    } else {

// if we're past the first frame of the tween...
if (this._currentframe>1) {

// play the previous frame until it reaches frame 1 and stop...
this.prevFrame();
}
}
}
  1. onClipEvent (enterFrame) {
  2. // if the mouse IS over the clip ...
  3. if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  4. // if the last frame of the tween hasn't been reached...
  5. if (this._currentframe<this._totalframes) {
  6. // keep playing the next frame to the last and stop...
  7. this.nextFrame();
  8.         }
  9. // if the mouse is NOT over the clip
  10.     } else {
  11. // if we're past the first frame of the tween...
  12. if (this._currentframe>1) {
  13. // play the previous frame until it reaches frame 1 and stop...
  14. this.prevFrame();
  15. }
  16. }
  17. }


give it a try :)

Do I make a button first and then put the mc inside?
or do I just make a movie clip of the action??
  • R.L.D.
  • Student
  • Student
  • User avatar
  • Posts: 83
  • Loc: Astoria,Queens

Post 3+ Months Ago

add a layer in the movieClip and make a rectangle to be used as the button.. convert it to a button and make sure you clear all frames exept for the "hit" frame on the button timeline ..
the button its going to look green ,, but when you test your movie you wont see it .

in other words .. yea .. make a movie clip of the action you want .. inside the movie clip .. do that i wrote above.
  • R.L.D.
  • Student
  • Student
  • User avatar
  • Posts: 83
  • Loc: Astoria,Queens

Post 3+ Months Ago

go here and download their sample .fla

http://www.advanceflash.com/#sec=1&cat= ... z=1&sizn=1

or

http://www.advanceflash.com
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

Ok... I want it to stop halfway through and continue when the mouse rolls off...
How do I do that?
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

R.L.D. wrote:
go here and download their sample .fla

http://www.advanceflash.com/#sec=1&cat= ... z=1&sizn=1

or

http://www.advanceflash.com


Thanks! This helped.
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

Yes! I have every thing done! I just need a hit area now! How do I add a hit area over my movie clip???
  • kevsterb007
  • Graduate
  • Graduate
  • kevsterb007
  • Posts: 145

Post 3+ Months Ago

I added the invisible button just like you said. It isn't working!

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 17 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.