Re: [Flashcoders] Flash to HTML

18 views
Skip to first unread message

David Cohn

unread,
Jun 20, 2014, 8:07:09 PM6/20/14
to flash...@chattyfig.figleaf.com
John,

Flash HTML5 Canvas publishing uses createJS. If, like me, you're using CS6 instead of doing the CC subscription route, there's a Toolkit for that as well (http://www.adobe.com/devnet/createjs.html). I'm just beginning to look at this, and additionally I have the luxury of starting with some simple content. I fear that if your content is very complex, especially time-based, that it will be at best a publish-and-tweak scenario, with the tweaking being arduous. I also wonder about performance. Check out http://www.createjs.com/#!/CreateJS for more understanding of what's going on under the hood.

That having been said, tom 's mention of haxe looks interesting. Have you done any serious graphics with it, and does it perform well? Does it use OpenGL for vector rendering? How about bitmap animation? Is there a robust actionScript exporter, or is it more of a re-implementation?

Thanks,
--Dave


On Jun 20, 2014, at 9:00 AM, flashcode...@chattyfig.figleaf.com wrote:


> The group has been quite for awhile. Anyone still here?
>
> I know things are constantly evolving, I‚m curious if anyone has found a good tool that will convert a rather complex game from Flash to HTML? I know Adobe has tools to convert timeline animations and graphics and minimal code and Google Swiffy came around when CS4 was out. I‚m looking around to see if there is any newer developments in bringing existing Flash AS3 apps to HTML. Even if it‚s not one to one, but at least gets me a good start, please through out your thoughts and/or suggestions.
>
> Much appreciated∑
>
> Thanks,
> John


> New version of Flash just came out that claims to export to HTML5 Canvas and do Actionscript to Javascript translations. Worth checking out?
>
> https://helpx.adobe.com/flash/how-to/creating-publishing-html5-canvas-document.html
>
>
> Jason Merrill

> Look at Haxe, www.haxe.org and in particular OpenFL lib (
> http://www.openfl.org/) to use with it, port your AS3 to Haxe (there are
> automated tools for this, but you'll probably still have to get your hands
> dirty) and from there you should be good with a few tweaks to compile with
> OpenFL to HTML5, iOS, Android and lots of other targets all from the same
> codebase.
>
> Seriously I've been using Haxe for years now, mostly to make programming
> server side and javascript much much easier coming from AS3. I've tapped
> prbably 5% of it's potential ;) It's awesome.



_______________________________________________
Flashcoders mailing list
Flash...@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Cédric Muller

unread,
Jun 21, 2014, 10:25:32 AM6/21/14
to Flash Coders List
Hi David,

I have been playing with a lot of HaXE, createjs, base html5 canvas and, of course, Flash these last months. Whatever you can do in AS3, you can do it with HaXE. And there are some additional benefits, but these are just developer bonuses. From what I can say, JS+HTML canvas execution performs really well under some circumstances: you need to accept the 10x assets file size you will be loading and that the overall performance can hit the CPU. And forget about the html5 canvas textfields ….. this feels like Flash 6.
I hope I can show you my latest work before the end of the week (both in AS3 and JS) so you can compare.

hth,
Cedric

David Cohn

unread,
Jun 22, 2014, 12:19:09 PM6/22/14
to flash...@chattyfig.figleaf.com

Thanks Cedric; looks like it's well worth exploring. Am I right in believing that you can compile to vanilla PHP code, without the need for any additional server installations?

Would love to see your example...
Thanks,
--Dave


On Jun 21, 2014, at 9:00 AM, flashcode...@chattyfig.figleaf.com wrote:

> Hi David,
>
> I have been playing with a lot of HaXE, createjs, base html5 canvas and, of course, Flash these last months. Whatever you can do in AS3, you can do it with HaXE. And there are some additional benefits, but these are just developer bonuses. From what I can say, JS+HTML canvas execution performs really well under some circumstances: you need to accept the 10x assets file size you will be loading and that the overall performance can hit the CPU. And forget about the html5 canvas textfields ….. this feels like Flash 6.
> I hope I can show you my latest work before the end of the week (both in AS3 and JS) so you can compare.
>
> hth,
> Cedric


tom rhodes

unread,
Jun 23, 2014, 4:58:08 AM6/23/14
to Flash Coders List
@erick: You can use externs for all the native functionality. Same goes for
using existing C++ or Java libs.


On 23 June 2014 10:53, tom rhodes <tom.r...@gmail.com> wrote:

> @David:
>
> You can render HTML5 in openGL with Haxe/OpenFL. OpenGL is default on all
> teh native targets, the html5 target is still not 100% there, but there's a
> new backend for it which has improved things massively. Bitmap animation is
> no problem, either using OpenFL or the createJS extensions if you just want
> to ttarget JS.
>
> You can compile your Haxe code to AS3, not just to a swf if you want.
> Coming from AS3 their are tools to convert your AS3 to Haxe, in general
> these are good, but don't expect to port a massive codebase over withtou
> getting your hands dirty.
>
> Yes you can compile to PHP for your server side work, or nodeJS, Neko,
> C++, C#, Java and there's a Python target too now :)
>
> This is my favourite thing abotu Haxe, writing for server and client in
> the same language. You can communicate via remoting, sockets, whatever, and
> you use the EXACT SAME classes at either end. Not 2 diff represetations, or
> a 3rd protocol just to communicate. You can also easily move logic from
> client to server and back depending on where it fits best etc. It's awesome
> :)
>
> @Cedric:
>
> Nice to see you on board the Haxe train! Not seen you in the mailing list?

tom rhodes

unread,
Jun 23, 2014, 4:58:08 AM6/23/14
to Flash Coders List
@David:

You can render HTML5 in openGL with Haxe/OpenFL. OpenGL is default on all
teh native targets, the html5 target is still not 100% there, but there's a
new backend for it which has improved things massively. Bitmap animation is
no problem, either using OpenFL or the createJS extensions if you just want
to ttarget JS.

You can compile your Haxe code to AS3, not just to a swf if you want.
Coming from AS3 their are tools to convert your AS3 to Haxe, in general
these are good, but don't expect to port a massive codebase over withtou
getting your hands dirty.

Yes you can compile to PHP for your server side work, or nodeJS, Neko, C++,
C#, Java and there's a Python target too now :)

This is my favourite thing abotu Haxe, writing for server and client in the
same language. You can communicate via remoting, sockets, whatever, and you
use the EXACT SAME classes at either end. Not 2 diff represetations, or a
3rd protocol just to communicate. You can also easily move logic from
client to server and back depending on where it fits best etc. It's awesome
:)

@Cedric:

Nice to see you on board the Haxe train! Not seen you in the mailing list?


On 22 June 2014 18:15, David Cohn <da...@eyebright.com> wrote:

>

David Cohn

unread,
Jun 23, 2014, 12:40:14 PM6/23/14
to flash...@chattyfig.figleaf.com
Cedric,
I've been here since the get-go... in digest mode, so most questions are answered by the time I get them ;-)
Thanks-- time to delve into Haxe-- I'm excited!
--Dave

> Nice to see you on board the Haxe train! Not seen you in the mailing list?


John McCormack

unread,
Jun 23, 2014, 2:43:24 PM6/23/14
to Flash Coders List
On 23/06/2014 17:29, David Cohn wrote:
> Cedric,
> I've been here since the get-go... in digest mode, so most questions are answered by the time I get them ;-)
> Thanks-- time to delve into Haxe-- I'm excited!
> --Dave
>

I don't know how good it is but FDT have been involved with Haxe for a long time...
http://fdt.powerflasher.com/w/index.php?title=Special:Search&ns0=1&redirs=0&search=haxe&limit=500&offset=0

John

David Cohn

unread,
Jul 31, 2014, 6:06:12 PM7/31/14
to flash...@chattyfig.figleaf.com
@Cedric,

Finally got a chance to play around a bit with Haxe-- really looks promising!

I'm wondering how you approach combining HTML with the more complex Flash-style content-- do you compile your Haxe files and then add the appropriate div's etc into a separate HTML file? I.e. it looks like Haxe is best used to "embed" (<canvas>) content, rather than for full page display?

If this is so, have you played around with multiple canvases on a single page?

...and thanks for lead! I'm looking forward to investigating further...
--Dave



On Jun 23, 2014, at 9:00 AM, flashcode...@chattyfig.figleaf.com wrote:

> @David:
>
> You can render HTML5 in openGL with Haxe/OpenFL. OpenGL is default on all
> teh native targets, the html5 target is still not 100% there, but there's a
> new backend for it which has improved things massively. Bitmap animation is
> no problem, either using OpenFL or the createJS extensions if you just want
> to ttarget JS.
>
> You can compile your Haxe code to AS3, not just to a swf if you want.
> Coming from AS3 their are tools to convert your AS3 to Haxe, in general
> these are good, but don't expect to port a massive codebase over withtou
> getting your hands dirty.
>
> Yes you can compile to PHP for your server side work, or nodeJS, Neko, C++,
> C#, Java and there's a Python target too now :)
>
> This is my favourite thing abotu Haxe, writing for server and client in the
> same language. You can communicate via remoting, sockets, whatever, and you
> use the EXACT SAME classes at either end. Not 2 diff represetations, or a
> 3rd protocol just to communicate. You can also easily move logic from
> client to server and back depending on where it fits best etc. It's awesome
> :)
>
> @Cedric:
>
> Nice to see you on board the Haxe train! Not seen you in the mailing list?


David Cohn

unread,
Aug 7, 2014, 7:49:52 PM8/7/14
to flash...@chattyfig.figleaf.com
Hey all,

I've been looking a bit at CreateJS and Haxe/OpenFL, and since the question was asked a while ago, and the list is rather slow, I thought I'd share some further thoughts...

I've decided to go with CreateJS for now. I was very excited about Haxe, especially from the point of view of one source for multiple platforms, but for heavily interactive Flash-style projects it just doesn't seem to be quite there yet. I'd love to be proven wrong(!), but here are the shortcomings that I've found in my brief look:

1. Sprite/Bitmap detection -- it looks like mouse detection is on the bounding box, so e.g. rollovers on arbitrarily shaped bitmaps is impossible. (Well, you may be able to use hitTestPoint and some fancy gyrations, but... eeech.)

2. Filter support -- seems weak and limited; e.g. GlowFilter isn't available for the HTML5 target.

3. Ease of developing -- relatively minor, and single-source across targets would easily outweigh this. But with Haxe, firstly you have an extra step (the build). Then, Haxe seems somewhat monolithic: it's good for handling the core interactive <canvas> area, but the HTML has to live in a separate file: Haxe rebuilds the HTML file each time and there doesn't seem to be a good way to preserve custom HTML in the same file between builds. Again, not a show-stopper, but I find workflow quicker without the build, and editing the HTML/JS directly.

CreateJS seems to work well across all browsers I've tested on so far (with, of course, the exception of IE8)... as did Haxe.

There may be retorts for all these criticisms, since I've only looked "so far"... please feel free to contradict me!

Thanks,
--Dave



On Jun 24, 2014, at 9:00 AM, flashcode...@chattyfig.figleaf.com wrote:

> On 23/06/2014 17:29, David Cohn wrote:
>> Cedric,
>> I've been here since the get-go... in digest mode, so most questions are answered by the time I get them ;-)
>> Thanks-- time to delve into Haxe-- I'm excited!
>> --Dave
>>
>
> I don't know how good it is but FDT have been involved with Haxe for a long time...
> http://fdt.powerflasher.com/w/index.php?title=Special:Search&ns0=1&redirs=0&search=haxe&limit=500&offset=0
>
> John
>


Cor van Dooren

unread,
Aug 8, 2014, 1:50:43 AM8/8/14
to Flash Coders List
I did not follow the entire treat, but maybe you want to look at GSAP from
www.greensock.com

HTH
Cor
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4716 / Virus Database: 3986/7999 - Release Date: 08/07/14

Cédric Muller

unread,
Aug 8, 2014, 10:43:23 AM8/8/14
to Flash Coders List
I second the GSAP proposal, and regarding point 3) I never had Haxe rebuild my HTML file, so I am wondering how this happened.

Since I told you I would show my tests with HTML5 vs Flash, here they are:

FLASH
<http://www.benga.li/mcd/versailles/banner_de_chili_1600x490.html>
HTML
<http://www.benga.li/mcd/versailles/html5/royal.html>

The only remaining Flash advantage lies on the size of the overall production. This was done using Haxe (for HTML5) and Haxe/Flash for Flash part.

David Cohn

unread,
Aug 8, 2014, 1:18:56 PM8/8/14
to flash...@chattyfig.figleaf.com

Hmmm... that's very strange re: the HTML file-- but it's definitely getting rebuilt during the build process. Are you modifying the index.html file in the Export/html5/bin directory? Anyway, as I said, this is the least important gripe...

I'll take a further look at greensock-- it look especially good for complex animation, whereas I often do complex interactions. It doesn't seem as much directed towards mouse/touch detection/dragging for canvas elements (although it looks like tweaking Draggable may allow that)...

Thanks,
--Dave


On Aug 8, 2014, at 9:00 AM, flashcode...@chattyfig.figleaf.com wrote:

> I second the GSAP proposal, and regarding point 3) I never had Haxe rebuild my HTML file, so I am wondering how this happened.
>
> Since I told you I would show my tests with HTML5 vs Flash, here they are:
>
> FLASH
> <http://www.benga.li/mcd/versailles/banner_de_chili_1600x490.html>
> HTML
> <http://www.benga.li/mcd/versailles/html5/royal.html>
>
> The only remaining Flash advantage lies on the size of the overall production. This was done using Haxe (for HTML5) and Haxe/Flash for Flash part.


Ted Lehr

unread,
Aug 11, 2014, 11:01:38 AM8/11/14
to Flash Coders List
So it seems Flash by default does not allow a movie to get data (say xml) from another server. So if I have a movie on http://www.thissite.com/movie.swf and in that movie I have:

var xmlLoader:URLRequest = new URLRequest("http://www.thissite.com/data.xml");

Is there anyway around this?

T

Ross P. Sclafani

unread,
Aug 11, 2014, 11:07:48 AM8/11/14
to Flash Coders List
google crossdomain.xml

Mike Starr

unread,
Aug 11, 2014, 5:44:37 PM8/11/14
to Flash Coders List
enforce coerce
(null)"var xmlLoader:URLRequest = new URLRequest("
http://www.thissite.com/data.xml");

Karl DeSaulniers

unread,
Aug 11, 2014, 8:56:26 PM8/11/14
to Flash Coders List
Edit the swf to look for a relative path to find its XML.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com

Ted Lehr

unread,
Aug 15, 2014, 2:29:29 PM8/15/14
to Flash Coders List
How can I create a variable in a dynamic object?

For example, if I had a movie clip in the library, I could open it up and on the first frame I could give it:

var velocityX:Number = Math.random()*10-10;

I could then refer to mc.velocityX;

How can I create that variable on an object create in actionscript?

Ted Lehr

unread,
Aug 15, 2014, 2:51:08 PM8/15/14
to Flash Coders List
ugh.... never mind... sorry....

Kerry Thompson

unread,
Aug 15, 2014, 3:34:20 PM8/15/14
to Flash Coders List
It's not that difficult if you do it right.

First, I'm not a fan of timeline code except for defining sections, such as
stop on a keyframe, and minor control commands like gotoAndStop and
gotoAndPlay. The rest I like to do in an external ActionScript file.

I haven't used the Flash IDE in 3-4 years--I use Flex and FlashBuilder
almost exclusively now--but let's see what I can remember.

First, when you create the movie clip, click "Export for ActionScript".
Let's say your mc is called movingSprite. It will have a class name of
movingSprite. You can change that if you want.

If you already have the mc in the library, right-click and choose
properties. That will bring up the same dialog--check Export for
ActionScript.

In the Properties tab (often called the Property Inspector), declare a
document class. That just means the class that will run when you launch the
movie. Let's call it myDocClass.

Now create the document class. Choose File -> New... and choose
ActionScript Class. Name it myDocClass, and Flash will create a new
actionScript class file. Create another class file and name it
movingSprite.as.

Now you can create an instance of the movie clip and assign it variables. I
wouldn't do that in the document class, though. I would declare them in the
class file.

Cordially,

Kerry Thompson

John R. Sweeney Jr.

unread,
Aug 26, 2014, 12:47:23 AM8/26/14
to Flash Coders List
Howdy all,

Well my client wants to pull 20 latest feeds from their Twitter, Instagram and Pinterest. I’ve already found out that Twitter stopped supporting RSS feeds and retired the REST api v1 and now have the Twitter API v1.1 that is JSON only. Does anyone access Twitter feeds some other way. Twitter says that RSS is out and I haven’t worked with JSON before.

Also, I’m trying find out about how to access Pinterest and Instagram to just get the number of followers of four specific users. I really can’t find any meaningful help out their in relationship with Flash/AS3.

Has anyone done either of these or know of a direction you can point me in to get some guidance?

Thanks in advance for any help,
John

John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169

Karl DeSaulniers

unread,
Aug 26, 2014, 2:00:37 AM8/26/14
to Flash Coders List
Hi John,
Well, googling "twitter api for flash as3" yielded some good results for me.
There was this link that looks promising.
https://blog.twitter.com/2006/twitter-api-flash-developers

Also found this package example.
http://www.untoldentertainment.com/blog/2009/04/02/tutorial-pull-twitter-updates-into-flash/

don't know if its what your wanting, but found it with google search terms: pull twitter feeds with flash as3

There is this too.
http://www.fladev.com/featured/how-to-build-a-flash-actionscript-3-0-twitter-widget/

Hope one of these does the trick. Good luck!

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



John R. Sweeney Jr.

unread,
Aug 26, 2014, 2:53:49 AM8/26/14
to Flash Coders List
Hi Karl,

Thank you for your links, but unfortunately, I saw all of these and they are dated 2009, 2010 and/or 2012 and use the API v1. That API was retired in May of 2013.

I found this from the Twitter Developers pages:

"We've chosen to throw our support behind the JSON format shared across the platform. Consequently, we’ve decided to discontinue support for XML, Atom, and RSS.”

And all the examples I’m finding are older and whether its direct calls from Flash or PHP, if they are calling to .rss or .xml and through the API v1, the pages don’t exist or links are broken, etc.

Very frustrating and that’s just Twitter Having less luck with Pinterest and Instagram.

Thanks again though for the suggestions,
John

John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169




On Aug 26, 2014, at 12:58 AM, Karl DeSaulniers <ka...@designdrumm.com> wrote:

> Hi John,
> Well, googling "twitter api for flash as3" yielded some good results for me.
> There was this link that looks promising.
> https://blog.twitter.com/2006/twitter-api-flash-developers
>
> Also found this package example.
> http://www.untoldentertainment.com/blog/2009/04/02/tutorial-pull-twitter-updates-into-flash/
>
> don't know if its what your wanting, but found it with google search terms: pull twitter feeds with flash as3
>
> There is this too.
> http://www.fladev.com/featured/how-to-build-a-flash-actionscript-3-0-twitter-widget/
>
> Hope one of these does the trick. Good luck!
>
> Best,


Karl DeSaulniers

unread,
Aug 26, 2014, 3:26:14 AM8/26/14
to Flash Coders List
Ah ok. I see. In that case, here you go. Next best thing.

http://snipplr.com/view/56283/as3-load-and-access-json-data-example/

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



Karl DeSaulniers

unread,
Aug 26, 2014, 3:28:10 AM8/26/14
to Flash Coders List
Sorry, I'm not more help. If I didn't have to get this project out by the morning I would.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



John R. Sweeney Jr.

unread,
Aug 26, 2014, 4:17:37 AM8/26/14
to Flash Coders List
Its cool that we both keep looking at the same links. Started reading that one, when I found out the JSON requirement. The other two are really making me scratch my head.

Thanks and good luck on your project,


John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169




On Aug 26, 2014, at 2:23 AM, Karl DeSaulniers <ka...@designdrumm.com> wrote:

> Ah ok. I see. In that case, here you go. Next best thing.
>
> http://snipplr.com/view/56283/as3-load-and-access-json-data-example/
>
> Best,

John R. Sweeney Jr.

unread,
Aug 26, 2014, 6:02:01 PM8/26/14
to Flash Coders List
Hi,

So one else has any experience with Pinterest or Instagram?

Thanks,
John

John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169


James Merrill

unread,
Aug 27, 2014, 1:40:24 PM8/27/14
to Flash Coders List
Instagram uses JSON formatting for their API too. Depending on the data you
want to retrieve, you may need to use OAuth. Fortunately they make it
pretty easy.

Have you considered using PHP to fetch the data you need, and then convert
it from JSON to XML? It may be easier to deal with.

http://stackoverflow.com/questions/856833/is-there-some-way-to-convert-json-to-xml-in-php
--
James Merrill
toThePixel.com <http://www.toThePixel.com>

Peter Ginneberge

unread,
Aug 27, 2014, 4:05:30 PM8/27/14
to Flash Coders List
> Have you considered using PHP to fetch the data you need, and then convert
> it from JSON to XML? It may be easier to deal with.

Not really, JSON support is built into the Flash player, so can you convert
from JSON to AS and back.

var data:Object = JSON.parse(jsonData);

where jsonData is a JSON formatted string.

regards,
Peter

John R. Sweeney Jr.

unread,
Aug 27, 2014, 4:18:21 PM8/27/14
to Flash Coders List
I’m sorry I didn’t state my need better. I know that is what I’ll have to do with Twitter, but I’m not find how to access Pinterest and Instagram to pull the followers of a specific person on each site.

I really appreciate your comments…

Thanks,


John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169




On Aug 27, 2014, at 3:01 PM, Peter Ginneberge <p.ginn...@telenet.be> wrote:

> where jsonData is a JSON formatted string.
>
> regards,
> Peter

Peter Ginneberge

unread,
Aug 27, 2014, 5:17:53 PM8/27/14
to Flash Coders List
Both have API's, so should be documented how to get the data you're after.

http://instagram.com/developer/
https://developers.pinterest.com/

John R. Sweeney Jr.

unread,
Aug 27, 2014, 7:44:27 PM8/27/14
to Flash Coders List
I will look into both and thank you so much.

Have a good evening,
John

John R. Sweeney Jr.
Senior Interactive Multimedia Developer
OnDemand Interactive Inc
Hoffman Estates, IL 60169




On Aug 27, 2014, at 4:14 PM, Peter Ginneberge <p.ginn...@telenet.be> wrote:

> Both have API's, so should be documented how to get the data you're after.
>
> http://instagram.com/developer/
> https://developers.pinterest.com/


Reply all
Reply to author
Forward
0 new messages