PDA

View Full Version : Buttons with squares around


cb2004
11-11-2008, 04:36 PM
I have 6 buttons in a flash document all on a single layer. I then converted them to symbols and selected them as buttons. I then gave them an up, over and hit state and added:

on (release) {
getURL("mylink", "_self");
}

to all the buttons on the stage.

Could somebody point me in the right direction here. I want a box to fly in around the image when it is hovered over. Where do I start?

gnomeontherun
11-11-2008, 06:11 PM
You will need to use movieClips as buttons instead of buttons. Search for tutorials and I like them better anyways.

cb2004
11-11-2008, 06:33 PM
Search the forums or a general search on Google?

itsallkizza
11-11-2008, 06:40 PM
Search google for tutorials on animating movie clips.

As for turning your buttons into movie clips non-dynamically:
Click on each button on the state, then in the Properties window look for the drop-down on the top left. It should currently have Button selected, change that to Movie Clip and you can now access/manipulate those buttons as if they were MCs.

If you like animating in Flash, you can create some motion guides for your button MCs to follow.
http://www.entheosweb.com/Flash/motion_guide.asp
http://www.echoecho.com/flashtweenings01.htm

cb2004
11-12-2008, 08:09 AM
Is it best to just use pure ActionScript for this?

itsallkizza
11-12-2008, 08:21 AM
I would use AS only, but I'm guessing I'm in the minority.

Motion guides would be faster to create in small quantities and would be easier to visually manipulate. Individual motion tweens can also serve a one-time purpose.

AS, once set up, is lighter, more portable, more reusable, and faster to edit. However the "once set up" part can be a mother.

cb2004
11-12-2008, 08:35 AM
Cheers for your continued help on this.

So i have started like this:

import mx.transitions.Tween;
import mx.transitions.easing.*;

onLoad = function () {
new Tween(whoweare_mc,"_alpha",Regular.easeOut,0,100,12,false);
new Tween(whoweare_mc,"_x",Regular.easeOut,0,38.7,12,false);
}

Am I heading in the right direction?

gnomeontherun
11-12-2008, 12:53 PM
Well so far you have the movieClip named whoweare_mc fading in, and moving across the screen.

I personally wouldn't use Actionscript for this unless you were very comfortable with it, because as it was pointed out before, it can be hard to setup initially. It also depends on how many buttons you have, and if you see yourself making more flash projects in the future which might benefit from this kind of thing. If you have only a handful of buttons, and don't plan on doing this with lots of other projects, then I would make the movieClips in the animation window.

Generally, you make a similar structure inside of the movieClip like you could in the button (except the hit frame), but you can have it so that the "over" state starts an animation.

http://www.echoecho.com/flashbuttons02.htm

itsallkizza
11-12-2008, 10:35 PM
jfyi cb2004: If you choose to use AS3 (though as both jw and I suggested, it probably isn't optimal for your small project) I personally won't be a huge help to you. The company I work for still uses AS2 (because it requires Flashplayer 9) and I haven't personally upgraded myself. Any AS2 questions you have though, I'm always open ;)