Paket | spark.preloaders |
Sınıf | public class SplashScreenImage |
Miras Alma | SplashScreenImage Object |
Uygular | IMXMLObject |
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 4.6 |
Çalışma Zamanı Sürümleri: | AIR 3 |
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
oraspectRatio
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 theStage.stageWidth
andStage.stageHeight
properties is equal to or greater thanminResolution
.
- The SplashScreenImageSource definition does not have that setting explicitly defined.
For example, no setting for the
- 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
andaspectRatio
properties is a better match than one that only species thedpi
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.
- Choose the one with largest number of explicit settings.
For example, a SplashScreenImageSource definition that specifies both the
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.
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>
Varsayılan MXML ÖzelliğimxmlContent
İlgili API Öğeleri
Özellik | Tanımlayan: | ||
---|---|---|---|
constructor : Object
Belirli bir nesne örneği için sınıf nesnesine veya yapıcı işlevine bir başvuru. | Object | ||
mxmlContent : Array
The SplashScreenImageSource sources for this
SplashScreenImage. | SplashScreenImage |
Yöntem | Tanımlayan: | ||
---|---|---|---|
Constructor. | SplashScreenImage | ||
Returns the Class of the SplashScreenImageSource that best matches
the specified device parameters. | SplashScreenImage | ||
Bir nesnenin belirli bir özelliğinin tanımlı olup olmadığını gösterir. | Object | ||
Called after the implementing object has been created and all
component properties specified on the MXML tag have been initialized. | SplashScreenImage | ||
Object sınıfının bir örneğinin parametre olarak belirtilen nesnenin prototip zincirinde olup olmadığını gösterir. | Object | ||
Belirtilen özelliğin bulunup bulunmadığını ve numaralandırılabilir olup olmadığını gösterir. | Object | ||
Dinamik bir özelliğin döngü işlemlerinde kullanılabilirliğini ayarlar. | Object | ||
Bu nesnenin, yerel ayara özel kurallara göre biçimlendirilmiş dize temsilini döndürür. | Object | ||
Belirtilen nesnenin dize olarak temsil edilen halini döndürür. | Object | ||
Belirtilen nesnenin temel değerini döndürür. | Object |
mxmlContent | özellik |
mxmlContent:Array
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 4.6 |
Çalışma Zamanı Sürümleri: | AIR 3 |
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.
Uygulama
public function get mxmlContent():Array
public function set mxmlContent(value:Array):void
SplashScreenImage | () | Yapıcı |
public function SplashScreenImage()
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 4.6 |
Çalışma Zamanı Sürümleri: | AIR 3 |
Constructor.
getImageClass | () | yöntem |
public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 4.6 |
Çalışma Zamanı Sürümleri: | AIR 3 |
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.
Parametreler
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.
|
Class — The Class for the image to be displayed as a splash screen image.
|
İlgili API Öğeleri
initialized | () | yöntem |
public function initialized(document:Object, id:String):void
Dil Sürümü: | ActionScript 3.0 |
Ürün Sürümü: | Flex 4.6 |
Çalışma Zamanı Sürümleri: | AIR 3 |
Called after the implementing object has been created and all component properties specified on the MXML tag have been initialized.
Parametreler
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.
|
<?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.DynamicSplashScreenExample1HomeView" splashScreenImage="SplashScreenImage1"> </s:ViewNavigatorApplication>
<?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> </s:View>
<?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"> <fx:Script> <![CDATA[ [Embed("soccer-ball.jpg")] private var andImage:Class; override public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class { // Are we running on IOS ? if (Capabilities.version.indexOf("IOS") == 0) return andImage; return super.getImageClass(aspectRatio, dpi, resolution); } ]]> </fx:Script> <!-- no settings, so this acts as default--> <s:SplashScreenImageSource source="@Embed('image_not_found.jpg')"/> <!-- specific settings --> <s:SplashScreenImageSource source="@Embed('pinkball.jpg')" dpi="160" minResolution="0"/> <s:SplashScreenImageSource source="@Embed('yellowball.jpg')" dpi="160" minResolution="500"/> <s:SplashScreenImageSource source="@Embed('orangball.png')" dpi="160" minResolution="1000"/> <s:SplashScreenImageSource source="@Embed('yellowball.jpg')" dpi="160" minResolution="1000" aspectRatio="portrait"/> <s:SplashScreenImageSource source="@Embed('yellowball.jpg')" dpi="240" aspectRatio="portrait"/> <s:SplashScreenImageSource source="@Embed('pinkball.jpg')" dpi="240" aspectRatio="landscape"/> <s:SplashScreenImageSource source="@Embed('pinkball.jpg')" dpi="320"/> </s:SplashScreenImage>
Tue Jun 12 2018, 01:09 PM Z