| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><meta name="keywords" content="SplashScreenImage,spark.preloaders.SplashScreenImage,aspectRatio,dpi,minResolution,mxmlContent,preloader,source,stageHeight,stageWidth,getImageClass,initialize,initialized"><title>spark.preloaders.SplashScreenImage</title><script src="../../AC_OETags.js" type="text/javascript"></script></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript"><!-- |
| asdocTitle = 'SplashScreenImage - ApacheFlex API Reference'; |
| var baseRef = '../../'; |
| window.onload = configPage; |
| --></script> |
| <script type="text/javascript"> |
| scrollToNameAnchor(); |
| </script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">Apache Flex 4.16.1 API Reference </td><td class="titleTableTopNav" align="right"><a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a> | <a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a> | <a href="../../all-index-A.html" onclick="loadClassListFrame('../../index-list.html')">Index</a> | <a id="framesLink1" href="../../index.html?spark/preloaders/SplashScreenImage.html&spark/preloaders/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt="AdobeLogo" title="AdobeLogo"></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">SplashScreenImage</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#propertySummary">Properties</a> | <a href="#methodSummary">Methods</a> | <a href="#includeExamplesSummary">Examples</a></td></tr><tr class="titleTableRow3"><td colspan="3"> </td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve"> |
| <!-- |
| |
| if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("SplashScreenImage"); titleBar_setSubNav(false,true,false,false,false,false,false,false,true,true,false ,false,false,false,false,false);} |
| --> |
| </script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">spark.preloaders</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class SplashScreenImage</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">SplashScreenImage <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> Object</td></tr><tr><td class="classHeaderTableLabel">Implements</td><td> <a href="../../mx/core/IMXMLObject.html">IMXMLObject</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4.6</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>AIR 3</td></tr></table><p></p><p></p><p></p><p></p> |
| 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. |
| |
| <p>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 <code>splashScreenImage</code> |
| property to the name of the <code>SplashScreenImage</code> MXML component.</p> |
| |
| <p>The procedure for determining the best match of an SplahsScreenImageSource |
| definition to a mobile device is as follows:</p> |
| |
| <ol> |
| <li>Determine all of the SplashScreenImageSource definitions |
| that match the settings of the mobile device. |
| A match occurs when: |
| <ul> |
| <li>The SplashScreenImageSource definition does not have that setting explicitly defined. |
| For example, no setting for the <code>dpi</code> property matches any device's DPI.</li> |
| <li>For the <code>dpi</code> or <code>aspectRatio</code> property, the property must exactly match |
| the corresponding setting of the mobile device. </li> |
| <li>For the <code>minResolution</code> property, the property matches a setting on |
| the device when the larger of the <code>Stage.stageWidth</code> and |
| <code>Stage.stageHeight</code> properties is equal to or greater than <code>minResolution</code>.</li> |
| </ul> |
| </li> |
| <li>If there's more than one SplashScreenImageSource definition that matches the device then: |
| <ul> |
| <li>Choose the one with largest number of explicit settings. |
| For example, a SplashScreenImageSource definition that specifies both the |
| <code>dpi</code> and <code>aspectRatio</code> properties is a better match |
| than one that only species the <code>dpi</code> property.</li> |
| <li>If there is still more than one match, choose the one with highest |
| <code>minResolution</code> value.</li> |
| <li>If there is still more than one match, choose the first one defined in the component.</li> |
| </ul> |
| </li> |
| </ol> |
| <p> |
| <b>Note</b>: 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 <code>splashScreenImage</code> property.</p> |
| <p></p><a name="mxmlSyntaxSummary"></a><span class="classHeaderTableLabel">MXML Syntax</span><span id="showMxmlLink" style="display:none"><a href="#mxmlSyntaxSummary" onclick="toggleMXMLOnly();"><img src="../../images/collapsed.gif" title="collapsed" alt="collapsed" class="collapsedImage">Show MXML Syntax</a><br/></span><span id="hideMxmlLink"><a href="#mxmlSyntaxSummary" onclick="toggleMXMLOnly();"><img src="../../images/expanded.gif" title="expanded" alt="expanded" class="expandedImage">Hide MXML Syntax</a></span><div id="mxmlSyntax" class="mxmlSyntax"> |
| <p>The <code><s:SplashScreenImage></code> tag inherits all of the tag |
| attributes of its superclass and adds no new tag attributes:</p> |
| |
| <pre> |
| <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> |
| </pre> |
| </div><script language="javascript" type="text/javascript"><!-- |
| setMXMLOnly(); |
| --></script><p><span class="classHeaderTableLabel">Default MXML Property</span><code>mxmlContent</code></p><p><a href="#includeExamplesSummary">View the examples</a></p><p><span class="classHeaderTableLabel">See also</span></p><div class="seeAlso"><a href="SplashScreenImageSource.html" target="">spark.preloaders.SplashScreenImageSource</a><br/><a href="../../spark/components/Application.html#splashScreenImage" target="">spark.components.Application.splashScreenImage</a></div><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th> </th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> <a href="#mxmlContent" class="signatureLink">mxmlContent</a> : Array<div class="summaryTableDescription"> |
| The SplashScreenImageSource sources for this |
| SplashScreenImage.</div></td><td class="summaryTableOwnerCol">SplashScreenImage</td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> <a href="#SplashScreenImage()" class="signatureLink">SplashScreenImage</a>()</div><div class="summaryTableDescription"> |
| Constructor.</div></td><td class="summaryTableOwnerCol">SplashScreenImage</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> <a href="#getImageClass()" class="signatureLink">getImageClass</a>(aspectRatio:String, dpi:Number, resolution:Number):Class</div><div class="summaryTableDescription"> |
| Returns the Class of the SplashScreenImageSource that best matches |
| the specified device parameters.</div></td><td class="summaryTableOwnerCol">SplashScreenImage</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> <a href="#initialized()" class="signatureLink">initialized</a>(document:Object, id:String):void</div><div class="summaryTableDescription"> |
| Called after the implementing object has been created and all |
| component properties specified on the MXML tag have been initialized.</div></td><td class="summaryTableOwnerCol">SplashScreenImage</td></tr></table></div><script language="javascript" type="text/javascript"><!-- |
| showHideInherited(); |
| --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="mxmlContent"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> mxmlContent</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>mxmlContent:Array</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4.6</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>AIR 3</td></tr></table><p></p><p></p><p> |
| The SplashScreenImageSource sources for this |
| <code>SplashScreenImage</code>. |
| |
| Typically you do not call this method directly. |
| Instead, you add SplashScreenImageSource definitions |
| inline in the MXML file of the SplashScreenImage component. |
| |
| </p><br/><span class="label"> Implementation </span><br/><code> public function get mxmlContent():Array</code><br/><code> public function set mxmlContent(value:Array):void</code><br/></div><a name="constructorDetail"></a><div class="detailSectionHeader">Constructor Detail</div><a name="SplashScreenImage()"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> SplashScreenImage</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">Constructor</td></tr></table><div class="detailBody"><code>public function SplashScreenImage()</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4.6</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>AIR 3</td></tr></table><p></p><p> |
| Constructor. |
| |
| </p></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="getImageClass()"></a><a name="getImageClass(String,Number,Number)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> getImageClass</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4.6</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>AIR 3</td></tr></table><p></p><p></p><p> |
| Returns the Class of the SplashScreenImageSource that best matches |
| the specified device parameters. |
| |
| <p>You do not call this method directly; it is called internally by Flex.</p> |
| |
| <p>Override this method in a SplashScreenImage component if you want to override |
| the default Flex logic of picking the best matching SplashScreenImageSource instance.</p> |
| |
| </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">aspectRatio</span>:String</code> — Either <code>flash.display.StageAspectRatio.PORTRAIT</code> or |
| <code>flash.display.StageAspectRatio.LANDSCAPE</code>, whichever is greater. |
| |
| </td></tr><tr><td class="paramSpacer"> </td></tr><tr><td width="20px"></td><td><code><span class="label">dpi</span>:Number</code> — The DPI of the mobile device. |
| |
| </td></tr><tr><td class="paramSpacer"> </td></tr><tr><td width="20px"></td><td><code><span class="label">resolution</span>:Number</code> — The resolution of the mobile device's bigger dimension, in pixels. |
| |
| </td></tr></table></p><p></p><span class="label">Returns</span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20"></td><td><code>Class</code> — The Class for the image to be displayed as a splash screen image. |
| </td></tr></table><p><span class="label">See also</span></p><div class="seeAlso">flash.display.StageAspectRatio</div></div><a name="initialized()"></a><a name="initialized(Object,String)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName"><img src="../../images/AirIcon12x12.gif" width="12" height="12" hspace="0" vspace="0" alt="AIR-only" title="Only available in the AIR runtime"> initialized</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function initialized(document:Object, id:String):void</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 4.6</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>AIR 3</td></tr></table><p></p><p></p><p> |
| Called after the implementing object has been created and all |
| component properties specified on the MXML tag have been initialized. |
| </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">document</span>:Object</code> — The MXML document that created this object. |
| </td></tr><tr><td class="paramSpacer"> </td></tr><tr><td width="20px"></td><td><code><span class="label">id</span>:String</code> — The identifier used by <code>document</code> to refer |
| to this object. |
| If the object is a deep property on <code>document</code>, |
| <code>id</code> is null. |
| |
| </td></tr></table></p></div><a name="includeExamplesSummary"></a><div class="detailSectionHeader">Examples</div><div class="exampleHeader">DynamicSplashScreenExample1.mxml</div><div class="detailBody"><div class="listing"><pre><?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <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> |
| </pre></div></div><div class="exampleHeader">DynamicSplashScreenExample1HomeView.mxml</div><div class="detailBody"><div class="listing"><pre><?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <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> |
| </pre></div></div><div class="exampleHeader">SplashScreenImage1.mxml</div><div class="detailBody"><div class="listing"><pre><?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <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> |
| </pre></div></div><br/><br/><hr><br/><p></p><center class="copyright"><footer>The Apache Software Foundation</footer><br/>Wed Nov 15 2017, 09:50 AM +01:00 </center></div></body></html><!--The Apache Software Foundation<br/>Wed Nov 15 2017, 09:50 AM +01:00 --> |