AIR application crashes when changing stage displayState to fullscreen - actionscript-3

A problem started cropping up in my game that hasn't happened before. I have a fullscreen toggle button, and when I press it my game attempts to go into fullscreen but the entire app closes after a few seconds of freezing. No errors are traced when the game closes. I can resize the game just fine (for example the maximize button works as intended), it's just fullscreen that freezes.
I tested the code as shown below:
trace("Before fullscreen");
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
trace("After fullscreen");
Only "Before fullscreen" is traced out, meaning the displayState change freezes the program. Changing the state to NORMAL does not freeze the program, but both FULL_SCREEN and FULL_SCREEN_INTERACTIVE do. The only other information I could find was someone else having the same problem and discovering graphics card problems, but I haven't done anything to change my graphics settings/drivers so I'm not sure if that's the actual problem here.

Related

AS3 NetStream lags on first frame

I'm developing an application in Adobe Air to display videos for a museum exhibit at a resolution of 2560x1440. The application works without a hitch on my machine, but when I run it on another (less powerful) computer, it does not function as intended. I've texted the application on two machines besides my own.
The problem is when one of the videos is called up, the video is called up and displays the first frame of the video and lags there for a good number of seconds (5-10), however I can still hear audio. After about 8-10 seconds, the video plays back as if it had been playing before and stutters briefly (1-2 seconds) before resuming playback normally. This is consistent behavior every time a video is launched as long as it's a fairly large video (> 50 MB as far as I can tell).
This does not happen on my development machine, which has a GTX 980 graphics card in it, but besides that and the motherboard, I can't think of any differences between the specs of the multiple machines.
The video throws an event indicating the buffer is full immediately as a video is launched, so buffering doesn't seem to be the issue.
Edit: Code (Pastebin)
Edit 2: Figured out it was the first frame, not a black screen
Still not entirely sure where the root of the problem lies, but what fixed it was adding this code right after calling the video. What it does is pause the playback and add a timer for one second, then seek 0.5 seconds into the video. I haven't run tests with this yet beyond getting past that first frame lag, but it works.
ns.pause();
var hesitate:Timer = new Timer(1000, 1);
hesitate.addEventListener(TimerEvent.TIMER_COMPLETE, function(e:TimerEvent)
{
ns.seek(0.5);
ns.resume();
});
hesitate.start();

Actionscript 3.0 Preloader Instantly Finishes

I have had a lot of trouble trying to make a preloader work in Actionscript 3.0. I'm also using Animate CC.
So to try to figure out how to even make it work, I downloaded Simple NG Loader from Newgrounds https://www.newgrounds.com/downloads/preloaders/ , to make sure I had a working preloader. Then I got 4 high res images from google, around 10000x10000 pixels each, adding up to 85MB, to make sure there was more than enough to load.
I placed the preloader on the first frame, and put all the images on the second along with "stop();".
When I play, the preloader instantly finishes, but it leaves me with a white screen for a while before the images eventually shows up.
If I play it using a standalone flash player, it instantly crashes.
I would really appreciate some help with this!
The issue is probably that the game will already be fully loaded when you launch the swf in flash. You need to set your flash player to "Simulate Download". Do the following:
Hit ctrl+enter in your ide to launch the swf
Hit view on the menu of the swf and click simulate download.
The swf will now restart and pretend it's downloading. If you open view again, you can select the download speed by going to "Download Settings"

Flash FLVplayback giving issues in fullscreen mode - content dissapears

I am working on a video playing menu set up to work in Flash player as an exe. I have videos playing in the background with buttons hovering above the video with which the user can then play different videos. I am not a programmer but I have an understanding of very basic actionscript3 which I often cut and paste and/or modify in small ways.
My problem: When launching in fullsreen mode:
stage.displayState = StageDisplayState.FULL_SCREEN;
The video seems to make everything else disappear by appearing on top
of it or in other cases just causing a blank black screen.
this."name of FLV playback instance".fullScreenTakeOver = false;
Doesn't seem to be solving the problem.
Any help would be appreciated! :-)
I discovered in many cases it helped to put the "name of FLV playback instance".fullScreenTakeOver = false; code in the same timeline as the FLVPlayback. I still have the black screen issue sometimes, but I am working on that now.
Found the solution for the Blank screen. It's a glitch in Flash. Put the FLVPlayback on the first frame of a movieclip. This might mean converting it to a symbol in order to nest it on the first frame.
I discovered in many cases it helped to put the
"name of FLV playback instance".fullScreenTakeOver = false;
code in the same timeline as the FLVPlayback. I still ahve the black screen issue sometimes, but I am working on that now.

Weird flash player glitch (12.0.0.41) in Chrome only

Very recently, after the latest Chrome update which includes Adobe Flash Player Version: 12.0.0.41, a flash app that's been running smoothly for years has begun to "hiccup" during one particular function.
Normal behavior - User logs in to app. App grabs some xml files then draws a calendar onscreen.
Hiccup behavior - User logs in to app. App grabs the xml files but feezes before executing the loadComplete function (according to trace). By freezes, I mean the little load spinner remains onscreen but stops spinning and the calendar doesn't appear onscreen.
Interesting/maddening notes - The mouse cursor responds as if the calendar has been drawn (arrow changes to pointer when mouse passes over an invisible calendar day) but according to my trace log the loadComplete and showCal functions haven't fired.
ALSO, any call to a function unfreezes the glitch (e.g. clicking an invisible calendar day, mousingOver a control button, etc. Anything that triggers a function.) and bam! everything's there and the trace log completes as it should.
As stated, this glitch only occurs in Chrome with the latest Flash Player update (12,0,0,41).
Installing the mozilla version of the flash player debugger (12,0,0,43) and instructing chrome to use it instead fixes the glitch, but using it in chrome opens up a whole new can of worms when it comes to flash player glitches (as is to be expected).
Maybe there's nothing I can do and it's just a fault with the latest Chrome flash player build, OR...
There's something fundamentally wrong with my code and Chrome's latest flash player is the only plugin that glitches on my "wrong" code?
I'll happily include some code snippets if someone is convinced my code is the problem but am leaving them off for now since this question is enormous. (you're a trooper for sticking with it)
I'm hoping someone else has experienced this or can at least explain it/fix it. Thanks in advance.
I'm seeing very similar symptoms on an application I work on Frankenscarf. All workarounds have been ineffective thus far. I can confirm it is specific to 12.0.0.41 Pepper Flash. I think you might need to wait for google to fix the lasted release...
I am also having problems with Flash 12.0.0.41 on YouTube, videos very laggy and dropping frames all the time even making the video stutter on 320p. I have disabled Chromes built in Flash player though Chrome://plugins, installed Chrome 11.7.700.260 and now have the videos running smoothly even at 1440p. Hopefully they will sort out the bugs soon.
I wasn't able to edit my original post...
UPDATE: I managed to get a workaround going. I set up a periodic timer (triggering every 500ms), that calls invalidateDisplayList() in my largest container. It is horrible, but it works....

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.