Explain like you would to a 5 year old

please speak nooblar, as i will not understand anything else

anyway im really trying to learn AS, sometimes sh*t just puzzles me
i attached an .fla - can someone plz look at it and explain

i generally understand things like addressing the ‘box’ movieclip by typing _root.box.duplicateMovieClip
(which will duplicate the instance of the MC)


i dont get what exactly “boxx” is, what the hell is that? is it possibly the name of the new duplicated movieclip?

and i dont understand what this whole ‘count’ thing is
i know the random positioning and scaling and alpha, but ive never seen it done with ‘count’

if someone could explain it here thatd be great, if someone wants to make comments in the .fla thatd be better hehe
thx all

count = number stored in a variable so if you change that number, it will change for all of them so you don’t have to change it on all of them seperately

while (count<20) = while the number count equals is less than 20, do the following. This only allows 20 blocks on the screen at the same time. Raise or lower the number depending on how many you want.

“boxx”+count = creates a new movie clip with the name boxx and gives it the number that is in count. so if count keeps increasing your boxx clips will be called boxx1, boxx2, boxx3, so forth and so on.

_root[“boxx”+count]._something = do this to the newly created clip

count += 1; = add one to count and start over.

boxx is just a new name. You could call it anything, like dupbox, dup, etc…

count is used to do something a certain number of times.

The code says duplicated these boxes while count<20

the code will go through, duplicate one box, and add “1” to the count, as if to say “okay, I already did that once, and since count doesn’t equal twenty yet, I’ll do it again”.

So, since this thing is creating duplicates, they can’t all have the same name. Makes sense? So, in this particular case boxx is used as the base of the name. Then, we take advantage of the fact that the variable “count” is increasing by one every time it goes through, so we use it as an aid to help us name our duplicates with individual names. Therefore, the first time around it is boxx1(because count equals 1), second time it is boxx2(count equals 2)… so on and so forth…

I hope that helps a bit.

I guess I took too long to reply.

Good call, Lost.

Well if he misunderstands something in my post, I am sure it will make sense in your post :slight_smile:

thx alot
i am learning
slowly but surely
u guys are sooooooo helpful

it just baffles me that someone sat down, thought about what they wanted and was able to come up with that AS

ugggh i wish

i may have to ask u guys again on a future fla, cuz that was really helpful

one more thing on this…

_root.box.duplicateMovieClip(“boxx”+count, count);

whats the ,count for at the end?

u said the first part is simply the name of the duplicated MC, but what is the end for?

do you know a good site (or do kirupa has tutorials on it?) where i can learn from basic AS ?

the second count there is the level it loads in. Since all your clips can’t load in the same level, you need to increase it by 1 with each clip… might as well use count since that is increasing by 1 anyway.

Hmmm… I don’t really know any. I stuck with kirupa… seems to be a real good place if you do his basic tutorials for Flash 5 and MX (if you use MX, most of the Flash 5 tutorials do work).

I also go to www.actionscript.org, the tutorials at www.bit-101.com , but are not basic, and some tutorials at www.flashkit.com are actually helpful.

I think that is all the sites I go to.

nvm i found some AS tutorial on kirupa :smiley: but if you do know n e other sites, let me know

refer above

thanx lostinbeta :smiley:

No problem :beam: