spark.preloaders

# SplashScreenImageSource - AS3 Flex

Package | spark.preloaders
Class | public class SplashScreenImageSource
Inheritance | SplashScreenImageSource Object

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

Use the SplashScreenImageSource class to specify a Class (typically an embedded image) to be displayed as splash screen at a particular device configuration such as DPI, orientation and resolution.

You typically use one or more SplashScreenImageSource objects to define a SplashScreenImage class in MXML and set the application's `splashScreenImage` property to that class.

Shown below is SplashScreenImage component with three different definitions for SplashScreenImageSource:

        <?xml version="1.0" encoding="utf-8"?>
        <s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark">

            <!-- Default splashscreen image. -->
            <s:SplashScreenImageSource
                source="@Embed('assets/logoDefault.jpg')"/>

            <s:SplashScreenImageSource
                source="@Embed('assets/logo240Portrait.jpg')"
                dpi="240"
                aspectRatio="portrait"/>

            <s:SplashScreenImageSource
                source="@Embed('assets/logo240Landscape.jpg')"
                dpi="240"
                aspectRatio="landscape"/>

        </s:SplashScreenImage>

MXML Syntax Show MXML Syntax
Hide MXML Syntax

The `<s:SplashScreenImageSource>` tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

      <s:SplashScreenImageSource
       Properties
        aspectRatio="null"
        dpi="NaN"
        minResolution="NaN"
        source="null"
      >

More examples

Add a splash screen to an application
Add a splash screen from an image file
Add a splash screen from a custom component
Explicitly select the splash screen image

Related API Elements

spark.preloaders.SplashScreenImage
spark.components.Application.splashScreenImage

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | aspectRatio : String = "null" The required aspect ratio of the mobile device. | SplashScreenImageSource
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | dpi : Number = NaN The required DPI of the device to display the associated image. | SplashScreenImageSource
|  | minResolution : Number = NaN The required minimum size of the mobile device's resolution needed to display the image. | SplashScreenImageSource
|  | source : Class The image class for the splash screen to use for the defined device configuration. | SplashScreenImageSource

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | SplashScreenImageSource() Constructor. | SplashScreenImageSource
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### aspectRatio

property

`public var aspectRatio:String = "null"`

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

The required aspect ratio of the mobile device. This property can be either `flash.display.StageAspectRatio.PORTRAIT` or `flash.display.StageAspectRatio.LANDSCAPE`.

If not set, then `SplashScreenImage` ignores this property.

Related API Elements

flash.display.StageAspectRatio

### dpi

property

`public var dpi:Number = NaN`

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

The required DPI of the device to display the associated image.

A value of NaN means the property is ignored by SplashScreenImage.

The default value is `NaN.`

### minResolution

property

`public var minResolution:Number = NaN`

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

The required minimum size of the mobile device's resolution needed to display the image. The device resolution is the maximum of the stage width and height, in pixels. The value of the `minResolution` property is compared against the larger of the values of the `Stage.stageWidth` and `Stage.stageHeight` properties. The larger of the two values must be equal to or greater than the `minResolution` property.

You can use this property to display different images based on the pixel resolution of a device.

A value of NaN means the property is ignored by the SplashScreenImage.

The default value is `NaN.`

### source

property

`public var source:Class`

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

The image class for the splash screen to use for the defined device configuration. Typically you set this property to an embedded resource.

For example:

                <s:SplashScreenImageSource
                    source="@Embed('assets/logo240Portrait.jpg')"
                    dpi="240"
                    aspectRatio="portrait"/>

The default value is `null.`

Related API Elements

spark.preloaders.SplashScreenImage
Constructor Detail

### SplashScreenImageSource

()
Constructor

`public function SplashScreenImageSource()`

Language Version: | ActionScript 3.0

Product Version: | Flex 4.6

Runtime Versions: | AIR 3

Constructor.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00