Resolution of graphics degrades when I run my flash Game - actionscript-3

Why does the resolution of the graphics that I use for my flash game degrades when I run the game, though the graphics seems great when it is in the development environment???

Two possible reasons: Either your bitmaps aren't set to allow smoothing and they're being scaled or rotated. To fix that you can simply find them in your library, open their properties and check bitmap smoothing.
Or your flash player is set to low quality. In which case you just need to right click on the stage, go to quality, and change that to high.

Another possibility is in the publishing settings; In Flash, go to File > Publish Settings. Set the JPG Quality to 100.

Related

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.

How can I force flash fullscreen to a particular display in a multi-display setup

I want to get several Flash animations to come up on different displays at start up. Is there a way in Actionscript that I can force the movie to go fullscreen on a particular display?
Package your flash animations into AIR applications - you can then set the x,y of each application within the properties box / xml.
Flash Player chooses which monitor to full-screen to. If there is a solution, it is not AS3.
"Flash Player and AIR use a metric to determine which monitor contains the greatest portion of the SWF, and uses that monitor for full-screen mode."

Enable hardware acceleration for swf generated in Flash Builder

Is it possible to enable hardware acceleration (Level 1, Level 2) for a swf generated in Flash Builder. I donĀ“t use the Flash IDE and therefor I have no access to the "Publish Settings" in the Flash IDE? Maybe there is som compiler arguments?
http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WSd60f23110762d6b883b18f10cb1fe1af6-7bcea.html
To enable the SWF file to use hardware acceleration, select one of the
following options from the Hardware Acceleration menu: Level 1 -
Direct Direct mode improves playback performance by allowing Flash
Player to draw directly on the screen instead of letting the browser
do the drawing. Level 2 - GPU In GPU mode, Flash Player utilizes the
available computing power of the graphics card to perform video
playback and compositing of layered graphics. This provides another
level of performance benefit depending on the user's graphics
hardware. Use this option when you expect that your audience will have
high-end graphics cards. If the playback system does not have
sufficient hardware to enable acceleration, Flash Player reverts to
normal drawing mode automatically. For best performance on web pages
containing multiple SWF files, enable hardware acceleration for only
one of the SWF files. Hardware acceleration is not used in Test Movie
mode. When you publish your SWF file, the HTML file that embeds it
contains a wmode HTML parameter. Choosing Level 1 or Level 2 hardware
acceleration sets the wmode HTML parameter to "direct" or "gpu"
respectively. Turning on hardware acceleration overrides the Window
Mode setting you may have chosen in the HTML tab of the Publish
Settings dialog box, because it is also stored in the wmode parameter
in the HTML file.
When you publish your SWF file, the HTML file that embeds it contains a wmode HTML parameter. Choosing Level 1 or Level 2 hardware acceleration sets the wmode HTML parameter to "direct" or "gpu" respectively. Turning on hardware acceleration overrides the Window Mode setting you may have chosen in the HTML tab of the Publish Settings dialog box
So it's my understanding that you just need to set the wmode parameter in your html, no need for any compiler options.
This link explains things in a bit more detail:
http://labs.almerblank.com/2011/03/the-wmode-embed-parameter-de-mystified/

Level 2 Hardware Acceleration and webcam

I am creating a webcam air app. This app will also have some intense sprite animations.
Without Hardware Acceleration everything works fine, but my sprite animation is too cpu intensive.
When I enable Hardware Acceleration i get a 70% speed increase, but my webcam is no longer working. Is there anyway of telling flash to ignore the webcam on hardware acceleration? Or, what is it that I have to do?
Thank you very much for your help good sirs.
try removing sprite animations from the display list and displaying them with BitmapData.draw() every frame instead

FLV performance and garbage collection

I'm building a large flash site (AS3) that uses huge FLVs as transition videos from section to section. The FLVs are 1280x800 and are being scaled to 1680x1050 (much of which is not displayed to users with smaller screens), and are around 5-8 seconds apiece. I'm encoding the videos using On2's hi-def codec, VP6-S, and playback is pretty good with native FLV players, Perian-equipped Quicktime, and simple proof-of-concept FLV playback apps built in AS3.
The problem I'm having is that in the context of the actual site, playback isn't as smooth; the framerate isn't quite as good as it should be, and more problematically, there's occasional jerkiness and dropped frames (sometimes pausing the video for as long as a quarter of a second or so). My guess is that this is being caused by garbage collection in the Flash player, which happens nondeterministically and is therefore hard to test and control for.
I'm using a single instance of FLVPlayback to play the videos; I originally was using NetStream objects and so forth directly but switched to FLVPlayback for this reason. Has anyone experienced this sort of jerkiness with FLVPlayback (or more generally, with hi-def Flash video)? Am I right about GC being the culprit here, and if so, is there any way to prevent it during playback of these system-intensive transitions?
Jerkiness in FLV/F4V playback is hardly the result of garbage collection - the video is actually kept in memory until it is fully unloaded, so there's no garbage collection taking place at all (unless you've done something unorthodox like placing the video on a container with cacheAsBitmap set to true).
Switching to F4Vs if you don't need specific FLV features (like the link posted by daidai suggests - disclaimer, it's my blog) would help, but overall, you also have to be aware of anything that's impacting compositing of the video on screen. Because a big size video forces everything that's overlapping it to be re-rendered, any small object can have a big impact on performance.
Do you have things on top of the video? Try getting rid of them, if possible, or setting cacheAsBitmap to true (if they're not animated). This is specially good for complex vector drawings or text (bitmaps/images are much faster to draw). If they have different blending modes, you're sort of screwed - can you use the normal blending mode instead?
Do you have anything below the video? If so, get rid of them while the video is playing (just set visibility to false).
To check on unnecessary renderings, somehow pause the video, right-click, turn on 'show redrawn regions' (debug player). Do you see the red square drawing continuously? Then there's something happening there on the background, better to get rid of it.
Do you have anything happening on the background via onEnterFrame or timers/intervals? Try pausing it.
Is your video 30fps, and a CG rendering (eg, can use motion blur)? If yes, try rendering at 24fps instead, or something between - still good quality, but much less data to decode and draw.
Can you use smaller videos? Even if you're still rendering them at the same bigger size, less pixel data to decode and render helps immensely, and the impact in quality can be pretty small.
That pretty much sums it all. Getting rid of everything else on screen is usually your #1 priority though.
Have you tried encoding the videos in H.264 instead? Flash player supports them for some time now, it may end up working better. That's what most people doing HD video in Flash use (eg Youtube, Vimeo, etc).
Just as a test, try plaing a 1080p HD video on youtube and see if that pauses at all for you.
Check out http://zehfernando.com/2010/benchmarking-video-playback-performance-in-flash/