[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] as3compile buggy output when compiling Sprite
From: |
Ricardo Pedroso |
Subject: |
Re: [Swftools-common] as3compile buggy output when compiling Sprite |
Date: |
Sat, 23 May 2009 01:51:39 +0100 |
On Thu, May 21, 2009 at 10:34 PM, Ludwig Weinzierl
<address@hidden> wrote:
> The following piece of code compiles and runs without errors when compiled
> with mxmlc from flex_sdk_3 or flex_sdk_4.0.0.4021.
>
> package{
> import flash.display.Sprite;
> public class Sitemap extends Sprite{
> public function Sitemap(){
> graphics.beginFill(0x00ff00, 1);
> graphics.drawCircle(100, 100, 40);
> }
> }
> }
>
> It compiles without errors with as3compile from swftools 0.9.0,
> the swf does *not* run however.
> It was compiled with:
>
> as3compile -v -R -X400 -Y400 -MSitemap
> -oSitemap-as3compiler-0.9.0-Faulty.swf Sitemap.as
>
> The Adobe Standalone Flash Debugger 10(10,0,22,87) says:
>
> An ActionScript error has occurred:
> ReferenceError: Error #1065: Variable is not defined.
>
I think mainclass *must* be a subclass of MovieClip in as3compile.
Why? I don't know.
It seems to me that the -M arg is ignored.
if you run swfdump on the resulting swf where the mainclass is a
subclass of Sprite, you have:
[HEADER] File version: 9
[HEADER] File is zlib compressed. Ratio: 77%
[HEADER] File size: 367
[HEADER] Frame rate: 25.000000
[HEADER] Frame count: 1
[HEADER] Movie width: 400.00
[HEADER] Movie height: 400.00
[045] 4 FILEATTRIBUTES as3
[052] 324 DOABC
[04c] 5 SYMBOLCLASS
exports 0000 as ""
[001] 0 SHOWFRAME 1 (00:00:00,000)
[000] 0 END
Look the line that says:
exports 0000 as ""
And now running swfdump in the resulting swf where the mainclass is a
subclass of MovieClip, you have:
[HEADER] File version: 9
[HEADER] File is zlib compressed. Ratio: 77%
[HEADER] File size: 391
[HEADER] Frame rate: 25.000000
[HEADER] Frame count: 1
[HEADER] Movie width: 400.00
[HEADER] Movie height: 400.00
[045] 4 FILEATTRIBUTES as3
[052] 341 DOABC
[04c] 12 SYMBOLCLASS
exports 0000 as "Sitemap"
[001] 0 SHOWFRAME 1 (00:00:00,000)
[000] 0 END
Now look to the "exports" line, you have your "Sitemap"
>
> I am running ubuntu 9.04 with kernel Linux 2.6.28-11-generic.
me too.
> The following compiles and runs fine when compiled with any of the
> mentioned compilers, including as3compile.
>
> package{
> import flash.display.MovieClip;
> public class Sitemap extends MovieClip{
> public function Sitemap(){
> graphics.beginFill(0x00ff00, 1);
> graphics.drawCircle(100, 100, 40);
> }
> }
> }
>
Yep, this one is OK
> Can anyone confirm this?
Yes, I get the same behaviour.
I have attach a possible solution for this.
With this you can have a Sprite as mainclass.
I don't know if this patch will raise others issues. Matthias???
Regards
Ricardo
mainclass.patch
Description: Text Data