Splash screen with FXG in Mobile applications with Flash Builder for PHP

ahillman3 on Stack Overflow wrote this (and won my hero of the day award); OK, the primary focus for your solution is the preloader attribute on a mobile application. See the preloader=”CustomSplashScreen” below:

< ?xml version="1.0" encoding="utf-8"?>



The CustomSplashScreen extends and overrides the spark.preloaders.SplashScreen class, and the getImageClass function.

package
{

import mx.core.DPIClassification;
import mx.core.mx_internal;

import spark.preloaders.SplashScreen;

use namespace mx_internal;
public class CustomSplashScreen extends SplashScreen

{
public function CustomSplashScreen()
{
super();
}

override mx_internal function getImageClass(dpi:Number, aspectRatio:String):Class
{
return Class(splash);
}
}
}

The splash in the return Class(splash), is a simple fxg file, like so:

< ?xml version="1.0" encoding="UTF-8"?>




That’s all there is to it. Have fun!

— Allen

via .