How does Shumway convert Flash to HTML5? - html

Mozilla's Shumway project appears to play SWFs without requiring a Flash player to be installed:
Shumway is an HTML5 technology experiment that explores building a
faithful and efficient renderer for the SWF file format without native
code assistance.
I'm looking at the source of their racing demo and can only see a link to a SWF and no JS.
How are they displaying this SWF without any Flash plugin being used?

Shumway loads, parses and executes SWF with JS, and uses HTML5 <canvas> to render it.
You can see a bit better what's going on behind the scenes when you open the SWF in the Shumway Inspector. Direct link for the racing game: http://www.areweflashyet.com/shumway/examples/inspector/inspector.html?rfile=../racing/race.swf

Related

Flash to HTML5 Loss of interactivity

I have Some sample fla Content which I am not able to convert into HTML5 with interactions
What I tried is
Google Swiffy --> Gives interactions [not full] but no sound. Issue is it works for content less than 1 MB
Toolkit for CreateJs --> Initially I got jsx errors but I cleared them by removing Special Characters in element names. But non of the case I got interactivity [Means I was not able to use my Mouse events or clicks
HTML5 Canvas in Flash Pro CC --> even here I got same above result.
Did I am missing something ??
You didn't really miss anything. Flash's HTML conversions do not convert AS3 to JS (that would be nice if it did). In this case you have to write the interaction using JS.
Sounds like you're using Google's online SWF-to-Swiffy converter, which has a 1MB limit. There's a better way, if you have Flash Pro CS5 or CS6 and the original FLA files. Try this:
download Google's swiffy generator and instal it in your Flash Pro (read instructions carefully)
open your FLAs and find the sounds that don't play in the swiffy file - most likely they are set as streaming sound (streaming audio is not supported by Swiffy), so change them to event sound
BUT, looped event sounds exported to Swiffy only play once (they don't loop), so if you need them, export the sound from the FLA (as .wav), and copy and paste it as many times as necessary in a new .wav file and re-import
All done? Now export from Flash Pro using Command -> Export as HTML5 (swiffy)
NB: Google's Swiffy extension for Flash Pro won't work with Creative Cloud, and on mobiles there'll be NO AUDIO whatever you do - sound only seems to work on desktop PCs, owing to mobile restrictions on unsolicited big-file preloads.

Insert html video player in As2 page

I have a online courses with a lot of videos. These videos are in Vimeo for the app of this courses but I use flv loaded to the server in my flash version and the administrator wants to get off these flv.
Cause I don't know a bit of AS3, i can't use the vimeo api. So:
How can I display a webpage (where an html player will be running the video) in my swf? Like some kind of web object. The result, must be the video page inserted in the swf area
Please, be specific in your answer, my knowledge of coding is poor.
Thanks a lot! :)
The best way to approach this would be to setup an ExternalInterface in the Flash course that will communicate with the page. From there, Flash can call a method that is responsible for rendering an iframe embed of the Vimeo player. You'll probably have to pass both the video_id and the location where the video should be displayed (x/y in the event that it changes).
Once you have the javascript setup to render the iframe embed where you need it, you can interact with the player via the Javascript API (https://developer.vimeo.com/player/js-api). The player would essentially be rendered above the Flash (kind of like a lightbox), but will allow the control that you need.
You can also setup whatever playback controls that you need to pass from Flash to Javascript, and eventually to the iframe via the API.
Please let me know if you need any more clarification on how this can be setup.

Getting trouble with publishing in HTML5 through Flash & actionsript 3.0

Hi there...
I am having a query about how to publish in HTML5 format through flash.
I have a .fla file containg animation and Actionscript 3.0, when i publish it to HTML, it ask to download flash player in browser. But it is not necessary to have flash player in the browser while loading the .html file. So plaease guide me for the issue.
Thanks in Advance..
You're misunderstanding what the menu means by publish to HTML. This is simply publishing a SWF file and a corresponding HTML file that has HTML code to embed the SWF. This is not a cross compilation option. Those exist but that's not what you get in Flash CS5 by default.
If you're interested in Cross Compilation from AS3 to HTML/JS you can check out Randori and also projects like FalconJS:
http://blogs.adobe.com/bparadie/2011/11/19/what-is-falconjs/
I saw a talk about both of these recently in Chicago by some of the developers. They both seem like promising concepts (basically dodging the flash player).
The other option if you're trying to develop for mobile deployment is to package your code as an air installer. This will run your code on top of the AIR runtime (which has support on tons of devices, iOS, Android, Blackberry etc.), but this is not an in the browser experience, but rather a download the app type deal.
From what I got from the two developers (one from Apache Flex, one the creator of Randori) neither wanted to put too much trust into Adobe's platform given it's no longer supported on most mobile devices.
As an aside Adobe also has a product called Edge that allows you to do animation with a similar tool-set to what you get in Flash and exports HTML/JS/CSS. If you're not interested in AS3 or object oriented programming or type-safe languages cross compiling might not be the best option. I've personally been playing with AngularJS lately and been liking it due to the parallels with Flex, but there's a lot of great scripts/libraries/frameworks out there, if you explain a bit more of what you're trying to accomplish I can give more directed guidance.

Is there any way to render HTML in ActionScript3 - FlashPlayer SWF?

I already know about StageWebView and HTMLLoader, but that only works in Adobe AIR. Is there any way (maybe third party) to do the same in a SWF.
Reason:
I'm building a game in AS3 that will run on mobile devices with Adobe AIR, and there is also a web version that will run as a SWF.
The game has some links, URLs that open in a StageWebView for mobile. My problem is that the SWF has to open these URLs in a browser popup or i-frame... I don't like it :(
What you're trying to accomplish isn't possible in a SWF. However, on the web you will have access to javascript and HTML, and with that, you could replicate the functionality with an iframe that sits directly over your SWF.

How do I add playback controls to a SWF file embeded in HTML?

What am I missing here because my video doesn't have any controls? Is there a special parameter I need or do I need to encode the SWF file in a special way? I just used a MPEG to SWF converter provided by Blaze Media Pro.
Wow. I was thinking this was much easier than it is. In order to get playback controls, you needs to either use some boilerplate Flash code to wrap your Flash movie or you need to script it out in ActionScript. Basially, there is no toggle or anything to just turn controls on for a SWF movie. You'll want to look into some sort of the Flash editor/IDE to build controls into a .fla file.
Try FlowPlayer.
Flowplayer is an Open Source video player for your website.
For site owners, developers, hobbyists, businesses and programmers.