PDA

View Full Version : Noob actionscripting


oma
01-26-2003, 12:10 PM
Hi guys, this is my first post at the forum. Im pretty new at flash, and completely new at actionscripting. I've made this animation that i want to do using actionscripts. It would make my site a whole lot easier to build.

An example of what i wanne do:
http://home.no/oma/cg/action.swf

Ive made the animation using 3 layers. The first layer contained a bitmap image (the texture you see). The second layer was a symbol containing square 1,3,5 and so on. The third layer: square 2,4,6 and so on. I used aplha channel on the symbols. Then i used tint on one keyframe, then an other and then back again to the original colours.

If someone now how to do this using actionscripts, or know of any tuts i'll be so grateful

:buttrock: :airguitar :buttrock: :airguitar

Miyazaki
01-28-2003, 06:31 AM
I can highly recommend Colin Moocks` Action script-The Definitive Guide (http://www.amazon.com/exec/obidos/tg/detail/-/059600396X/qid=1043734423/sr=8-1/ref=sr_8_1/103-0742019-6828657?v=glance&s=books&n=507846) . It rocks :buttrock:
moock.org (http://www.moock.org/asdg/home.html)

De-Cypher
01-28-2003, 06:41 AM
you will need to look for info on the color object in flash. Basically you would be creating a color object that you can assign an MC too. Such as your squares. The color object such as:

myColor = new Color(myMovieClip);
myColor.setRGB(0xff9933);

to set the color of the box through action script. If you want to control more, then you have to use (you do not need to assign each one):

myColorTransform = new Object(myMovieClip);
myColorTransform.ra = 50;
myColorTransform.rb = 244;
myColorTransform.ga = 40;
myColorTransform.gb = 112;
myColorTransform.ba = 12;
myColorTransform.bb = 90;
myColorTransform.aa = 40;
myColorTransform.ab = 70;

As mentioned in the flash reference...
ra is the percentage for the red component (-100 to 100).
rb is the offset for the red component (-255 to 255).
ga is the percentage for the green component (-100 to 100).
gb is the offset for the green component (-255 to 255).
ba is the percentage for the blue component (-100 to 100).
bb is the offset for the blue component (-255 to 255).
aa is the percentage for alpha (-100 to 100).
ab is the offset for alpha (-255 to 255).

Now the fading is more tricky. You would need to create an onEnterFrame function.

myMovieClip.onEnterFrame = function () {
myColorTransform.aa += 1
};

If you want it to fade in an out, you have make a conditional statement that checks if the movie clip has reached 100 or 0 alpha and then change the direction of the fade by either adding or subtracting....

but I have given you a lot and you need to get just the color issue working... post and i will help...some good sites to learn from of course www.macromedia.com, www.ultrashock.com, www.were-here.com,www. flash-kit.com (a lot of content but shitty quality downloads...)

Hope I helped... laters.

oma
01-28-2003, 06:48 PM
Thanks, now i've got something to work with! :buttrock:

I will post later when i have tried it out :thumbsup:

CGTalk Moderation
01-14-2006, 06:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.