RIA + OSP = RAA || REA && And how to detect an Open Screen Device

May 6th, 2008 · No Comments


Keeping with the algebraic/code functions as titles from my Last post I thought I would put some thoughts down regarding the news from Adobe earlier this week of their Open Screen Project (OSP). Anyone working in the Web/Internet industry at the moment will be well aware of the Rich Internet/Interactive Application (RIA) moniker. What Adobe is committing to is much larger though this is about true cross platform convergence. Its about Rich Anywhere Applications (RAA) or Rich Everywhere Applications (REA) if you will. You see what I did there ;) .

Interestingly this is a concept I began to scratched the surface of with my presentation at Flash On the Beach Last Year, and over the last few months has been a subject I have continued to keep close to hand both in my day job and my personal development projects. At the moment the Flash Player Fragmentation offers a considerable challenge to any developer wanting to design and or develop for multiple devices and multiple screens.

Articles like the one posted over at ADC on adaptive screen layouts offer a great foot up. But before we get to visual display we need to know what player version we are targeting. And to do that, we have to hit the time machine button and roll back all the way to Flash 4.....

The Following code should be exported as a Flash 4 ActionScript 1 .swf. This will ensure it can run on the broadest client base. The resultant .swf acts a cross platform redirect that should work within both stand alone and browser based flash clients. Once the .swf loads it will identify the player variation and then redirect the viewer to the appropriate content for there player platform by loading a replacement content swf at the main player level.

  1.  
  2. /**
  3. Declare flash platform player strings here. As more devices are discovered this list will grow, the strings are from the getVersion() function
  4. */
  5. // FlashLite 1.1 player platform string
  6. FL1PLATFORM = "5.2";
  7. // FlashLite 2 or 3 player platform string
  8. FL2PLATFORM = "FL ";
  9. // psp Flash Player Platform string
  10. PSPPLATFORM = "NF3";
  11. // Wii Player Platform String
  12. WIIPLATFORM = "WII"
  13. // windows Flash Player Platform string
  14. WINPLATFORM = "WIN";
  15. // mac Flash Player Platform string
  16. MACPLATFORM = "MAC"
  17. /**
  18. Declare files names for flash files of different device configurations
  19. NOTE! Include the full path name here
  20. */
  21. flashLite1 = "fl_fl1.swf";
  22. flashLite2 = "fl_fl2.swf";
  23. flashLite3 = "fl_fl3.swf";
  24. flash6PSP = "flash6PSP.swf";
  25. flash7WII = "flash7WII.swf";
  26. flashFull8 = "FullFlash8.swf";
  27. flashFull9 = "FullFlash9.swf";
  28. // get the player version
  29. flashVersion = getVersion();
  30. // display full player information
  31. trace(flashVersion);
  32. // test for existence of player version for very early players
  33. if(flashVersion == "")
  34. {
  35. /*
  36. Player does not support $version so is VERY early Flash PLayer
  37. Decide how you wish to handle this case here
  38. */
  39. }
  40. // crop the player version to store the platform
  41. playerPlatform = substring(flashVersion, 0, 3)
  42. // Assign a player version for testing
  43. // playerPlatform = PSPPLATFORM;
  44. // display platform information
  45. trace("playerPlatform");
  46. trace(playerPlatform);
  47. // use flashLite 1.1 file
  48. if(playerPlatform eq FL1PLATFORM)
  49. {
  50. // launch a FlashLite 1.1 version of the file.
  51. trace("Launch FlashLite 1.1 player version");
  52. loadMovie(flashLite1, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  53. }
  54. else
  55. {
  56. if(playerPlatform eq PSPPLATFORM)
  57. {
  58. // launch a PSP or Flash 6 version of the file
  59. trace("Launch PSP player version");
  60. loadMovie(flash6PSP, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  61. }
  62. else if(playerPlatform eq WIIPLATFORM)
  63. {
  64. // launch a PSP or Flash 7 version of the file
  65. trace("Launch WII player version");
  66. loadMovie(flash7WII, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  67. }
  68. else if(playerPlatform eq FL2PLATFORM)
  69. {
  70. // grab the player version number for flash lite
  71. playerVersion = substring(flashVersion, 4, 1);
  72. // display version information
  73. trace("playerVersion");
  74. trace(playerVersion);
  75. if(playerVersion == "7")
  76. {
  77. // launch a FlashLite 2 version of the file.
  78. trace("Launch FlashLite 2 player version");
  79. loadMovie(flashLite2, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  80. }
  81. else if(playerVersion eq "8")
  82. {
  83. // launch a FlashLite version of the file.
  84. trace("Launch FlashLite 3 player version");
  85. loadMovie(flashLite3, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  86. }
  87. }
  88. else if((playerPlatform eq WINPLATFORM) || (playerPlatform eq MACPLATFORM))
  89. {
  90. // grab the player version number for desktop player
  91. playerVersion = substring(flashVersion, 5, 1);
  92. // display version information
  93. trace("playerVersion");
  94. trace(playerVersion);
  95. if(playerVersion == 8 )
  96. {
  97. // launch a desktop version 8 of the file.
  98. trace("Launch desktop player version");
  99. loadMovie(flashFull8, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  100. }
  101. else if (playerVersion == 9 )
  102. {
  103. // launch a desktop version 9 of the file.
  104. trace("Launch desktop player version");
  105. loadMovie(flashFull9, "_level0"); //+"?stgWidth="+Stage.width+"&stgHeight="+Stage.height);
  106. }
  107. }
  108. }
  109. stop();
  110.  

The below zip includes the full source and example 'redirection' movies. If you have any other Client version strings that can be added please let me know and I will try and keep the script updated. For example I would love to know what the Sony Ericcson Java client version reports.

Identiying Flash Client Versions

How about donating a coffee, beer or even a round of beers for my efforts here? Thats around £2.50 for a coffee or a pint or about £10 for a round of beers. Cheers!

Tags: ActionScript 1 · ActionScript 2 · ActionScript 3 · ActionScript General · Adobe · BitTube Work · Development · Flash · Flash for PSP · Flash Lite · FlashCast · FlashLite 1 · FlashLite 2 · FlashLite 3 · Mobile Development · Mobile Devices

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment