views:

215

answers:

4

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) Arrays or Vectors.

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.

+2  A: 

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

TandemAdam
+3  A: 

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.

Allan
Excellent reference. I have it printed and bound for work.
Todd Moses
Indeed, only found it a few months ago, its existance seems relatively unknown.
Allan
There is also an updated version http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v10.pdf
TandemAdam
nice one, you might have some more printing todo Todd :P
Allan
Ah brilliant, totally forgot about that one. Thanks Allan!
aaaidan
+1  A: 

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

Jeremy White
This was more or less what I was looking for - it's a lot like the sizeof operator in C. Maybe I coulda put that in the question.
aaaidan
+2  A: 

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.

viatropos
That is a nice presentation. Thanks!
aaaidan