PDA

View Full Version : MovieClip and Actionscript


rlee
11-20-2002, 03:29 AM
Hi there,

1. Actionscript could be put on a MC on the main timeline. (press F9 on MC)
2. Actionscript could be put on a MC on its timeline. (after double click the MC, press F9)
3. Actionscript could be put on a MC by adding a layer on its timeline. (after double click the MC, add a timeline, add a keyframe and press F9)

which way should i do?????

if i wish to make a custom class, should i make it in the 3rd way? so that i could use .prototype to put all methods and properties into the mc???

get confused newbies :(

death
11-20-2002, 04:38 AM
Hail ...
for custom class i think its better to put your scripts on main timelines and rich to mc s with _root.instancename.
if you wanna use actions IN your mc and for the mc for itself its better to put that in the special mc...
i mean when you want to write actions that rich all of mc s playin' with them its better to put on main timeline of your current mc scene ....

hope you get what i mean:D

rlee
11-20-2002, 05:09 AM
hi
well.. cause from the tutorial, it's said that to make a custom class, make a keyframe in the MC's timeline and then make a linkage by right mouse click in the library panel.....

anyway, are you suggesting it's better to put the custom class on the main timeline and then call the difference instances by _root.instanceName....???

how about if I got 100 instances on the main timeline with slightly different properties? should i name it one by one? when i copy and paste the MC with same instance name, it looks fine. (some problems indeed.)
so, or it is better to use MovieClip.duplicateMovieClip()

.........

could you further clarify.....many thanks

:confused:

death
11-20-2002, 07:11 AM
Hail ...
yeah ofcourse duplicate is much better than use 100 instance name ....
dl this zip file it explains dupliacte movie clip 40 times and the scripts ....
"" i think you said for 3-4 mcs "" i wrote _root.... for 3-4 instance name ... for 10 & more ofcourse duplicating is cool ;D

rlee
11-21-2002, 07:33 AM
yeh,

you are a genius. though I've seen similar stuff on the tutorial...

actually, i wish to learn creating class.. finally I got it...may be quite simple to you but i have tried for days to understand it....
e.g.

----------------------------------------------

function Clip(w,h,x,y) {
this._width = w;
this._height = h;
this._x = x;
this._y = y;
}

Clip.prototype.area = function(){
return this._width * this._height
}
myclip = new Clip(100,100,50,50);


trace(myclip.area());
trace(myclip._x);
trace(myclip._y);

---------------------------------------------

thanks, anyway. hope u could post more ans to newbies...

death
11-22-2002, 04:04 PM
Hail ..
hell yeah.... this is not my own fla file man i have it in my fla s folder and send that to ya ...
YOU R a genius not me :D ... gr8 class hope makin' others (complicated;) ) in future....
congratulation ...

EXPLODE BAND RULES!!!!!!!!