haXe 2.08 and SWC's

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

haXe 2.08 and SWC's

Lee Sylvester

Hey guys,

 

Has anyone successfully created a SWC in haXe 2.08 and included it in a Flex app?  I’ve created a SWC for a project I’m working on, but when included in a Flex app, FlashBuilder states “unable to load SWC”.  I’m hoping I’ve simply missed something, but I can’t find what.

 

Thanks,

Lee


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Michael Baczynski-2
try rezipping the swc file (rename to .zip, extract contents, rezip, rename to swc)

best,
michael

On 27.09.2011 23:16, Lee Sylvester wrote:

> Hey guys,
>
> Has anyone successfully created a SWC in haXe 2.08 and included it in a Flex app? I’ve created a SWC
> for a project I’m working on, but when included in a Flex app, FlashBuilder states “unable to load
> SWC”. I’m hoping I’ve simply missed something, but I can’t find what.
>
> Thanks,
>
> Lee
>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Lee Sylvester
Hi Michael,

Thanks, but I tried that and it still isn't recognised :-(

Lee

Sent from my iPad

On 28 Sep 2011, at 07:30, Michael Baczynski <[hidden email]> wrote:

> try rezipping the swc file (rename to .zip, extract contents, rezip, rename to swc)
>
> best,
> michael
>
> On 27.09.2011 23:16, Lee Sylvester wrote:
>> Hey guys,
>>
>> Has anyone successfully created a SWC in haXe 2.08 and included it in a Flex app? I’ve created a SWC
>> for a project I’m working on, but when included in a Flex app, FlashBuilder states “unable to load
>> SWC”. I’m hoping I’ve simply missed something, but I can’t find what.
>>
>> Thanks,
>>
>> Lee
>>
>>
>>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester
In reply to this post by Lee Sylvester

So, I did a few experiments.  I created a new haXe file with the following content and compiled it to a swc :-

 

 

package;

               

class Main {

                                public static function main() {

                                                var main = new Main();

                                }

               

                                public function new() {

                                                trace( "me" );

                                }

}

 

 

I then created a new Flash app and included the swc and added this ActionScript :-

 

import flash.display.MovieClip;

var mc = new MovieClip();

addChild( mc );

haxe.init( mc );

var m = new Main();

 

When run, I get

Illegal override of init in haxe

 

It seems there’s quite a few issues with SWC’s generated from haXe.  What are other people doing to include haXe code in Flex, besides outputting AS3 classes?

 

Thanks,

Lee

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Lee Sylvester
Sent: 27 September 2011 22:16
To: 'The haXe compiler list'
Subject: [haXe] haXe 2.08 and SWC's

 

Hey guys,

 

Has anyone successfully created a SWC in haXe 2.08 and included it in a Flex app?  I’ve created a SWC for a project I’m working on, but when included in a Flex app, FlashBuilder states “unable to load SWC”.  I’m hoping I’ve simply missed something, but I can’t find what.

 

Thanks,

Lee


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Jan_Flanders
The haxe-swc's that I'm using all do work in CS4, CS5.5 and flex sdk 4.5
The only difference is that my swc's are not compiled with -main (since a swc is a library).

Jan
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester
Hey Jan,

I'm confused.  How are you telling the haXe compiler where to start if
you're not specifying -main?  Is this a trick I've not discovered?  :-)

Lee


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Jan_Flanders
Sent: 28 September 2011 17:28
To: [hidden email]
Subject: [haXe] RE: haXe 2.08 and SWC's

The haxe-swc's that I'm using all do work in CS4, CS5.5 and flex sdk 4.5 The
only difference is that my swc's are not compiled with -main (since a swc is
a library).

Jan

--
View this message in context:
http://haxe.1354130.n2.nabble.com/haXe-2-08-and-SWC-s-tp6837814p6840879.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

luca deltodesco
i use --macro "include('pckg_name')" rather than -main to include all classes for the package in the .swc

> From: [hidden email]

> To: [hidden email]
> Subject: RE: [haXe] RE: haXe 2.08 and SWC's
> Date: Wed, 28 Sep 2011 17:48:12 +0100
>
> Hey Jan,
>
> I'm confused. How are you telling the haXe compiler where to start if
> you're not specifying -main? Is this a trick I've not discovered? :-)
>
> Lee
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jan_Flanders
> Sent: 28 September 2011 17:28
> To: [hidden email]
> Subject: [haXe] RE: haXe 2.08 and SWC's
>
> The haxe-swc's that I'm using all do work in CS4, CS5.5 and flex sdk 4.5 The
> only difference is that my swc's are not compiled with -main (since a swc is
> a library).
>
> Jan
>
> --
> View this message in context:
> http://haxe.1354130.n2.nabble.com/haXe-2-08-and-SWC-s-tp6837814p6840879.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
> --
> haXe - an open source web programming language http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester

:S  Yeah, I spotted that feature.  However, I can’t use that without editing all the JS specific classes in the package, which I’d rather avoid.

 

Lee

 

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of luca deltodesco
Sent: 28 September 2011 17:59
To: [hidden email]
Subject: RE: [haXe] RE: haXe 2.08 and SWC's

 

i use --macro "include('pckg_name')" rather than -main to include all classes for the package in the .swc

> From: [hidden email]


> To: [hidden email]
> Subject: RE: [haXe] RE: haXe 2.08 and SWC's
> Date: Wed, 28 Sep 2011 17:48:12 +0100
>
> Hey Jan,
>
> I'm confused. How are you telling the haXe compiler where to start if
> you're not specifying -main? Is this a trick I've not discovered? :-)
>
> Lee
>
>
> -----Original Message-----
> From: [hidden email]
> [hidden email] On Behalf Of Jan_Flanders
> Sent: 28 September 2011 17:28
> To: [hidden email]
> Subject: [haXe] RE: haXe 2.08 and SWC's
>
> The haxe-swc's that I'm using all do work in CS4, CS5.5 and flex sdk 4.5 The
> only difference is that my swc's are not compiled with -main (since a swc is
> a library).
>
> Jan
>
> --
> View this message in context:
> http://haxe.1354130.n2.nabble.com/haXe-2-08-and-SWC-s-tp6837814p6840879.html
> Sent from the Haxe mailing list archive at Nabble.com.
>
> --
> haXe - an open source web programming language http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Nicolas Cannasse
Le 28/09/2011 20:07, Lee Sylvester a écrit :
> :S Yeah, I spotted that feature. However, I can’t use that without
> editing all the JS specific classes in the package, which I’d rather avoid.

You can add additional parameters to specify an exclude list, see
http://haxe.org/api/haxe/macro/Compiler

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester
Okay, so, I refactored all the code so that I can now use the --macro
include feature and remove -main.  However, Flex still can't load my SWC.
The content of the SWC is pure code.  How can it not load it?

Cheers,
Lee


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nicolas Cannasse
Sent: 28 September 2011 20:26
To: The haXe compiler list
Subject: Re: [haXe] RE: haXe 2.08 and SWC's

Le 28/09/2011 20:07, Lee Sylvester a écrit :
> :S Yeah, I spotted that feature. However, I can’t use that without
> editing all the JS specific classes in the package, which I’d rather
avoid.

You can add additional parameters to specify an exclude list, see
http://haxe.org/api/haxe/macro/Compiler

Best,
Nicolas

--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Michael Baczynski-2
In reply to this post by Lee Sylvester
I found some time to look into this, seems it is related to -D swf-protected. I just opened a ticket
here: http://code.google.com/p/haxe/issues/detail?id=526
Nicolas, can you look into this? All my swc files are broken :(

best,
michael

On 28.09.2011 15:52, Lee Sylvester wrote:

> Illegal override of init in haxe
>
> It seems there’s quite a few issues with SWC’s generated from haXe. What are other people doing to
> include haXe code in Flex, besides outputting AS3 classes?
>
> Thanks,
>
> Lee
>
> *From:*[hidden email] [mailto:[hidden email]] *On Behalf Of
> *Lee Sylvester
> *Sent:* 27 September 2011 22:16
> *To:* 'The haXe compiler list'
> *Subject:* [haXe] haXe 2.08 and SWC's
>
> Hey guys,
>
> Has anyone successfully created a SWC in haXe 2.08 and included it in a Flex app? I’ve created a SWC
> for a project I’m working on, but when included in a Flex app, FlashBuilder states “unable to load
> SWC”. I’m hoping I’ve simply missed something, but I can’t find what.
>
> Thanks,
>
> Lee
>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester
Thanks, Michael.  I never would have found that :-)

Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Michael Baczynski
Sent: 29 September 2011 16:48
To: The haXe compiler list
Subject: Re: [haXe] haXe 2.08 and SWC's

I found some time to look into this, seems it is related to -D
swf-protected. I just opened a ticket
here: http://code.google.com/p/haxe/issues/detail?id=526
Nicolas, can you look into this? All my swc files are broken :(

best,
michael

On 28.09.2011 15:52, Lee Sylvester wrote:
> Illegal override of init in haxe
>
> It seems there's quite a few issues with SWC's generated from haXe.
> What are other people doing to include haXe code in Flex, besides
outputting AS3 classes?

>
> Thanks,
>
> Lee
>
> *From:*[hidden email]
> [mailto:[hidden email]] *On Behalf Of *Lee
> Sylvester
> *Sent:* 27 September 2011 22:16
> *To:* 'The haXe compiler list'
> *Subject:* [haXe] haXe 2.08 and SWC's
>
> Hey guys,
>
> Has anyone successfully created a SWC in haXe 2.08 and included it in
> a Flex app? I've created a SWC for a project I'm working on, but when
> included in a Flex app, FlashBuilder states "unable to load SWC". I'm
hoping I've simply missed something, but I can't find what.
>
> Thanks,
>
> Lee
>
>
>


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: haXe 2.08 and SWC's

Lee Sylvester
Hey Nicolas,

Can you confirm this is the problem, please?  This is a real show stopper
for me :-(

Thanks,
Lee


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Michael Baczynski
Sent: 29 September 2011 16:48
To: The haXe compiler list
Subject: Re: [haXe] haXe 2.08 and SWC's

I found some time to look into this, seems it is related to -D
swf-protected. I just opened a ticket
here: http://code.google.com/p/haxe/issues/detail?id=526
Nicolas, can you look into this? All my swc files are broken :(

best,
michael

On 28.09.2011 15:52, Lee Sylvester wrote:
> Illegal override of init in haxe
>
> It seems there's quite a few issues with SWC's generated from haXe.
> What are other people doing to include haXe code in Flex, besides
outputting AS3 classes?

>
> Thanks,
>
> Lee
>
> *From:*[hidden email]
> [mailto:[hidden email]] *On Behalf Of *Lee
> Sylvester
> *Sent:* 27 September 2011 22:16
> *To:* 'The haXe compiler list'
> *Subject:* [haXe] haXe 2.08 and SWC's
>
> Hey guys,
>
> Has anyone successfully created a SWC in haXe 2.08 and included it in
> a Flex app? I've created a SWC for a project I'm working on, but when
> included in a Flex app, FlashBuilder states "unable to load SWC". I'm
hoping I've simply missed something, but I can't find what.
>
> Thanks,
>
> Lee
>
>
>


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Nicolas Cannasse
Le 01/10/2011 11:11, Lee Sylvester a écrit :
> Hey Nicolas,
>
> Can you confirm this is the problem, please?  This is a real show stopper
> for me :-(

Will try to have a look at it but can't be sure since it's very nice
weather outside this weekend :)

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Jan_Flanders
The 'protected' (flash package) namespace is only applied to the Boot class but not to the haxe class which makes overriding that init function an illegal override.

Jan
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Nicolas Cannasse
Le 01/10/2011 17:41, Jan_Flanders a écrit :
> The 'protected' (flash package) namespace is only applied to the Boot class
> but not to the haxe class which makes overriding that init function an
> illegal override.

Thanks Jan that was helpful to quickly fix the issue.
It should be fixed in r3999

Best,
Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Lee Sylvester
Thanks, Nicolas, I'll give it a whirl :-)  Now, go an enjoy the sun!!! :-D

Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nicolas Cannasse
Sent: 01 October 2011 17:04
To: The haXe compiler list
Subject: Re: [haXe] Re: haXe 2.08 and SWC's

Le 01/10/2011 17:41, Jan_Flanders a écrit :
> The 'protected' (flash package) namespace is only applied to the Boot
> class but not to the haxe class which makes overriding that init
> function an illegal override.

Thanks Jan that was helpful to quickly fix the issue.
It should be fixed in r3999

Best,
Nicolas


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Lee Sylvester
Sorry, Nicolas, but my SWC's still aren't being recognised :-(

Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Lee Sylvester
Sent: 01 October 2011 18:34
To: 'The haXe compiler list'
Subject: RE: [haXe] Re: haXe 2.08 and SWC's

Thanks, Nicolas, I'll give it a whirl :-)  Now, go an enjoy the sun!!! :-D

Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nicolas Cannasse
Sent: 01 October 2011 17:04
To: The haXe compiler list
Subject: Re: [haXe] Re: haXe 2.08 and SWC's

Le 01/10/2011 17:41, Jan_Flanders a écrit :
> The 'protected' (flash package) namespace is only applied to the Boot
> class but not to the haxe class which makes overriding that init
> function an illegal override.

Thanks Jan that was helpful to quickly fix the issue.
It should be fixed in r3999

Best,
Nicolas


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haXe 2.08 and SWC's

Lee Sylvester
In reply to this post by Lee Sylvester
Hey guys,

I managed to fix my SWC issue.  In case anyone else gets the same problem as
me (not being able to use a haXe built SWC in Flex or Flash), the answer
what that I had to remove the -swf-libs from my compile and add them
manually to my Flex project.  It worked fine, then.  I guess, somehow, the
way in which haXe compiles these SWF libraries into the output SWC must be
confusing to Flex / Flash.

Cheers,
Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Lee Sylvester
Sent: 01 October 2011 18:34
To: 'The haXe compiler list'
Subject: RE: [haXe] Re: haXe 2.08 and SWC's

Thanks, Nicolas, I'll give it a whirl :-)  Now, go an enjoy the sun!!! :-D

Lee



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Nicolas Cannasse
Sent: 01 October 2011 17:04
To: The haXe compiler list
Subject: Re: [haXe] Re: haXe 2.08 and SWC's

Le 01/10/2011 17:41, Jan_Flanders a écrit :
> The 'protected' (flash package) namespace is only applied to the Boot
> class but not to the haxe class which makes overriding that init
> function an illegal override.

Thanks Jan that was helpful to quickly fix the issue.
It should be fixed in r3999

Best,
Nicolas


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: RE: [haXe] Re: haXe 2.08 and SWC's

Rob Fell
Hi Lee, iirc swcs with -swf-libs  can be done but any libs need to have
been compiled as swcs initially (and then swfs extracted from the swc
via zip method and corresponding catalog xml added):
http://lists.motion-twin.com/pipermail/haxe/2011-April/042904.html
I think I know why, but I know I don't want to think why.

Cheers, Rob

On 11:59 AM, Lee Sylvester wrote:

> Hey guys,
>
> I managed to fix my SWC issue.  In case anyone else gets the same problem as
> me (not being able to use a haXe built SWC in Flex or Flash), the answer
> what that I had to remove the -swf-libs from my compile and add them
> manually to my Flex project.  It worked fine, then.  I guess, somehow, the
> way in which haXe compiles these SWF libraries into the output SWC must be
> confusing to Flex / Flash.
>
> Cheers,
> Lee
>
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Lee Sylvester
> Sent: 01 October 2011 18:34
> To: 'The haXe compiler list'
> Subject: RE: [haXe] Re: haXe 2.08 and SWC's
>
> Thanks, Nicolas, I'll give it a whirl :-)  Now, go an enjoy the sun!!! :-D
>
> Lee
>
>
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Nicolas Cannasse
> Sent: 01 October 2011 17:04
> To: The haXe compiler list
> Subject: Re: [haXe] Re: haXe 2.08 and SWC's
>
> Le 01/10/2011 17:41, Jan_Flanders a écrit :
>> The 'protected' (flash package) namespace is only applied to the Boot
>> class but not to the haxe class which makes overriding that init
>> function an illegal override.
> Thanks Jan that was helpful to quickly fix the issue.
> It should be fixed in r3999
>
> Best,
> Nicolas
>
>
> --
> haXe - an open source web programming language http://haxe.org
>
>
> --
> haXe - an open source web programming language http://haxe.org
>
>
>
>

--
haXe - an open source web programming language
http://haxe.org