publishing a flash project in html, fullscreen code preventing animation - html

Hello I'm making a flash interactive CD and my clients needs a mac, pc and linux version, for linux he asked me to make a html with the flash inside. PC and mac are running perfectly however when I export into the html my flash timeline gets stuck at frame1 and the little animation I made to zoom to the main screen is not loading.
After some testing I realized that my very first code line is somehow doing this:
import flash.display.StageScaleMode;
stage.scaleMode =StageScaleMode.SHOW_ALL;
stage.displayState = StageDisplayState.FULL_SCREEN;
This is the code I use to force fullscreen in mac and pc but it makes the html one stuck on frame 1, if I delete that code the html version runs fine, what is it?
Working on Flash cs6, as3, for flash player 9 (tried up to 11.2 and not working either)
thanks

Your animation probably doesn't work because there is an error while executing in browser.
The security restriction for StageDisplayState.FULL_SCREEN in flash player is different from the AIR desktop application.
In Flash Player, full-screen mode can only be initiated through ActionScript in response to a mouse click (including right-click) or keypress. AIR content running in the application security sandbox does not require that full-screen mode be entered in response to a user gesture.
Adobe documentation
Also check if you use the tag in HTML while embedding. That is allowing web content to become fullscreen.
<param name="allowFullScreen" value="true" />

Related

Can flash website work without flashplayer?

I just create an interactive flash website and it doesnt work without flash player. Is there a code to make my website work well on any browser and without flashplayer?
Thanks :)
Bad news, if you want to run flash animation in a web page, the browser should have FlashPlayer installed and enabled.
But if it's not in a webpage, you have the possibility to convert your Flash animation in an application with Adobe AIR for desktop and mobile.
http://www.adobe.com/products/air.html
With the last Flash IDE (Animate CC), you can export your Flash animation in HTML5, to be compatible with a browser that not have Flash Player. But not support all Flash functionalities.
https://helpx.adobe.com/animate/using/creating-publishing-html5-canvas-document.html

Flash sound mixer stop all works on swf but not on html server version

This is a very strange bug! im using AS3 and CS5.
So i have a youtube video which plays on one frame, and on every other frame i have:
import flash.media.SoundMixer;
flash.media.SoundMixer.stopAll();
Which stops the video playing when you move to another page, this works fine when running it in flash, but when i publish it to a HTML file and upload it to my server it just never works! the sounds always play!
Is this to do with my publish settings or a strange flash bug?
Thanks,
Adam
When your SWF runs in the browser, it's subject to all the security restrictions that the browser imposes, as well as some additional Flash Player security restrictions. I imagine, that you're running into one of these restrictions.
Instead of trying to stop all sounds from playing, why don't you stop the Youtube player itself? It has an API you can use to do this, using either the pauseVideo() or stopVideo() methods.

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.

SWFObject embedded Flash fullscreen doesn't work on PC

I created a fullscreen flash app on
http://dominggus.nl/school/afstuderen/expo/
I used the SWFObject generator to create the embedding code.
Furthermore, I need to put the screen.width/screen.height (with JavaScript) as flashVars to the SWF...
This all works perfectly on MAC on Chrome/FF but, on windows it only works in IE...chrome and Firefox refuse to go fullscreen...
how can that be?
edit: I already tried static/dynamic publishing with SWFObject, same results
(see http://dominggus.nl/school/afstuderen/expo/index2.html for dynamic)
Ah looks like you're running into a flash run-time error but not seeing it in Chrome or FF cause of no Debug player installed, this is easy for FF just install the netscape compatible debug player to see the error (for Chrome the install is more complicated, due to it managing Flash player updates internally).
In FF I get this error:
SecurityError: Error #2152: Full screen mode is not allowed.
at flash.display::Stage/set displayState()
at nl.dominggus.infographic.ui::NoFullScreenPage/startButtonClickHandler()[/Users/dominggus/Documents/dpdk/eclipse_workspace/cmd_afstuderen_infographic/src/as/nl/dominggus/infographic/ui/NoFullScreenPage.as:54]
I believe this means the allowFullscreen parameter for the plugin isn't being set correctly.
Verify Flash player version here (bottom of page shows debug Yes/No):
http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html
Get the appropriate Debug player for a given platform:
http://www.adobe.com/support/flashplayer/downloads.html
Edit pasted from the docs
FULL_SCREEN_INTERACTIVE Constant
public static const FULL_SCREEN_INTERACTIVE:String = "fullScreenInteractive"
Language Version: ActionScript 3.0
Runtime Versions: Flash Player 11.3, AIR 1.0, Flash Lite 4

How to continue a SWF rendering whilst off screen?

I need to be able to continue rendering a SWF file whilst it is off screen or minimized. Taken from the adobe website: "This is an automatic feature in Flash Player since version 10.1. Flash Player minimizes processing when SWF content goes off-screen."
I have extensively searched around for a solution on this. One solution suggested was to use the HTML parameter "hasPriority" and set it to true which will ensure some things are not paused. SWF content will stop rendering regardless of this when off screen or hidden.
Does anyone know if it is possible to disable this automatic feature so my SWF will continue to render off screen?
Thanks in advance for any help.
The flash virtual machine is specifically designed so that, while viewing flash in the browser, the VM is paused when the instance of the player loses window focus. This is necessary functionality in order to... well.. keep flash from utterly destroying your computer, forcing it catch ablaze and send it to the computer underworld. Just imagine what would happen if you had 3-4 flash sites open and rendering off screen on your tablet. It would die a horrible death. You cannot override this functionality.