Archive for the ‘Intermediate’ category

FUN: Making MC’s do some fun stuff (Part 2)

August 3, 2008

I’m just bored. That’s why I’ve been writting so much today. I’m already posting the 6th tutorial today. The blogs first day, lol. Anyway, this is the sequel to my previous FUN stuff post. Here, I’ll teach you some more fun stuff you can do!

PROJECT NUMBER 3: Making a MC fade out, and fade in, once, using script.

This was a cool experiment I did, try it out! You must first create a new MC of course. And then read trough this code, until you understand it, and THEN you’re allowed to copy/paste it. But not before you’ve finished that task. Here’s the code:

onClipEvent (load) {//When the MC loads
speed = 5;//Set the desired speed.
number = 0;//Number will go to 0
}
onClipEvent (enterFrame) {//When you enter the frame, this code will run itself over and over again.
if (number<100) {//If the number is less than 100
_alpha -= speed;//Alpha will go lower
number += speed;//Number will go higher
} else if (number>=100) {//But what if the number is 100 or more?
number = 200;//Sets "number" to 200
_alpha += speed;//Alpha will go up
number -= speed;//Number will go down
}
}

It’s really cool, try it out!

PROJECT NUMBER 4: Making something like an animation with script.

So, now I’ve added a few new commands onto the code. This do now acctually look like an animation, but it’s all made out of script!

onClipEvent (load) {//When the MC loads
speed = 5;//Set the desired speed for changing the alpha.
rot_speed= 15; //Set the desired speed for rotating
sca_speed= 0.5; //Set the desired speed for scaling the MC
number = 0;//Number will go to 0
}
onClipEvent (enterFrame) {//When you enter the frame, this code will run itself over and over again.
if (number<100) {//If the number is less than 100
_alpha -= speed;//Alpha will go lower
number += speed;//Number will go higher
} else if (number>=100) {//But what if the number is 100 or more?
number = 200;//Sets "number" to 200
_alpha += speed;//Alpha will go up
number -= speed;//Number will go down
}
this._rotation+=rot_speed;//This will make the MC rotate
this._xscale+=sca_speed;//This MC will get a higher x scale
this._yscale-=sca_speed;//This MC will get a higher y scale
}

BTW guys, if you like these “fun” tutorials, tell me and I’ll make more!