Reputation: 7316
Anyone know any good resources or personal experience that help explain how much memory (and swf size) the various built-in data types take up in actionscript 3? I'm specifically interested in int
, Number
, and (dense) Array
s or Vector
s.
I'm working on a project where I need to embed large amounts of structured array data, which is already in C++ format, so porting is just a matter of copy-paste, search-replace.
I've already had a look at Adobe's lowdown on datatypes but it's not specific enough, and doesn't mention Arrays, etc.
Upvotes: 8
Views: 2023
Reputation: 2829
Check out this mobile development whitepaper for AS3. It's labelled as a "mobile" development spec, but the principles in here work for any Flash project.
http://help.adobe.com/en_US/as3/mobile/index.html
You can also experiment with the flash.sampler.getSize() method. A direct link to what you're looking at is here:
http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3-576ba64d124318d7189-7fff.html http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c3a0f5f19124318fc87b-7fff.html
Upvotes: 1
Reputation: 3395
I came to the same question and wrote this flash.sampler thing. Here are code and results (scroll down):
Upvotes: 1
Reputation: 79268
Not directly about datatype sizes in ActionScript, but it is a lot about memory and performance from one of the masters.
Check out Grant Skinner's Quick as a Flash Presentation. One of the best.
Upvotes: 2
Reputation: 3314
This SWF spec sheet may be what you are after http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf specifically Chapter 5.
Upvotes: 3
Reputation: 10510
Not really about the size of the datatypes, but rather details about numeric types in AS3: http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html
Upvotes: 2