New York Design & Development Forums

Go Back   New York Design & Development Forums > Knowledge Bank > Tutorials
Connect with Facebook

Notices

Reply
 
LinkBack Thread Tools
Old 03-28-2006, 04:39 PM   #1 (permalink)
Junior Member
Casual Browser
 
seco's Avatar
 
Join Date: Dec 2004
Age: 33
Posts: 17
seco is a glorious beacon of lightseco is a glorious beacon of lightseco is a glorious beacon of light
Send a message via AIM to seco Send a message via Yahoo to seco
Default RollOver/Out button with reverse animation

ok, i seen a couple post in here asking about there rollover/rollout buttons. now there is a few ways of doing this. this one is the most comon, a simple rollover animation then the animation reversed on rollout. I hope this will work for a few of you. remember you can use anything you want for the animation, it its 3d or after effects, create the animation sequence first, then add it to the movie clip accordinly.

EXAMPLE SWF

first, create a movie clip. and add this AS to it,

Example A: Create the MC



Code:
onClipEvent (enterFrame) { 
       if (this.hitTest(_root._xmouse, _root._ymouse, true)) { 
this.nextFrame(); 
    } else { 
this.prevFrame(); 
   } 
}
Example B: Add the animation



I used 23 images for this button. Created the graphics in photoshop<br>
and the roll over flip in after effects. then exported them as a image sequence.

if you name then correctly "button_00" after effects will name the next one "button_01" ect....

you can then import to stage in the MC and flash will recognize the sequence and prompt you to use them all or not.


Example C: Add the Stop



last but not least, this is very important. notice in the image above, the actions layer is set back 1 frame from the animation.

do that and add a
Code:
stop();
to the actions layer.


use only the forward animation in the frames, flash will reverse it

make sure you create a shape that surrounds the entire MC, convert to a button and add a alpha of 0% to it. then add your links to the invisible button.


also, FPS is important, i usually use about 42 - 50.
and thats it, test the button

here are the FLA's

Ver. 8

MX2004 Pro

Enjoy, if you have any questions dont hesitate to ask. Im a Button / Preloader Guru, also connecting flash to databases of any kind.
seco is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 03-28-2006, 04:49 PM   #2 (permalink)
Senior Member
Fanatic
 
Michael's Avatar
 
Join Date: Mar 2006
Age: 26
Posts: 253
Michael is a glorious beacon of lightMichael is a glorious beacon of light
Send a message via AIM to Michael Send a message via MSN to Michael Send a message via Yahoo to Michael Send a message via Skype™ to Michael
Default Re: RollOver/Out button with reverse animation

Suggestions

I'd be careful using such a high framerate...

The human brain only needs a framerate of 21 to percieve static frames as fluid motion. I generally use a framerate of 30.

And I wouldn't use a hit test... instead I'd build functions and have the onRollOver and onRollOut methods start the animation.. something like...

Code:
instance.onRollOver = playAnim;
instance.onRollOut = playAnimBackwards;

function playAnim()
{
   this.play();
}
function playAnimBackwards()
{
   this.onEnterFrame = function()
   {
      if (this._currentframe != 1) 
      {
         this.prevFrame();
      } else
      {
         delete this.onEnterFrame;
      }
   }
}
This will clean up in two ways... You'll have way less onEnterFrame functions running at once, and you won't have hit tests for each button on every frame, another little thing is that calling nextFrame() on every frame to play an animation is over kill, here we just say play() and flash handles the rest.

This can be cleaned up even further, but this will work really well, and it will retain it's efficiency throughout the life of the swf.

Take Care.
_Michael
__________________
Actionscript Developer :P ...Dope...

http://www.createage.com
http://www.myspace.com/michaelxxoa <--- yeah I'm a nooob, so what
Michael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 03-29-2006, 05:12 PM   #3 (permalink)
Junior Member
Casual Browser
 
seco's Avatar
 
Join Date: Dec 2004
Age: 33
Posts: 17
seco is a glorious beacon of lightseco is a glorious beacon of lightseco is a glorious beacon of light
Send a message via AIM to seco Send a message via Yahoo to seco
Default Re: RollOver/Out button with reverse animation

Quote:
Originally Posted by MichaelxxOA
Suggestions

I'd be careful using such a high framerate...

The human brain only needs a framerate of 21 to percieve static frames as fluid motion. I generally use a framerate of 30.

And I wouldn't use a hit test... instead I'd build functions and have the onRollOver and onRollOut methods start the animation.. something like...

Code:
instance.onRollOver = playAnim;
instance.onRollOut = playAnimBackwards;

function playAnim()
{
   this.play();
}
function playAnimBackwards()
{
   this.onEnterFrame = function()
   {
      if (this._currentframe != 1) 
      {
         this.prevFrame();
      } else
      {
         delete this.onEnterFrame;
      }
   }
}
This will clean up in two ways... You'll have way less onEnterFrame functions running at once, and you won't have hit tests for each button on every frame, another little thing is that calling nextFrame() on every frame to play an animation is over kill, here we just say play() and flash handles the rest.

This can be cleaned up even further, but this will work really well, and it will retain it's efficiency throughout the life of the swf.

Take Care.
_Michael

i tried that and it didnt work the same as mine, animation wise
__________________
Seco --- Yes, I play a Fretless Bass :)
seco is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Old 06-30-2011, 04:21 PM   #4 (permalink)
Senior Member
Fanatic
 
Join Date: Jun 2011
Posts: 403
desiuser is on a distinguished road
Default Re: RollOver/Out button with reverse animation

All this sharing of photos is only relevant to people with more than one iOS5 device. What about families in which device each person s IOS. It would be of course to share purchases iTunes, music, etc. between matched (up to 3?) Family members. wmv to mp4 video converter I call BS. Out of all the apps purchased on the Android Market, I'm sure your one app stole all your personal info and was fraudulent and you found it to be a "common issue". What app was it? When did you buy it? What sources do you have showing that this is a "common issue"?
desiuser is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Google Bookmark this Post!Blink this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
2d and 3d animation matrix100 Reviews 2 07-02-2011 02:36 PM
Motion/Video/Animation Section? blaze_187 General Conversation 11 07-02-2011 03:45 AM
Flash Photo Animation danielmichel Multimedia Development 7 06-30-2011 09:29 PM
Photoshop: Quick button tutorial (PT:2 - Additional Effects) blaze_187 Tutorials 1 05-12-2006 10:01 PM
Photoshop: Quick button tutorial blaze_187 Tutorials 5 04-24-2006 01:22 PM


All times are GMT -4. The time now is 09:52 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45