Thx, stubled on this:
http://www.peterjoel.com/blog/index.php?archive=2004_01_01_archive.xml#10755
0841406346131

Looks like I need to study the '__Packages trick' some more.
+ what MTASC does with 'main'...

Tim

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens
JesterXL
Verzonden: woensdag 8 februari 2006 1:04
Aan: Open Source Flash Mailing List
Onderwerp: Re: [osflash] Ming - my first compiler - some questions...

In AS1, Object.registerClass was required, so yeah, put it at the bottom, 
after your assetpropflags.

Object.registerClass("org", org);
etc.

Not sure about #2...

----- Original Message ----- 
From: "Tim Knip" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, February 07, 2006 6:35 PM
Subject: [osflash] Ming - my first compiler - some questions...


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 


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org




_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to