View Full Version : Newbie in need of help please!!
digitalnofx
06-14-2004, 11:21 AM
Hey Guys,
I'm a newbie trying to learn Actionscript and build my first total Flash MX 2004 website. I do know a few things since going through the Learning Actionscript 2.0 form Lynda.com which has helped greatly but I have a dilema. I have several buttons in the shape of football helmets that I would like to act horizontally much like the Building a Tsunami tutorial in the tutorials section. Basically I just want them on Rollover to scale up and then back down very smooth, unlike the button's hit over and down states, which seem just to pop up then back down when scaling. Anybody have any clues where to start? I don't want anyone to write the code for me, just tell me where to start.
Thanks
smoothhabitat
06-14-2004, 11:49 AM
use a movieClip in the over state that animates the helmet scaling up and then down.
if you want it to go down on roll out, your going to have to do something different:
1. make a movie clip
2. label frames: normal, over, out, down
3. space them out 10-20 frames or so and give them each animations (ie. over would be tweened to grow, out would be tweened to shrink back.
4. make a button with nothing in any of the frames except a square in the last frame (i call it a hotspot, some people call it an invisible button).
5. put the hotspot in your movieClip on a layer above the helmet. stretch it so it just covers the helmet.
6. give the button actionscript to gotoAndPlay the frame you want on over, press, release, out, etc... for whatever options you want.
smoothhabitat
06-14-2004, 11:49 AM
or you could script it all.
digitalnofx
06-14-2004, 01:52 PM
I'd love to script it all... I just not sure what way to lean...
and I think I'm getting frustrated cause I can't even get swapDepths to work....Argh! LOL
smoothhabitat
06-15-2004, 01:38 AM
:) It just takes time. I would start with a book and a good long bath. Or, at least that's my way. I've been using the Flash AS Bible, although I think I'm gonna get Moock's books here soon. Books are good, cuz you can dog-ear the pages and jot notes on them and they don't take up screen realestate while you're working. There's a lot of free info on the web.
Start off slow. When I look at code, I can almost always tell the difference between someone that has a programming background (like those kids out their that started programming BASICA or GW BASIC) and the ones that started as a designer (and program like one).
Here's some starter tips for better code:
1. comment the **** out of everything.
2. figure out your plan of attack first
3. pseudo-code some parts while it's fresh in your mind. sometimes what i do is just put in most of my comments first (before even the code), this let's me get the algorithm figured out before i get into the details or the exact way i'm going to do something. this also let's me get the whole picture framed first.
4. use classes and objects (OOP is the best thing that ever happened to programming)
5. use functions so that you don't have to repeat code. if you find that you are repeating a chunk of code over and over, you should probably be using a function.
6. organize everything, especially that damn library panel. use folders. (not really an AS tip, but an important one).
hope that helps.
digitalnofx
06-15-2004, 02:19 PM
Thanks!! That really does help!!
smoothhabitat
06-16-2004, 01:19 AM
oh. and use trace() or the debug stuff to check on variables, if you're not sure quite what's going on. trace() is my best friend when something is going wrong.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.