aaaidan
aaaidan

Reputation: 7316

Sizes of datatypes for actionscript 3

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.

Upvotes: 8

Views: 2023

Answers (5)

Jeremy White
Jeremy White

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

Kaken Bok
Kaken Bok

Reputation: 3395

I came to the same question and wrote this flash.sampler thing. Here are code and results (scroll down):

http://www.flashforum.de/forum/actionscript-3/verwendeter-speicher-fuer-deklaration-va-initialisierung-288349.html

Upvotes: 1

Lance Pollard
Lance Pollard

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

Allan
Allan

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

Adam Harte
Adam Harte

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

Related Questions