1

I have some data-crunching code implemented in ActionScript, and I'd like to call it from JavaScript. The related question Interacting with actionscript 3.0 using javascript mentions the blog post http://blog.circlecube.com/2008/02/01/actionscript-javascript-communication/ which tells me how to do this. All I need now is generating the SWF file from the .as file completely automatically, with a comand-line tool on Linux. How is this possible?

Is there a speed difference between AS2 and AS3?

4 Answers 4

3

Get the free Flex SDK if you are using as3. (Use mtasc if you are using as2)

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for the link to mtasc, it works for me. Do you have a tutorial for using the Flex SDK from the command line to compile an .as file to an .swf?
You know this handy search engine named google do you? ;-) It gave me this link: edutechwiki.unige.ch/en/AS3_Compiling_a_program
Thank you for the link about how to run the AS3 compiler. This was enough to get me started, and I could figure out all I needed.
3

"Is there a speed difference between AS2 and AS3?"

Yes, there is a huge difference, AS3 is much faster, especially in "data-crunching" and such operations, that you mention.

2 Comments

I'm interested in the numbers. According to my number crunching measurements, AS3 is only 4 times faster than AS2 (I'm not impressed, still 4 times slower than the JavaScript in Google Chrome), but only if I take care of using int vs Number properly, and using Vector.<int> instead of Array.
If performance is such a high priority, consider using Silverlight. Or if Chrome can do it faster than both FL/SL, just do it in JS.
2

Answering my own question, AS3 can be up to 4 times faster than AS2 for number crunching (depending on the code tested), and Flash Player 10 is faster than Flash Player 9, especially Vector.<int> is much faster than Array.

I've summarized automatic SWF generation from AS2 and AS3 sources in my blog post: http://ptspts.blogspot.com/2009/10/how-to-create-actionscript-3-as3-flash.html. I had to collect information for that from dozens of web sites.

Comments

1

As the others have said yes AS3 is faster than AS2. There are a few other ways to squeeze more performance. One way is pixel bender which you can consider like writing a PixelShader for a GPU except here it is being calculated in software and not hardware. Also Alchemy has shown to improve some performance. Check out http://blog.joa-ebert.com/ The performance Joa is able to gain with various optimisations (some by optimising the byte code) is awesome.

I think this is the article but I am at work so I can not verify. http://blog.joa-ebert.com/2009/04/03/massive-amounts-of-3d-particles-without-alchemy-and-pixelbender/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.