How to continue a SWF rendering whilst off screen? - actionscript-3

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.

Related

How to stop Google Chrome from thinking my flash is an Ad?

So,
A few days ago, Google Chrome started to block Flash advertisement from auto-playing, by default.
The problem is that I'm using videojs media player to play an HLS live stream on my page.
And, since Chrome does not support HLS protocol natively, the player falls back to a small Flash file to play the video.
But Chrome thinks this Flash file is an AD - thus not allowing it to auto-play as it should.
Is there any way to tell Chrome that this file is actually an important part of my page, and not an AD?
Add an empty Flash file larger than 398x298 to the bottom of your page. I found once you have at least one Flash file above their minimum Chrome will not pause any of your Flash. You cannot hide this extra Flash file with CSS. Optionally use a javascript timeout (3 seconds) to hide the empty Flash file in case it messes with your page layout. I'm using swfObject for embedding.
I am dealing with the same issue, but I think the size of the video and location on the page are factors. Try making the video player bigger. When I went up to 410x308 the problem went away.

Flash Player behaviour when lost focus

I've got a real problem with FlashPlayer. What I need is to have it working on full speed when it is in the THROTTLE mode - that means when FlashPlayer loose its focus and decrease framerate to about 4fps. This is commonly know as a feature for mobile phones or when you change a tab in your browser and your .swf movie doesn't run with full speed anymore.
I need this full speed because we run tests with flash swfs on virtual servers, and unfortunatelly tests run very long.
I found that in FP11.2 was ThrottleEvent introduced that inform you what Flash Player is doing. It can go to PAUSE, THROTTLE, or RESUME state. Unfortunatelly it seems that I can't force other stage.frameRate when it really goes into any of these states. I tried also with Event.DEACTIVATE, and Event.ACTIVATE without any results.
Can I go around this any way? Or if not, what version of FlashPlayer was the latest before Adobe incorporated this feature into FP?
Thanks for any response!
Kindest Pawel
you should try
stage.addEventListener(ThrottleEvent.THROTTLE, doStuff)

How can i detect hardware accleration problems in flash?

When I used full screen in as3, application opens full screen, but it completely blank. At other computers all works fine. I searched hard and found that sometimes hardware acceleration could provoke this. I turned off hardware acceleration manually (by right-click menu on flash app > settings), and app started work in full screen correctly.
How could I detect, if client have hardware acceleration turned on, and application shows him white screen? If any possibilities to fight with this problem other way?
For video hardware acceleration you should use the VideoStage class. So if you can get an instance of the StageVideo class then hardware acceleration is available. How to get this instance described here.

Stage3D causes fullscreen (Stage)Video to lag/jitter

I'm having some serious problems with flash at the moment. I have a swf loaded that uses Stage3D, displaying 3D content. When I overlay a video player, on full screen size, it will cause massive lag/jitter in the video content. The video content is loaded locally so there is no streaming to take into account. This only happens on some machines but considering the project this cannot be neglected.
I have since recoded my project to remove any form of loading i was doing with a Loader and just directly put the file path into the netstream and have then attached the netstream to StageVideo. But the problem still persists and I am at my wits end. I even set Stage3D to invisible during video playback.
It's a complete horror to debug because it's simply not a problem on my machine, but out of 10 people 4 of them have reported this problem and we can't release our product like this.
Any help to resolve this would be greatly valued and appreciated.
Regards,
Kevin
Well as StageVideo is using GPU like Stage3D does. So I guess those two stages are interrupting each other processing on GPU (especially on older video cards).
So my answer is to try to stop that video while you are working on Stage3D.

AS3: How to get fullscreen and keyboard input?

Since flash doesn't allow keyboard input while in fullscreen mode I'm wondering if there is a workaround to that?
I have a flash that is going to run fullscreen in a browser and needs different kinds of keyboard input. I have read something about AIR, but I don't fully understand it and would like another way if thats even possible.
Anybody knows?
public function setFullScreen():void
{
this.width = Capabilities.screenResolutionX;
this.height = Capabilities.screenResolutionY;
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
Use the FULL_SCREEN_INTERACTIVE
This is now possible in Flash Player 11.3+
Simply compile your application to support a minimum version of 11.3.0 and it will work if you use:
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
in your html you must put:
<param name="allowFullScreenInteractive" value="true" />
you will see a prompt when you enter full screen:
you can see an example on this official adobe blog:
http://www.leebrimelow.com/wp-content/uploads/2012/04/overlay.gif
It is not possible to get input key with fullscreen mode within the browser.
Air is only for desktop application so if your application have to work into the browser no Air for you.
If you have to get input into fullscreen mode you can try to make a virtual keyboard (an example) and user will use the mouse to press the keyboard key.
It actually is possible in Flash 10, but only for a few keys. See this page:
Understanding the security changes in Flash Player 10
Flash Player 9 does not allow keyboard
input when displaying content in
full-screen mode. Flash Player 10
changes this, allowing for a limited
number of keys to be usable in
full-screen mode. These include Tab,
the Spacebar, and the (up, down, left,
right) arrow keys.
Another option is to just use the browser's built-in fullscreen capability. All major browsers offer it as far as I know (IE, Firefox, Chrome, etc). Usually it's under View->Fullscreen, hotkey F11. Depending on the browser it will either give you the entire screen, or maybe leave a small bar across the top/bottom. Then you simply need to make your flash application expand to fill the entire HTML page.
Patrick is right. Due to security risks, your going to have a tough time getting your goal met. Adobe AIR is your best solution and will be easy to achieve in your state.
Here is a great video to get your started from Lee Brimelow. http://theflashblog.com/?p=403 (Building AIR Applications in Flash CS3)
Since AIR applications are built right in Flash or Flex, all you will need to do is configure how your application compiles, and you have yourself a Adobe AIR application capable of utilizing the keyboard while running as a cross platform desktop application.
Ahh, AIR is not for browsers? Too bad. Seems like I won't be able to get everything I wish for :p I have functions for the most important things without the keyboard functions, but I would really like them all of course.
I'll look into Silverlight then and see if thats an option.
Thanks guys! :)