[mtasc] thoughts about 32K bytecode limit
titi2027 at netplus.ch
Tue Jun 14 21:48:41 CEST 2005
See about ming library. You can create swf from string data (and
actionScript actions, so you can create dataProviders array, and so on).
I use it with php and python to create data swf (ie from xml or excel
dataSheet). I never have tested the 32k limit, but maybe it can help you.
David Rorex a écrit :
>What I want to do, is create an xml -> swf converter, but for data,
>not code or graphics. I'm almost there, as I have created a xml -> as
>code converter (it reads in xml and prints out the actionscript code
>to recreate that data structure). The problem is the 32k bytecode
>limit, which limits how much data I can have.
>Since it's just data, it doesn't really need to be in a class, but
>currently that's the only way to compile things with mtasc.
>My thoughts on how to get around this are:
>a) have a mtasc mode that just compiles to code on frame 1, not inside a class
>b) the limit is caused by the fact that classes compile somthing like:
> _global.myclass =
> // class definition here
>it's the if bytecode which has a limit of 32K. What you can do
>however, which i've done by hand with flasm before, is make multiple
>so instead of this, which gives an error because the label is too far
>from the branch:
>// 40kb here
>You can do something like
>//20kb of data here
>// just insert the following ANYWHERE into the middle of the bytecode,
>it doesn't seem to matter if its inside another function or something
>//20kb of data here
>as you can see, there is no single jump that covers more than 32k, but
>the effect is the same.
>I'm doing this whole thing, because I want to be able to convert my
>data into bytecode, which I believe will eliminate some of the loading
>times (because I have to both load the xml, and then process it to get
>a nice AS Object/Array structure, which can add up to several seconds
>on large xml files). If it was compiled into bytecode, i'd just need
>to do loadMovie() on the .swf, and then my data would be available.
>Feel free to suggest any other ideas for me, or point out why this
>MTASC : no more coffee break while compiling
More information about the mtasc