Got some free time this afternoon at company to investigate a further on splash screen at Flex 4.5 SDK.
By far is the must do feature on SDK for any Flex developer out there who doesn’t want to run out from mobile development with SDK, you have three properties to set up (splashScreenScaleMode=”" splashScreenMinimumDisplayTime=”" splashScreenImage=”") , and voilá, you have a great app introduction for any device with android.
Adobe Flex Team is working pretty well on mobile development, but sometimes I love to hack, and this hack anyone who are engage with mobile development with Flex can do, doesn’t involve any advanced code or class hacking, but it could get complicated if Adobe AIR 2.6 currently on my device doesn’t allow me because had the same behavior if I deep dive into SystemManager or simple embeding.
If read the documentation on behalf this topic, they teach you to only use static images, like jpg, png, of even animated gif if you which, but maybe someone spark this idea and have better ways, but my current target is swf support.
No matter what were the decisions, but the same documentation could let others know that they can embed simple SWF with no actionscript 3.0 at all to animate the splashscreen.
The fact of this hack is simple, the property splashScreenImage does support swf also, because it’s a generic Object at SystemManager Class.
If you open the Application class you will see:
public function get splashScreenImage():Class
{
// When set through mxml, the compiler uses the value in the generated loader class.
return systemManager.info()["splashScreenImage"];
}
/**
* @private
*/
public function set splashScreenImage(value:Class):void
{
systemManager.info()["splashScreenImage"] = value;
}As you see, supports Class, which lets you support swf,and is registered in systemManager invoked by info() method.
The only circustence that Flex Team didn’t mentioned that I guess, was the fact AIR fps runs 15fps and by default the Flex SDk runs at 24, I believe when AIR 2.7 hit the Android Market, they will update the documentation, because applications will get like 45fps even more on iphone/ipad.
Why, because it’s chunk a little in the very first beginning of swf animated. than you need to calculate a little better timing. Or listeting the FlexEvent.COMPLETE from preloader to start the animation.
Guess what, splash Screen is just a Flex 4.5 preloader property, they also added that feature for Desktop version.
Here’s my little hack that can help you a little bit, my animation is simple swf of 3secs with average time 4000msecs on the definition for Splashscreen.
<?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication splashScreenScaleMode="" splashScreenMinimumDisplayTime="4000" splashScreenImage="@Embed('assets/splash2.swf')" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.SplashHackHomeView">





