You want to know how to do some thing in flash or make simple site in internet ? And you do not know how to start ? Read this posts then


Ultimate FAQ (Only the basics):
FAQ MAP:
Spoiler (click to show/hide):
1)Flash fundamentals
a)Basic movie controls
b)Conditions
c)Cycles
d)Base actions
2)Game theory.
Theory / Sapmles / Motion algoritms (make game based on other peoples code - without coding by yourself).
3)Site theory - how to make flash site.
4)Flash world - Chats / Flash and Java Script / Flash and PHP / MySQL/ txt / MMO and Chats on flash.
5)How to make / play flash games for Android.
1)Flash fundamentals
a)Basic movie controls
b)Conditions
c)Cycles
d)Base actions
2)Game theory.
Theory / Sapmles / Motion algoritms (make game based on other peoples code - without coding by yourself).
3)Site theory - how to make flash site.
4)Flash world - Chats / Flash and Java Script / Flash and PHP / MySQL/ txt / MMO and Chats on flash.
5)How to make / play flash games for Android.
1))Flash fundamentals
a)Basic movie controls
Spoiler (click to show/hide):
Hi. I want to tell some of Flash basics there. I think if you just start work with Flash it can be useful. Let’s speak about some flash fundamentals. Just imagen – that flash is just a simple video player. What can video player do ? You can stop/play it or go to the part of film you need and play from there (or stop there). The same is for flash.
There are 4 basic commands:
)

As a video player – it has some thing like (how fast it is playing). Speed of playing – how much frames do it play in second.
It calls frameRate in flash.
If you use AS3 – you can change it by code: stage.frameRate=some value (stage.frameRate=12 for example).
In AS2 and AS3 versions you can change them like :

Change fps to some number.
I am not good in draw and designing – but I hear some where – that it is good to use 12 or 24 frames per second. Films on TV used 24 fps / Anime and Hentai 12 fps (but some of them work more insidiously – they move there character 12 times in second (12 fps) and they move background 12 times in second – but they do that way – 1 frame move character/2 frame move background but not move character/3 move character but not move back ground/4move only character and etc – and get 24 fps that way)
But 12 fps is good – LoK is 13 FPS game. (http://www.adobe.com/devnet/flash/learning_guide/animation/part02.html there are example with 12 and 24 FPS).
FPS – eats your PC – if you make very big fps – PC start lag. If you make to low fps you get bad animation.
With this stuff you can program a simple movie. Just put animation on 1st frame. A little change it in 2nd, then a little change in 3rd – and you get some type of movie.
It is already enough for making simple banners on Flash. (Like gif animation but much more better). But it is not enough for making sites and games.
But there is some hint - to make it more awesome
You can make objects in Flash – it is like – think that your main frame line is your TV in your room. There are 3 types of objects in flash:

Movie Clip – is some thing like one more TV
You can put one TV to Another – and it will be TV in TV
=)
Movie Clip as a TV can have it’s name. And you can control them. It can live there own life – and show what you draw there. Or you can control it. Like : Hey you – TV that play move in my main TV – can you please show me some thing else ? You show some shit to me – I want some thing better. He say – OK – and do it
TV can show you static or dynamic picture. You can control it by remote control or by pressing buttons on them.
There is 2nd type of object – buttons. On press the button/click or relese it your TV can make some thing like it do in real life.
The 3rd type is graphic – it is something simple like picture. You can not control it like “hey you do some thing” – it is only for design some thing in Adobe Program for making flash.
Let us speake a little more about Movie Clip symbols (our TVs).
When you create Movie Clip object – (name 1) is the name in your libruary. Name 2 – is the program name of your object. You can say him to do some thing using this name.
For example: TvWithStupidName.gotoAndPlay(“CoolMovie”);
TvWithStupidName.stop();
And etc.
If you have MovieClipObject in MovieClipObject – you can not say him “hey you TvWithStupidName.gotoAndPlay(“CoolMovie”);
It is in another MovieClipObject – so ir will not hear you.
You have to say MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
But if you say so from some another MovieClipObject – it will not understand you and will try to find it in itself. So you have to say :
_root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
_root is the main line – then it will try to say it directly, like you will say from main layer :
MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
Or you can wright from main layer :
_root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
It is the same in this situation.
In as2 – your main frame line calls itself _root.
For example you make 2 Movie Clip Objects on your main root layer - and name them MyTV1 and MyTV2.
You can enter them by double click and draw some thing in it. For example some movie with more then 1 frame. (See MyRoot2TVexampleAS2).
In as3 – he is root without _.
There is not only that difference !!!
For example it will not be like :
WRONG WRONG WRONG !!! root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
WRONG WRONG WRONG !!!
You have to say him (he is more stupid – hey you MainTV – you are mainTV – I am talking to you =), as mainTV – say to your frend to play something =))
It will look like:
(root as MovieClip).MainTV.TvWithStupidName.gotoAndPlay(“CoolMovie”);
It can talk to his parents to like: (parent as MovieClip).gotoAndPlay(“CoolMovie”);
Or for example: (parent as MovieClip).SomeAnotherTv.gotoAndPlay(“CoolMovie”);
Or for example: (parent.parent as MovieClip).CheatOpen=1;
Oh I mean : (parent.parent as MovieClip).gotoAndPlay(“CoolMovie”);
I will tell you about cheats a little later
For example NOW !
There is no difference in MainLine and your MovieClipObject. They can have variables or gotoAndPlay/stop() and etc.. They can have another objects in it. Theu can use variables of each other. And if you will not use _root/root/parent commands – you can add a lot of MovieClipsObjects – and they will live by theit own life and will not bother each other. So some time it is usefull.
I will tell about all of this stuff later.
The last thing you need for making your first complicated flash game.
(YES IT IS SO SIMPLE !!! One little step and you can make your own hentai or no hentai games =) - for example like this one: http://ownerofsuccuby.narod.ru/AboutSite/LD.swf (press OOS icon for random dance
)
I will not post hentay samples there
– But LoK adult movies for example based on this.
You need to know how to make control of your movie. You will need buttons. It is more simple to make in AS2 - MyRoot2TVexampleAS2.zip – is AS2 version.
RenamonBasicExample01.zip – is AS3 version.
Button is Flash Object – that can listen events like is it pressed / clicked / released and etc.
This 3 is more important as I think.


How to make command – that will work by using your button ?
Click – like on picture.
Then like code there.
Code is always the same.
For AS2 it is:
On (press/release/rollover/rollOutside/rollOut) – you have to choose 1 of this.
Press – when mouse is pressed.
Release – on mouse press and then release (In AS3 it become Click)
rollOutside – when your mouse is on the button but you did not click yet.
rollOut – mouse go out from the button.
Then in {Some action here – play something; Something.gotoAndStop(SomeWhere); or do something else}
Congratulation – now you can do your first game. But it will be very simple – but a lot of very very good for example hentay games use only this program stuff.
For AS3 it is more harder.
It looks like this one. You make function. Give name to it. Her name is fNext.
Then you say what to do in { … }. All another is always the same.
bNext – is the name of your button. Like it was in your MovieClipObjects. You can make it not only for button but for MovieClipObject too – and it will work like button than.
function fNext(e:MouseEvent):void{
MyTalk.play();
}
bNext.addEventListener(MouseEvent.CLICK, fNext);
MouseEvent.CLICK – is some thing like it was in AS2 – click/release/press and etc.
MouseEvent – show us that it will work on event that you will do with mouse – for example CLICK on that button.
fNext show us what it will do after you CLICK your bNext vutton (or MovieClipObject) by mouse.
It is the end of 1.a.
Read 1.b – for more experience
Hi. I want to tell some of Flash basics there. I think if you just start work with Flash it can be useful. Let’s speak about some flash fundamentals. Just imagen – that flash is just a simple video player. What can video player do ? You can stop/play it or go to the part of film you need and play from there (or stop there). The same is for flash.
There are 4 basic commands:
(Lets you to stop playing your “movie on some frame”)stop();
(Start to play ypur movie from where it was stop)play();
(Start to play video from some frame for example gotoAndStop(10); or you can name frame and make like this –gotoAndPlay();
)gotoAndPlay(“MyNamedFrame”);
(Go to the named frame and Stop on itgotoAndStop();


As a video player – it has some thing like (how fast it is playing). Speed of playing – how much frames do it play in second.
It calls frameRate in flash.
If you use AS3 – you can change it by code: stage.frameRate=some value (stage.frameRate=12 for example).
In AS2 and AS3 versions you can change them like :

Change fps to some number.
I am not good in draw and designing – but I hear some where – that it is good to use 12 or 24 frames per second. Films on TV used 24 fps / Anime and Hentai 12 fps (but some of them work more insidiously – they move there character 12 times in second (12 fps) and they move background 12 times in second – but they do that way – 1 frame move character/2 frame move background but not move character/3 move character but not move back ground/4move only character and etc – and get 24 fps that way)
But 12 fps is good – LoK is 13 FPS game. (http://www.adobe.com/devnet/flash/learning_guide/animation/part02.html there are example with 12 and 24 FPS).
FPS – eats your PC – if you make very big fps – PC start lag. If you make to low fps you get bad animation.
With this stuff you can program a simple movie. Just put animation on 1st frame. A little change it in 2nd, then a little change in 3rd – and you get some type of movie.
It is already enough for making simple banners on Flash. (Like gif animation but much more better). But it is not enough for making sites and games.
But there is some hint - to make it more awesome

You can make objects in Flash – it is like – think that your main frame line is your TV in your room. There are 3 types of objects in flash:

Movie Clip – is some thing like one more TV


Movie Clip as a TV can have it’s name. And you can control them. It can live there own life – and show what you draw there. Or you can control it. Like : Hey you – TV that play move in my main TV – can you please show me some thing else ? You show some shit to me – I want some thing better. He say – OK – and do it

TV can show you static or dynamic picture. You can control it by remote control or by pressing buttons on them.
There is 2nd type of object – buttons. On press the button/click or relese it your TV can make some thing like it do in real life.
The 3rd type is graphic – it is something simple like picture. You can not control it like “hey you do some thing” – it is only for design some thing in Adobe Program for making flash.
Let us speake a little more about Movie Clip symbols (our TVs).
When you create Movie Clip object – (name 1) is the name in your libruary. Name 2 – is the program name of your object. You can say him to do some thing using this name.
For example: TvWithStupidName.gotoAndPlay(“CoolMovie”);
TvWithStupidName.stop();
And etc.
If you have MovieClipObject in MovieClipObject – you can not say him “hey you TvWithStupidName.gotoAndPlay(“CoolMovie”);
It is in another MovieClipObject – so ir will not hear you.
You have to say MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
But if you say so from some another MovieClipObject – it will not understand you and will try to find it in itself. So you have to say :
_root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
_root is the main line – then it will try to say it directly, like you will say from main layer :
MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
Or you can wright from main layer :
_root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
It is the same in this situation.
In as2 – your main frame line calls itself _root.
For example you make 2 Movie Clip Objects on your main root layer - and name them MyTV1 and MyTV2.
You can enter them by double click and draw some thing in it. For example some movie with more then 1 frame. (See MyRoot2TVexampleAS2).
In as3 – he is root without _.
There is not only that difference !!!
For example it will not be like :
WRONG WRONG WRONG !!! root.MainTVWithAnotherTVInIt.TvWithStupidName.gotoAndPlay(“CoolMovie”);
WRONG WRONG WRONG !!!
You have to say him (he is more stupid – hey you MainTV – you are mainTV – I am talking to you =), as mainTV – say to your frend to play something =))
It will look like:
(root as MovieClip).MainTV.TvWithStupidName.gotoAndPlay(“CoolMovie”);
It can talk to his parents to like: (parent as MovieClip).gotoAndPlay(“CoolMovie”);
Or for example: (parent as MovieClip).SomeAnotherTv.gotoAndPlay(“CoolMovie”);
Or for example: (parent.parent as MovieClip).CheatOpen=1;
Oh I mean : (parent.parent as MovieClip).gotoAndPlay(“CoolMovie”);
2
I will tell you about cheats a little later

For example NOW !

There is no difference in MainLine and your MovieClipObject. They can have variables or gotoAndPlay/stop() and etc.. They can have another objects in it. Theu can use variables of each other. And if you will not use _root/root/parent commands – you can add a lot of MovieClipsObjects – and they will live by theit own life and will not bother each other. So some time it is usefull.
I will tell about all of this stuff later.
The last thing you need for making your first complicated flash game.
(YES IT IS SO SIMPLE !!! One little step and you can make your own hentai or no hentai games =) - for example like this one: http://ownerofsuccuby.narod.ru/AboutSite/LD.swf (press OOS icon for random dance

I will not post hentay samples there

You need to know how to make control of your movie. You will need buttons. It is more simple to make in AS2 - MyRoot2TVexampleAS2.zip – is AS2 version.
RenamonBasicExample01.zip – is AS3 version.
Button is Flash Object – that can listen events like is it pressed / clicked / released and etc.
This 3 is more important as I think.


How to make command – that will work by using your button ?
Click – like on picture.
Then like code there.
Code is always the same.
For AS2 it is:
On (press/release/rollover/rollOutside/rollOut) – you have to choose 1 of this.
Press – when mouse is pressed.
Release – on mouse press and then release (In AS3 it become Click)
rollOutside – when your mouse is on the button but you did not click yet.
rollOut – mouse go out from the button.
Then in {Some action here – play something; Something.gotoAndStop(SomeWhere); or do something else}
1
Congratulation – now you can do your first game. But it will be very simple – but a lot of very very good for example hentay games use only this program stuff.
For AS3 it is more harder.
It looks like this one. You make function. Give name to it. Her name is fNext.
Then you say what to do in { … }. All another is always the same.
bNext – is the name of your button. Like it was in your MovieClipObjects. You can make it not only for button but for MovieClipObject too – and it will work like button than.
function fNext(e:MouseEvent):void{
MyTalk.play();
}
bNext.addEventListener(MouseEvent.CLICK, fNext);
MouseEvent.CLICK – is some thing like it was in AS2 – click/release/press and etc.
MouseEvent – show us that it will work on event that you will do with mouse – for example CLICK on that button.
fNext show us what it will do after you CLICK your bNext vutton (or MovieClipObject) by mouse.
0
It is the end of 1.a.
3
Read 1.b – for more experience

b)Conditions
Spoiler (click to show/hide):
Lets speak a little about conditions.
The first that you will need are variables.
For example you need some variables in which you want to put some string or number.
Name them : MyVar1, MyVar2, MyVar3.
How to put some thing in it ?
In AS2 it will be like:
MyVar1=1;
Or you can wright: _root.MyVar1=1;
_root.MyVar1 – is global variable. You can read this from any other objects like MyVarInSomeObject=_root.MyVar1.
If you wright MyVarInSomeObject=MyVar1 – it can be that MyVar1 is in another object and it will not understand you. But if you do some object that lives his own life – wright MyVar without _root is good. Root will not see MyVar1 variable in that object – unless you say him to see it directly (like _root.SomeObject.MayBeOnemoreObjectInThatObject.MyVar1).
If object do not see some thing – it will not other him, but he can not communicate with some thing, he did not see
.
In AS3 it is a little harder. You have to wright:
var MyAS3Var1:int=1;
var MyAS3Var2:String=”Hello”;
You have to show what type our variable have to be. So AS2 is more simple and do some work for you. But some times he can make a mistake – and do something unexpected – if hi did not understand you
var MyAS3Var1:int=3;
(root as MovieClip).MyAS3Var1=4;
trace(MyAS3Var1); //it wright 4 to you
For global
If you put your MyAS3Var1 – on main root timeline.
Now speak a little about conditions =)))
If some thing done or not done – it will make some thing.
For example – if Krystal is clean and is not naked – give her a cookie
Or if she is not dirty and is not naked - give her a cookie
Or for example – if it is (Krystal or AnotherCoolGirl) and they are clean and note naked – give cookies to them.
How to wright it on Flash. It is a little different in AS2 and AS3 (but just a little) – so first for AS2:
Let us make some variables for example:
varKrystalNaked=true;
varKrystalClean=”VeryDirty”;
varAnotherCoolGirlNaked=false;
varAnotherCoolGirlClean=”Clean”;
If you see true / false it is a Boolean type. It can be only true or false.
“VeryDirty” and “Clean” is string type. We could put there varKrystalNaked=3 and it will be a integer type. For example 3 can be the counter how clean she is
Integer or number is good if you want to calculate some thing like:
MyIntVar1=0 // 0
MyIntVar1= MyIntVar1+1; // 1
MyIntVar2= MyIntVar1+ MyIntVar1; // 2
String is good for work with text.
Go to our Krystal again
if (varKrystalNaked==true) {gotoAndStop(“OhMyGODYouAreNaked”);}
You have to put not = but == to see is your condition right or wrong. You did not put something to variable.
if (varKrystalClean!==”Clean”){varKrystalClean=true; gotoAndStop(“WashDirtyKrystal”);}
Now she is clean and I hope she is not naked: varKrystalNaked=false;
So we can give her a cookie.
if ((varKrystalNaked==false) and (varKrystalClean==”Clean”)) {gotoAndStop(“GiveACookie”);}
Operator or is the same like and – but it works when any one condition is true they can be all true but they do not have too – like it is with and. For example:
if ((varKrystalNaked==true) or (varAnotherCoolGirlNaked==true)) {gotoAndStop((“OhMyGODYouAreNaked”);}
In AS3 it is the same – but it do not understand operators and/or. You have to wright && for and / || for or.
if ((varKrystalNaked==false) && (varKrystalClean==”Clean”)) {gotoAndStop(“GiveACookie”);}
if ((varKrystalNaked==true) || (varAnotherCoolGirlNaked==true)) {gotoAndStop((“OhMyGODYouAreNaked”);}
You can combine any number of conditions. But do not mistake in them
.
It is one more interesting operator: else
It works if some block of if do not work.
if (varKrystalClean==”Clean”) {//some code there}
else {gotoAndStop(“ShowerTime”)}
You can make else if construction:
if (varKrystalClean==”Clean”) {//some code there}
else if (varKrystalClean==”VeryClean”) {//some code there}
else if (varKrystalClean==”Dirty”) {//some code there}
else if (varKrystalClean==”VeryDirty”) {//some code there}
else {//some code there}
It differs from if / if / if construction – for example in if/else if / else construction only one block works. In if / if / if – more than one block can work.
I like if / else if construction. It is my favorite. But I tell about one more (that I do not like so much – but use some times
):
KrySamRen="Krystal";
switch (KrySamRen) {
case "Krystal" :
trace("Hi Krystal !!!");
break;
case "Samus" :
trace("Hi Samus !!!");
break;
case "WTF" :
case "wtf" :
trace("you pressed WTF or wtf");
break;
case "Renamon" :
trace("Hi Ren !!!");
break;
default :
trace("you pressed some thing else");
break;
}
Switch – put what you want to look for case for.
Trace – wrights some text to you.
Case – you case what value have to be in your variable to make some code.
Break – if you make one condition stop and do not look for others.
Default – if will not find any value it wants do the code after “default”.
Lets speak a little about conditions.
The first that you will need are variables.
For example you need some variables in which you want to put some string or number.
Name them : MyVar1, MyVar2, MyVar3.
How to put some thing in it ?
In AS2 it will be like:
MyVar1=1;
Or you can wright: _root.MyVar1=1;
_root.MyVar1 – is global variable. You can read this from any other objects like MyVarInSomeObject=_root.MyVar1.
If you wright MyVarInSomeObject=MyVar1 – it can be that MyVar1 is in another object and it will not understand you. But if you do some object that lives his own life – wright MyVar without _root is good. Root will not see MyVar1 variable in that object – unless you say him to see it directly (like _root.SomeObject.MayBeOnemoreObjectInThatObject.MyVar1).
If object do not see some thing – it will not other him, but he can not communicate with some thing, he did not see

In AS3 it is a little harder. You have to wright:
var MyAS3Var1:int=1;
var MyAS3Var2:String=”Hello”;
You have to show what type our variable have to be. So AS2 is more simple and do some work for you. But some times he can make a mistake – and do something unexpected – if hi did not understand you

var MyAS3Var1:int=3;
(root as MovieClip).MyAS3Var1=4;
trace(MyAS3Var1); //it wright 4 to you
For global

Now speak a little about conditions =)))
If some thing done or not done – it will make some thing.
For example – if Krystal is clean and is not naked – give her a cookie

Or if she is not dirty and is not naked - give her a cookie

Or for example – if it is (Krystal or AnotherCoolGirl) and they are clean and note naked – give cookies to them.
How to wright it on Flash. It is a little different in AS2 and AS3 (but just a little) – so first for AS2:
Let us make some variables for example:
varKrystalNaked=true;
varKrystalClean=”VeryDirty”;
varAnotherCoolGirlNaked=false;
varAnotherCoolGirlClean=”Clean”;
If you see true / false it is a Boolean type. It can be only true or false.
“VeryDirty” and “Clean” is string type. We could put there varKrystalNaked=3 and it will be a integer type. For example 3 can be the counter how clean she is

Integer or number is good if you want to calculate some thing like:
MyIntVar1=0 // 0
MyIntVar1= MyIntVar1+1; // 1
MyIntVar2= MyIntVar1+ MyIntVar1; // 2
String is good for work with text.
Go to our Krystal again

if (varKrystalNaked==true) {gotoAndStop(“OhMyGODYouAreNaked”);}
You have to put not = but == to see is your condition right or wrong. You did not put something to variable.
if (varKrystalClean!==”Clean”){varKrystalClean=true; gotoAndStop(“WashDirtyKrystal”);}
Now she is clean and I hope she is not naked: varKrystalNaked=false;
So we can give her a cookie.
2
if ((varKrystalNaked==false) and (varKrystalClean==”Clean”)) {gotoAndStop(“GiveACookie”);}
Operator or is the same like and – but it works when any one condition is true they can be all true but they do not have too – like it is with and. For example:
if ((varKrystalNaked==true) or (varAnotherCoolGirlNaked==true)) {gotoAndStop((“OhMyGODYouAreNaked”);}
In AS3 it is the same – but it do not understand operators and/or. You have to wright && for and / || for or.
2
if ((varKrystalNaked==false) && (varKrystalClean==”Clean”)) {gotoAndStop(“GiveACookie”);}
if ((varKrystalNaked==true) || (varAnotherCoolGirlNaked==true)) {gotoAndStop((“OhMyGODYouAreNaked”);}
You can combine any number of conditions. But do not mistake in them

It is one more interesting operator: else
It works if some block of if do not work.
if (varKrystalClean==”Clean”) {//some code there}
else {gotoAndStop(“ShowerTime”)}
You can make else if construction:
if (varKrystalClean==”Clean”) {//some code there}
else if (varKrystalClean==”VeryClean”) {//some code there}
else if (varKrystalClean==”Dirty”) {//some code there}
else if (varKrystalClean==”VeryDirty”) {//some code there}
else {//some code there}
It differs from if / if / if construction – for example in if/else if / else construction only one block works. In if / if / if – more than one block can work.
I like if / else if construction. It is my favorite. But I tell about one more (that I do not like so much – but use some times

KrySamRen="Krystal";
switch (KrySamRen) {
case "Krystal" :
trace("Hi Krystal !!!");
break;
case "Samus" :
trace("Hi Samus !!!");
break;
case "WTF" :
case "wtf" :
trace("you pressed WTF or wtf");
break;
case "Renamon" :
trace("Hi Ren !!!");
break;
default :
trace("you pressed some thing else");
break;
}
Switch – put what you want to look for case for.
Trace – wrights some text to you.
Case – you case what value have to be in your variable to make some code.
Break – if you make one condition stop and do not look for others.
Default – if will not find any value it wants do the code after “default”.
c)Cycles
Spoiler (click to show/hide):
You need cycles – when you have o do the same thing for a lot of times. Jyst as example to sum something +1 from 1 to 100 or print some thing to screen with a little chamges.
There are for example 2 type of Cycles 1)for and 2)while
Really you have to know only 1 type – they can easily replace each other. But some times it is more simple to use one and some times another
var sum:Number = 0;
for (var i:Number = 1; i <= 100; i++)
sum = sum + i; // or you can wrght sum += i; - but i do not like this stule
trace(sum); // output: 5050
var i:Number = 0;
while (i < 20) {
trace(i);
i += 3;
}
It will print:
0
3
6
9
12
15
18
for (var i:Number = 1; i <= 20; i=i+3) {
trace(i);
}
// it can be:
// for (var i:Number = 1; i <= 20; i=i++) - it means = for (var i:Number = 1; i <= 20; i=i+1)
It will print:
1
4
7
10
13
16
19
Look on sample file in zip – for more detail. It is simple chapter, so I do not think, that you will need something else
You need cycles – when you have o do the same thing for a lot of times. Jyst as example to sum something +1 from 1 to 100 or print some thing to screen with a little chamges.
There are for example 2 type of Cycles 1)for and 2)while
Really you have to know only 1 type – they can easily replace each other. But some times it is more simple to use one and some times another

var sum:Number = 0;
for (var i:Number = 1; i <= 100; i++)
sum = sum + i; // or you can wrght sum += i; - but i do not like this stule

trace(sum); // output: 5050
0
var i:Number = 0;
while (i < 20) {
trace(i);
i += 3;
}
It will print:
0
3
6
9
12
15
18
for (var i:Number = 1; i <= 20; i=i+3) {
trace(i);
}
// it can be:
// for (var i:Number = 1; i <= 20; i=i++) - it means = for (var i:Number = 1; i <= 20; i=i+1)
It will print:
1
4
7
10
13
16
19
Look on sample file in zip – for more detail. It is simple chapter, so I do not think, that you will need something else

1
d)Base actions
Spoiler (click to show/hide):
Let me tell you about functions first.
Some times you have to use the same program text. May be with little changes. It is boooring.
That’s for there are functions. You can copy only it’s name – and it will do all the big fragment of code had to do.
Let I show you on examples.
For AS2 it will be like:
function sqr(x:Number) {
return Math.pow(x, 2);
}
But I like to put definition of function before the all other text like:
function sqr(x:Number) {
return Math.pow(x, 2);
}
function GoAndArm(i:int) {
MyFox.BodyArmor.gotoAndStop(i);
MyFox.HeadArmor.gotoAndStop(i);
MyFox.LegArmor.gotoAndStop(i);
}
When I need to arm it I say GoAndArm(“2”); For example arm in 2 number armor.
When I need to calculate:
var y:Number = sqr(3); // sqr is the name of our function
trace(y); // output: 9
For example I can need function to change some global variables (let us make example that for example only do the same thing always).
function GoNaked(){
_root.varArmoredUp=0;
_root.varArmoredLegs=0;
_root.varArmoredHead=0;
MyFox.BodyArmor.gotoAndStop(0);
MyFox.HeadArmor.gotoAndStop(0);
MyFox.LegArmor.gotoAndStop(0);
}
For AS3:
function sum(a:Number, b:Number, c:Number):Number {
return (a + b + c);
}
var newValue:Number = sum(4, 32, 78);
trace(newValue); // 114
As you can see it is the same BUT !!! It is function sum(a:Number, b:Number, c:Number):Number = Number after function. It shows us what type of variable it gives for us when we use it like that.
It can be the same String,int and etc.
If you need not it have to return you any value – just do some vork you can wright void there, like:
var newValue:Number;
function sum(a:Number, b:Number, c:Number):void{
newValue=(a + b + c);
}
sum(4, 32, 78);
trace(newValue); // 114
What more can you need for making something ? You will need to move your objects by code.
Change there size, color, z layer (sorry I am a little bad in English so I do not know how to name it
). You will need, hot to change visibility of your object.
Let us speak about this.
For example we have object named Renamon – that is MovieClip type.
We can change this visibility by commands:
Renamon._alpha = [0..100];
Renamon._visible= [true/false];
We can move it like:
Renamon._x=Some value;
Renamon._y=Some value;
Renamon._ width =Some value;
Renamon._ height =Some value;
Renamon._ rotation =Some value;
It would be the same for AS3 – but it will look like (a little difference):
Renamon.x=Some value;
Renamon.y=Some value;
Renamon.width =Some value;
Renamon.height =Some value;
Renamon.rotation =Some value;
Without “_” in it
Some times you will need to change color of some parts of your character. You can do it like _root.Character.SomeBodyPart.gotoAndStop(“SomeArmor”);
But some times may be you will need change it more detail.
For that purpose is:
For example you have MovieClipObject with name MyTV:
var my_color:Color = new Color(MyTV);
my_color.setRGB(0x000000);
//Not #000000 like in piker where you watch colors - it is 0x000000
It makes it black.
For more harder examples look for attachments.
Thank Gorepete for them !
Now speak a little about Z-order. In AS2:
For example you have MovieClipObjects with names B3/B2/B1.
B3 is under B2 is under B1.
So B1 is the UP object.
If you will make: B3.swapDepths(B1);
B3 will be the UP object.
To get the UP (That is upper then all other) object in the one MovieClipObjects (or on _root layer):
For example for B1 and make it the UP:
B1.swapDepths(B1._parent.getNextHighestDepth());
Make now B2 the UP
B2.swapDepths(B2._parent.getNextHighestDepth());
Make now B2 the UP
B3.swapDepths(B3._parent.getNextHighestDepth());
In AS3 it is the same:
You can get Z-Layer of your object like: getChildIndex(B1);
And then change it like: (root as MovieClip).setChildIndex((root as MovieClip).getChildAt(1), 0);
Then more is Index – then Upper is it.
trace((root as MovieClip).getChildIndex(B1)); //1
trace((root as MovieClip).getChildIndex(B2)); //0
(root as MovieClip).setChildIndex((root as MovieClip).getChildAt(1), 0);
trace((root as MovieClip).getChildIndex(B1)); //0
trace((root as MovieClip).getChildIndex(B2)); //1
Let me tell you about functions first.
Some times you have to use the same program text. May be with little changes. It is boooring.
That’s for there are functions. You can copy only it’s name – and it will do all the big fragment of code had to do.
Let I show you on examples.
For AS2 it will be like:
function sqr(x:Number) {
return Math.pow(x, 2);
}
But I like to put definition of function before the all other text like:
function sqr(x:Number) {
return Math.pow(x, 2);
}
function GoAndArm(i:int) {
MyFox.BodyArmor.gotoAndStop(i);
MyFox.HeadArmor.gotoAndStop(i);
MyFox.LegArmor.gotoAndStop(i);
}
When I need to arm it I say GoAndArm(“2”); For example arm in 2 number armor.
When I need to calculate:
var y:Number = sqr(3); // sqr is the name of our function
trace(y); // output: 9
For example I can need function to change some global variables (let us make example that for example only do the same thing always).
function GoNaked(){
_root.varArmoredUp=0;
_root.varArmoredLegs=0;
_root.varArmoredHead=0;
MyFox.BodyArmor.gotoAndStop(0);
MyFox.HeadArmor.gotoAndStop(0);
MyFox.LegArmor.gotoAndStop(0);
}
For AS3:
function sum(a:Number, b:Number, c:Number):Number {
return (a + b + c);
}
var newValue:Number = sum(4, 32, 78);
trace(newValue); // 114
As you can see it is the same BUT !!! It is function sum(a:Number, b:Number, c:Number):Number = Number after function. It shows us what type of variable it gives for us when we use it like that.
It can be the same String,int and etc.
If you need not it have to return you any value – just do some vork you can wright void there, like:
var newValue:Number;
function sum(a:Number, b:Number, c:Number):void{
newValue=(a + b + c);
}
sum(4, 32, 78);
trace(newValue); // 114
What more can you need for making something ? You will need to move your objects by code.
Change there size, color, z layer (sorry I am a little bad in English so I do not know how to name it

Let us speak about this.
For example we have object named Renamon – that is MovieClip type.
x
We can change this visibility by commands:
Renamon._alpha = [0..100];
Renamon._visible= [true/false];
We can move it like:
Renamon._x=Some value;
Renamon._y=Some value;
Renamon._ width =Some value;
Renamon._ height =Some value;
Renamon._ rotation =Some value;
It would be the same for AS3 – but it will look like (a little difference):
Renamon.x=Some value;
Renamon.y=Some value;
Renamon.width =Some value;
Renamon.height =Some value;
Renamon.rotation =Some value;
Without “_” in it

x
Some times you will need to change color of some parts of your character. You can do it like _root.Character.SomeBodyPart.gotoAndStop(“SomeArmor”);
But some times may be you will need change it more detail.
For that purpose is:
x
For example you have MovieClipObject with name MyTV:
var my_color:Color = new Color(MyTV);
my_color.setRGB(0x000000);
//Not #000000 like in piker where you watch colors - it is 0x000000
It makes it black.
For more harder examples look for attachments.
Thank Gorepete for them !
x
Now speak a little about Z-order. In AS2:
For example you have MovieClipObjects with names B3/B2/B1.
B3 is under B2 is under B1.
So B1 is the UP object.
If you will make: B3.swapDepths(B1);
B3 will be the UP object.
To get the UP (That is upper then all other) object in the one MovieClipObjects (or on _root layer):
For example for B1 and make it the UP:
B1.swapDepths(B1._parent.getNextHighestDepth());
Make now B2 the UP
B2.swapDepths(B2._parent.getNextHighestDepth());
Make now B2 the UP
B3.swapDepths(B3._parent.getNextHighestDepth());
In AS3 it is the same:
You can get Z-Layer of your object like: getChildIndex(B1);
And then change it like: (root as MovieClip).setChildIndex((root as MovieClip).getChildAt(1), 0);
Then more is Index – then Upper is it.
trace((root as MovieClip).getChildIndex(B1)); //1
trace((root as MovieClip).getChildIndex(B2)); //0
(root as MovieClip).setChildIndex((root as MovieClip).getChildAt(1), 0);
trace((root as MovieClip).getChildIndex(B1)); //0
trace((root as MovieClip).getChildIndex(B2)); //1
Let us speak about how to make games now

