Language Version : | ActionScript 3.0 |
Product Version : | Flex 4.6 |
Use the SplashScreenImage class to specify different splash screen
images based on characteristics of a mobile device.
For example, you can use different images for a splashscreen based on the
DPI, orientation, or resolution of the device.
You typically define a SplashScreenImage class
in an MXML file.
Use the SplahsScreenImageSource class to define the different
image choices and corresponding device configurations.
You then set the application's splashScreenImage
property to the name of the SplashScreenImage
MXML component.
The procedure for determining the best match of an SplahsScreenImageSource
definition to a mobile device is as follows:
- Determine all of the SplashScreenImageSource definitions
that match the settings of the mobile device.
A match occurs when:
- The SplashScreenImageSource definition does not have that setting explicitly defined.
For example, no setting for the
dpi
property matches any device's DPI.
- For the
dpi
or aspectRatio
property, the property must exactly match
the corresponding setting of the mobile device.
- For the
minResolution
property, the property matches a setting on
the device when the larger of the Stage.stageWidth
and
Stage.stageHeight
properties is equal to or greater than minResolution
.
- If there's more than one SplashScreenImageSource definition that matches the device then:
- Choose the one with largest number of explicit settings.
For example, a SplashScreenImageSource definition that specifies both the
dpi
and aspectRatio
properties is a better match
than one that only species the dpi
property.
- If there is still more than one match, choose the one with highest
minResolution
value.
- If there is still more than one match, choose the first one defined in the component.
Note: This class cannot be set inline in the MXML of the application.
You must define it in a separate MXML file and reference it by using the
application's splashScreenImage
property.
Show MXML Syntax
Hide MXML Syntax
The <s:SplashScreenImage>
tag inherits all of the tag
attributes of its superclass and adds no new tag attributes:
<s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- Define one or more SplashScreenImageSource. -->
<s:SplashScreenImageSource
source="@Embed('assets/logoDefault.jpg')"/>
<s:SplashScreenImageSource
source="@Embed('assets/logo240Portrait.jpg')"
dpi="240"
aspectRatio="portrait"/>
</s:SplashScreenImage>
mxmlContent
mxmlContent:Array
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4.6 |
The SplashScreenImageSource sources for this
SplashScreenImage
.
Typically you do not call this method directly.
Instead, you add SplashScreenImageSource definitions
inline in the MXML file of the SplashScreenImage component.
Implementation public function get mxmlContent():Array
public function set mxmlContent(value:Array):void
public function SplashScreenImage()
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4.6 |
Constructor.
public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4.6 |
Returns the Class of the SplashScreenImageSource that best matches
the specified device parameters.
You do not call this method directly; it is called internally by Flex.
Override this method in a SplashScreenImage component if you want to override
the default Flex logic of picking the best matching SplashScreenImageSource instance.
Parameters
| aspectRatio:String — Either flash.display.StageAspectRatio.PORTRAIT or
flash.display.StageAspectRatio.LANDSCAPE , whichever is greater.
|
|
| dpi:Number — The DPI of the mobile device.
|
|
| resolution:Number — The resolution of the mobile device's bigger dimension, in pixels.
|
Returns | Class — The Class for the image to be displayed as a splash screen image.
|
See also
flash.display.StageAspectRatio
public function initialized(document:Object, id:String):void
Language Version : | ActionScript 3.0 |
Product Version : | Flex 4.6 |
Called after the implementing object has been created and all
component properties specified on the MXML tag have been initialized.
Parameters
| document:Object — The MXML document that created this object.
|
|
| id:String — The identifier used by document to refer
to this object.
If the object is a deep property on document ,
id is null.
|
Mon Feb 18 2013, 01:33 PM +11:00