|
-
Senior Member
[disc] put actionscript in a movieclip or on stage?
I'm fairly new to actionscript and the way I learnt it I write it all on the stage. After reading these threads for awhile I get the impression a lot of people put some actionscript in the movieclips themselves.
I was just hoping some of you might say why/when you put actionscript im movieclips and what advantages this has over putting it on the stage.
Thanks to anyone that does this, I'll find it really useful and I'm sure some other noobs will too.
-
Heli Attack!
If you write your code on stage, then, in my opinion, you are doing things correctly.
I prefer to write my code on the stage as it keeps it all together, furthermore it is usually faster to restrict the number of onEnterFrames.
-
Hype over content...
I'm with pred on this.
enterFrames cause a hit, plus you'll be calling things like _parent.score from the mc, which causes a further performance hit.
Debugging is a zillion times easier if all your code is nice and neat together.
Squize.
-
Say hello to Bob
Kind of similar opinion to iopred and squize (there the pros ), it is best to code on the stage and really it is no harder than coding in mcs, i must admit my first couple of games are all coded in mcs, but im finding it really hard going back through those engines because every other line is _root.this or _parent.that, its confusing as hell. I made the transition a couple of months back and once you get used to coing in the stage you will wonder how you ever lived without doing it, having said that i do still tend to put basic things in mcs, say for instance a characters movement in the char mc, but once the engine nears completion i slot it in the stage somewhere, this is no problem being as the layout is basically identical on the stage as it is in the mc itself.
On a final note, if you are new to AS i would suggest just coding the way you feel comfortable, then once you know some decent stuff you can ween yourself off of it and code 'properly'.
Thanks.
If our body is a clock ticking away and if while we experience all that this world has to offer time has still continued to pass, are we living or just experiencing a slow death?
-
n00b
I like using class files for everything and only create an instance of the main class on the stage. But some code is in class files associated/linked to movieclips.
Altough there is a strange phenomenon/bug about as 2.0 if you use this way but never mind about that you will find out yourself.
(By the way does anyone share the opinion that it should not be like when you get errors when using packages even if everything is fine, syntax checks give errors.)
I do stuff that does stuff...
J-Force
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|