Posted tagged ‘fun’

FUN: Playing around with variables

August 4, 2008

Now, I’ll show you some cool things you can do with variables. To start up, create a new DYNAMIC text box and give it the variable main. This will be the variable that will bounce around.

STEP 1:

So, let’s start this. read the explanations in the codes, so you’ll understand them! Yeah, by the way, make a new MC and put it off stage! Well, now to the first code part, a whole line, yay!

main=1;//The main variable will be a 1

So, test your movie (CTRL+ENTER) and you’ll see the number one.

STEP 2:

It’s easy to make the variable bounce, and it’s easy to modify the code. But no copy/paste! Put the code on the MC which is off stage.

onClipEvent(enterFrame){//When you enter the frame, the code will run itself over and over again
if(_root.main<10){//If the variable main is less than 10
_root.main+=1;//Variable will go higher
}else{//If it's more than that
_root.main=1;//Main will be reset.
}
}

So, if you want it to count to 100 before it will restart, change “10” to “100” and so on. If you want it to start from something else, change the ones to where you want it to start from. You can also put it to count backwards, I’m sure you’ll figure out how 😉

So, now you do probably know variables a bit better, and that’s good, because variables is very important when you go more advanced! It’s almost all about variables and math, lol…. It might sound complicated but it isn’t, it’s kinda fun too 🙂

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!

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

August 3, 2008

This is some fun things that AS2 beginners could try to experiment with.

PROJECT NUMBER 1: Rotating forever, with script

Really simple thing, let’s say, you want, for any reason make a rotating MC, without using shape tweens. And no, without making it FBF either. This is a simple code, that is easy to modify. You put it on a MC.

onClipEvent(load){ //when the MC loads
speed=5; //used to set the rotation speed
}

onClipEvent(enterFrame){ //when you enter the frame, code will run over and over again.
this._rotation+=speed; //Will make the MC rotate.
}

PROJECT NUMBER 2: Increasing in size, forever, using script

Now, we’ll do almost the same thing, but let’s make it increase in size!

onClipEvent(load){ //when the MC loads
speed=5; //used to set the resizing speed
}

onClipEvent(enterFrame){ //when you enter the frame, code will run over and over again.
this._xscale+=speed; //Will make the MC x axis increase in size.
this._yscale+=speed; //Will make the MC y axis increase in size.
}

THE END!

At least the end of part one! Look out for next part of this fun tutorial.