You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Josh Tynjala <jo...@bowlerhat.dev> on 2021/09/09 20:19:57 UTC

Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Hey community,

I just wanted to share a little demo I put together as a way of pushing the
capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
version from 2006!) running on OpenFL in JS.

https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
Just a followup to mention that I ported the project to Flex 3 (since that
was the first open source MPL release by Adobe), and I put the full source
code up on Github:

https://github.com/joshtynjala/openfl-adobe-flex-poc

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Thu, Sep 9, 2021 at 1:19 PM Josh Tynjala <jo...@bowlerhat.dev>
wrote:

> Hey community,
>
> I just wanted to share a little demo I put together as a way of pushing
> the capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> version from 2006!) running on OpenFL in JS.
>
>
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by yushiro maeda <ro...@gmail.com>.
Hello,

Thank you very much for your detailed explanation.
I didn't know about OpenFL and I didn't understand the difference between it and Royale.

My understanding now is that Apache Royale and OpenFL are complementary and we can use both to easily run Flex4 code on the web.

OpenFL is mainly complementary to the Flash API, and Apatche Royale currently has some weaknesses in that area
https://api.openfl.org/openfl/display/index.html

It seems that people on the OpenFL side were aware of this and discussed the possibility of this experimental code early on.

https://community.openfl.org/t/flash-in-2020-and-beyond/12287

I understand that the possibility has now been experimentally proven.

This is a great thing for users like us who have a lot of Flex4 code.

Also, to the best of my knowledge, version 34.0 is the last version of Adobe FlashPlayer.
This means that we can't extend the FlashAPI any further, and to begin with, the FlashPlayer is a black box for developers!

We have always felt uneasy about this.

We have always felt uneasy about this, but with this attempt, there is a possibility that we will no longer be dependent on Adobe Flash Player.
At the same time, we can expect the possibility of upgrading the Flash API itself with implementation extensions by openFL (sounds like a dream, doesn't it?).

Incidentally, is it difficult to make openFL and Royale work together?
Also, how many volunteers would be needed to do so?
Are volunteers useless at the user level for Flex and Royale?

Please let me know if it is possible!

Thank you very much.

On 2021/09/10 17:53:19, Josh Tynjala <jo...@apache.org> wrote: 
> If someone were to take this and expand it, then yes, I suppose it could become possible to run a Flex 4 app in JS with very few changes.
> 
> What are these two doing? Well...
> 
> OpenFL is a reimplementation of the Flash API written in the Haxe programming language. Haxe can be compiled to JS. There's a version of OpenFL available that is pre-compiled to JS, so that JavaScript developers can use it. See here on NPM: https://www.npmjs.com/package/openfl
> 
> The Royale compiler is converting the AS3 source code of the Flex framework to JS. I used Flash's playerglobal.swc file with the external-library-path compiler option to trick the compiler into thinking that the Flash API was available in JS. It could also be done with OpenFL externs/typedefs written in AS3, but this was the fastest way for me to do it.
> 
> In my HTML file, I added the OpenFL JS library:
> 
> <script src="https://unpkg.com/openfl@8.9.6/dist/openfl.min.js"></script>
> 
> Then, I included this line of JS to make OpenFL look like Flash:
> 
> var flash = openfl;
> 
> There's a bit more involved in getting everything bootstrapped, and some random Flash APIs are missing from OpenFL, but that's the basic idea.
> 
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
> 
> On 2021/09/10 09:50:35, yushiro maeda <ro...@gmail.com> wrote: 
> > Hello,
> > 
> > Thank you always, it's very interesting!!
> > 
> > 
> > If what's happening here evolves after this, for example, can I automatically convert code written in Flex4 directly to javascript without having to rewrite it for Royale?
> > 
> > So is migration (Flex 4 to Royale) unnecessary?
> > 
> > I'd like you to tell me a little,
> > It seems that both Royale and OpenFL convert from AS3 to Javascript in the same way.
> > 
> > What are these two doing?
> > 
> > I would appreciate it if you could tell me.
> > 
> > thank you.
> > 
> > On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote: 
> > > Hey community,
> > > 
> > > I just wanted to share a little demo I put together as a way of pushing the
> > > capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> > > version from 2006!) running on OpenFL in JS.
> > > 
> > > https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
> > > 
> > > --
> > > Josh Tynjala
> > > Bowler Hat LLC <https://bowlerhat.dev>
> > > 
> > 
> 

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Alina Kazi <al...@gmail.com>.
OpenFL + Royale Thats sounds really good.



On Fri, 10 Sep 2021, 22:53 Josh Tynjala, <jo...@apache.org> wrote:

> If someone were to take this and expand it, then yes, I suppose it could
> become possible to run a Flex 4 app in JS with very few changes.
>
> What are these two doing? Well...
>
> OpenFL is a reimplementation of the Flash API written in the Haxe
> programming language. Haxe can be compiled to JS. There's a version of
> OpenFL available that is pre-compiled to JS, so that JavaScript developers
> can use it. See here on NPM: https://www.npmjs.com/package/openfl
>
> The Royale compiler is converting the AS3 source code of the Flex
> framework to JS. I used Flash's playerglobal.swc file with the
> external-library-path compiler option to trick the compiler into thinking
> that the Flash API was available in JS. It could also be done with OpenFL
> externs/typedefs written in AS3, but this was the fastest way for me to do
> it.
>
> In my HTML file, I added the OpenFL JS library:
>
> <script src="https://unpkg.com/openfl@8.9.6/dist/openfl.min.js"></script>
>
> Then, I included this line of JS to make OpenFL look like Flash:
>
> var flash = openfl;
>
> There's a bit more involved in getting everything bootstrapped, and some
> random Flash APIs are missing from OpenFL, but that's the basic idea.
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>
> On 2021/09/10 09:50:35, yushiro maeda <ro...@gmail.com> wrote:
> > Hello,
> >
> > Thank you always, it's very interesting!!
> >
> >
> > If what's happening here evolves after this, for example, can I
> automatically convert code written in Flex4 directly to javascript without
> having to rewrite it for Royale?
> >
> > So is migration (Flex 4 to Royale) unnecessary?
> >
> > I'd like you to tell me a little,
> > It seems that both Royale and OpenFL convert from AS3 to Javascript in
> the same way.
> >
> > What are these two doing?
> >
> > I would appreciate it if you could tell me.
> >
> > thank you.
> >
> > On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote:
> > > Hey community,
> > >
> > > I just wanted to share a little demo I put together as a way of
> pushing the
> > > capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> > > version from 2006!) running on OpenFL in JS.
> > >
> > >
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
> > >
> > > --
> > > Josh Tynjala
> > > Bowler Hat LLC <https://bowlerhat.dev>
> > >
> >
>

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Josh Tynjala <jo...@apache.org>.
If someone were to take this and expand it, then yes, I suppose it could become possible to run a Flex 4 app in JS with very few changes.

What are these two doing? Well...

OpenFL is a reimplementation of the Flash API written in the Haxe programming language. Haxe can be compiled to JS. There's a version of OpenFL available that is pre-compiled to JS, so that JavaScript developers can use it. See here on NPM: https://www.npmjs.com/package/openfl

The Royale compiler is converting the AS3 source code of the Flex framework to JS. I used Flash's playerglobal.swc file with the external-library-path compiler option to trick the compiler into thinking that the Flash API was available in JS. It could also be done with OpenFL externs/typedefs written in AS3, but this was the fastest way for me to do it.

In my HTML file, I added the OpenFL JS library:

<script src="https://unpkg.com/openfl@8.9.6/dist/openfl.min.js"></script>

Then, I included this line of JS to make OpenFL look like Flash:

var flash = openfl;

There's a bit more involved in getting everything bootstrapped, and some random Flash APIs are missing from OpenFL, but that's the basic idea.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>

On 2021/09/10 09:50:35, yushiro maeda <ro...@gmail.com> wrote: 
> Hello,
> 
> Thank you always, it's very interesting!!
> 
> 
> If what's happening here evolves after this, for example, can I automatically convert code written in Flex4 directly to javascript without having to rewrite it for Royale?
> 
> So is migration (Flex 4 to Royale) unnecessary?
> 
> I'd like you to tell me a little,
> It seems that both Royale and OpenFL convert from AS3 to Javascript in the same way.
> 
> What are these two doing?
> 
> I would appreciate it if you could tell me.
> 
> thank you.
> 
> On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote: 
> > Hey community,
> > 
> > I just wanted to share a little demo I put together as a way of pushing the
> > capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> > version from 2006!) running on OpenFL in JS.
> > 
> > https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
> > 
> > --
> > Josh Tynjala
> > Bowler Hat LLC <https://bowlerhat.dev>
> > 
> 

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by yushiro maeda <ro...@gmail.com>.
Hello,

Thank you always, it's very interesting!!


If what's happening here evolves after this, for example, can I automatically convert code written in Flex4 directly to javascript without having to rewrite it for Royale?

So is migration (Flex 4 to Royale) unnecessary?

I'd like you to tell me a little,
It seems that both Royale and OpenFL convert from AS3 to Javascript in the same way.

What are these two doing?

I would appreciate it if you could tell me.

thank you.

On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote: 
> Hey community,
> 
> I just wanted to share a little demo I put together as a way of pushing the
> capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> version from 2006!) running on OpenFL in JS.
> 
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
> 
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
> 

Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Josh Tynjala <jo...@bowlerhat.dev>.
Just a followup to mention that I ported the project to Flex 3 (since that
was the first open source MPL release by Adobe), and I put the full source
code up on Github:

https://github.com/joshtynjala/openfl-adobe-flex-poc

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Thu, Sep 9, 2021 at 1:19 PM Josh Tynjala <jo...@bowlerhat.dev>
wrote:

> Hey community,
>
> I just wanted to share a little demo I put together as a way of pushing
> the capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> version from 2006!) running on OpenFL in JS.
>
>
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>

RE: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Yishay Weiss <yi...@hotmail.com>.
Ooops, you are talking about flex 2, not as2. Sounds cool nonetheless….

From: Yishay Weiss<ma...@apache.org>
Sent: Friday, September 10, 2021 9:03 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Sounds cool. We had a porting project with a big as2 codebase a year ago. Maybe there are still some more out there...

On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote:
> Hey community,
>
> I just wanted to share a little demo I put together as a way of pushing the
> capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> version from 2006!) running on OpenFL in JS.
>
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>


Re: Using the Apache Royale compiler to run Adobe Flex 2 on OpenFL and JS?!

Posted by Yishay Weiss <yi...@apache.org>.
Sounds cool. We had a porting project with a big as2 codebase a year ago. Maybe there are still some more out there... 

On 2021/09/09 20:19:57, Josh Tynjala <jo...@bowlerhat.dev> wrote: 
> Hey community,
> 
> I just wanted to share a little demo I put together as a way of pushing the
> capabilities of the Apache Royale compiler. Adobe Flex 2 (really, the
> version from 2006!) running on OpenFL in JS.
> 
> https://joshblog.net/2021/adobe-flex-2-running-on-openfl-in-javascript-instead-of-swf/
> 
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>