At 8/18/08 06:22 PM, Rammer wrote:
At 8/18/08 05:55 PM, Alpharius120 wrote:
I completely agree with you. I've seen patu post like 5 times here, I don't cosider myself a reg and neither should he.
back in the day (like...'06 - '07), patu would be here a lot more.
HAAALLP PLOX D:
since my last post calling out for help was more or less ignored....here it goes again, lawl:
so i've dabbled a bit in AS3, but i never really made a fully-fledged game with it, and now it's really nagging at me. AS2 is pretty easy for making games with lots of dynamically generated movieclips with their own onEnterFrames and properties and shit without too much hassle, but i need someone to sort of mentor me in how to do this with AS3.
add my msn, clan2kroolz[at]msn(dot)com, plzkthx, because i'm sure delta is sick and tired of helping me out ;3
Adding movieclips really is not as hard as it may seem.
First example is making a new movieclip through AS,
First, you create the new movieclip. It's like declaring a variable:
var mc:MovieClip = new MovieClip();
Then you 'draw' the movieclip:
mc.graphics.beginFill(0xFF0000);
mc.graphics.drawRect(0, 0, 100, 80);
mc.graphics.endFill();
Notice the graphics between mc and the other methods. Before in AS2, it was just
mc.beginFill(0xFF0000);
So remember when you draw your movieclip to have the graphics between mc and the method.
Next, all you have to do is add the movieclip to the stage like so:
addChild(mc);
If you wanted to add that movieclip inside another movieclip you would just do this:
parentMovieClip.addChild(mc);
Next, is adding movieclips that are already in the library.
First you have to set a class to the symbol. Right click on the symbol, and click "Linkage". Click the "Export for Actionscript" checkbox, then type a name in the "Class" textbox. It will give you an error (unless you have a class of the same name). Just ignore it and click ok.
Then you do this:
var mc:Class = new Class();
Replace "Class" with the name that you gave to that movieclip (in the "Class" textbox). And you're good to go!
Just don't forget to add:
addChild(mc);
Otherwise it won't show up :)