|
-
Why use .as files
What is the difference between using .as files and including normal "actions" in FLV's?
-
I'm no expert on the actual amazing reasons why you should use AS files instead but I can tell you why I use them instead of the Actions panel (Is that what you meant by normal "actions" in FLV's?).
Everything isn't packed into one single panel like the Actions panel. What if you make something that has thousands of lines of code? Trying to find one specific line when they are all in one single panel will make you want to jump out the window. With AS files you can organize different sections of code into their specific areas. So a game would have like Main.as, Shop.as, Game.as, Enemy.as, Player.as, something like that.
You can create custom classes that you can reuse over and over again in AS files, all you have to do is create it once, then import it into every project that you need it in.
I find it easier to debug errors with, cause the output will show like
PHP Code:
Term is undefined at this.addChild () at Player.CreateBullet
This output tells me the error was caused by the CreateBullet function called by the Player class.
And lastly if you have non-programmer friends they'll be like "wow your game loads 10 different files of code? That seems so advanced!".
-
FLV - Flash Video. You cannot include any normal "actions" into it. It's just a video.
SWF - ShockWave File. A binary file which contains all of your code in a binary format that a CPU can understand.
Actually, there's a lot of articles written on this matter already. Read this, for example: http://active.tutsplus.com/tutorials...lass-in-flash/
-
 Originally Posted by 5Five555
I'm no expert on the actual amazing reasons why you should use AS files instead but I can tell you why I use them instead of the Actions panel (Is that what you meant by normal "actions" in FLV's?).
Yes, that's what I meant by "normal actions". Thank you 5Five555 for the information.
So, if I understood correctly, if I copy everything from my as file to "actions" panel in the first frame, it should work the same way as before............................................ .......(leaving out the "package" statements)
Am I right?
-
You have to take out all the public and private keywords too. Other than that I think that's all you need to change.
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
|