Hey list,
Don't know if you know Ming a bit (http://ming.sourceforge.net/).
anyway: Ming basically only compiles AS1 (no classes etc).
In a foolish mood I tackled the Ming compiler-stuff (bison/flex), and with
some success!
Well. its not MTASC yet.
But: I now can ming-compile a *very* simple class with Ming, and call its
methods.
I use #initclip in a mc to initialize a class:
#initclip
if(!org)
{
_global.org = new Object();
}
if(!org.osflash)
{
_global.org.osflash = new Object();
}
var _local = (_global.org.osflash.myClass = function() {} ).prototype;
_local.testMethod = function()
{
return "Hello World";
}
ASSetPropFlags (_local, null, 0);
#endinitclip
Okay: this code is added to frame #1 of a export:
swf
|_library
|_ mc #1 ("__Packages.org.osflash.myClass")
Now, in _root is some testcode:
- when the mc is added to the library only: no joy.
- when the mc is added to stage: joy! class method is called all right.
Q: why? Is a Object.registerClass required somewhere?
Q: Is there a way to kick the library-mc into action? Or should the mc be
added to stage _always_ ?
I compared swf's using ActionScriptViewer and noticed one weird thing: my
'class mc' has a framecount of #1, whilst mtasc-swf's has a framecount of
#0. Something tells me this may have to do with my library-mc not 'working'.
Q: ehe: does this make any sense?
Thanks and sorry for the long post,
Tim
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org