Maintaining version control on project files can easily get out of control when saving multiple versions of the same file. One tip is covered in an earlier post about swf based relative urls for flash/flex files. This tip works even if the host file is moved to a different locations. This way we do not need to save a live version and a local build version.
Why would I care which Flash Player type is used?
Some projects, like kiosks, will end up as a Flash Projector or AIR Application. Until the project is finalized and approved we may need to preview the project for our clients on the web. In AS3 some stage methods are only available to the standalone player. Instead of saving two versions of the same project, one to test the Projector functionality and another for online approvals; we can build one multi-purpose file.
AS3 Method:
if(Capabilities.playerType == "StandAlone"){ stage.displayState = StageDisplayState.FULL_SCREEN; // mouse hide and show for touchscreen kiosk: default (hide) Mouse.hide(); } trace(Capabilities.playerType); //StandAlone |
AS2 Method:
trace(System.capabilities.playerType); //StandAlone |
Here is a list of Flash Player type strings:
from Flash AS3 language reference
“ActiveX” for the Flash Player ActiveX control used by Microsoft Internet Explorer
“Desktop” for the Adobe AIR runtime (except for SWF content loaded by an HTML page, which has Capabilities.playerType set to “PlugIn” )
“External” for the external Flash Player or in test mode
“PlugIn” for the Flash Player browser plug-in (and for SWF content loaded by an HTML page in an AIR application)
“StandAlone” for the stand-alone Flash Player
If you need to know the player version number of the Flash Player use this code:
AS3:
trace(Capabilities.version); //MAC 10,0,2,54 or WIN 10,0,2,54
AS2:
trace(System.capabilities.version); //MAC 10,0,2,54 or WIN 10,0,2,54
tip 1: If your swf requires a newer Flash Player version, it is best to detect flash player versions using the Flash Version Detection option in the HTML publishing settings and require the user to download the newer player. SWFs published to newer Flash Player versions can be very unstable when running in older Players and can cause browser and system crashes.
tip 2:
Standalone and Desktop players are built into the executables so the Flash Player version will always be correct no matter what is currently installed on the system.
tip 3:
For a complete list of all the system capabilities you can learn about the system that is running your projects, look here.
| No Comments » | facebook:
No comments yet.
RSS feed for comments on this post. TrackBack URL