| パッケージ | spark.preloaders |
| クラス | public class SplashScreenImage |
| 継承 | SplashScreenImage Object |
| 実装 | IMXMLObject |
| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.6 |
| ランタイムバージョン: | AIR 3 |
通常、SplashScreenImage クラスは MXML ファイルに定義します。 SplahsScreenImageSource クラスを使用して、様々なイメージの選択肢および対応するデバイス構成を定義します。 次に、アプリケーションの splashScreenImage プロパティに SplashScreenImage MXML コンポーネントの名前を設定します。
どの SplahsScreenImageSource 定義がモバイルデバイスに最もよく一致するかを決定する手順は次のとおりです。
- モバイルデバイスの設定に一致するすべての SplashScreenImageSource 定義を特定します。 次の場合に一致します。
- SplashScreenImageSource 定義に、その設定が明示的に定義されていない場合。 例えば、
dpiプロパティが設定されていなければ、どのデバイスの DPI とも一致します。 -
dpiまたはaspectRatioプロパティの場合は、モバイルデバイスの対応する設定にプロパティが正確に一致する必要があります。 -
minResolutionプロパティの場合、Stage.stageWidthおよびStage.stageHeightプロパティの大きいほうが、minResolution以上であれば、デバイスの設定とプロパティが一致します。
- SplashScreenImageSource 定義に、その設定が明示的に定義されていない場合。 例えば、
- デバイスと一致する SplashScreenImageSource 定義が複数ある場合は、次のようにします。
- 明示的な設定の数が一番多いものを選択します。 例えば、
dpiとaspectRatioの両方のプロパティが指定された SplashScreenImageSource 定義は、dpiプロパティのみが指定された定義よりもよく一致しています。 - それでも複数の一致がある場合は、
minResolution値が一番高いものを選択します。 - それでも複数の一致がある場合は、コンポーネントで最初に定義されているものを選択します。
- 明示的な設定の数が一番多いものを選択します。 例えば、
メモ:このクラスは、アプリケーションの MXML にインラインで設定することはできません。 別の MXML ファイルに定義して、アプリケーションの splashScreenImage プロパティを使用して参照する必要があります。
MXML シンタックスを隠す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>
デフォルトの MXML プロパティmxmlContent
関連する API エレメント
| プロパティ | 定義元 | ||
|---|---|---|---|
![]() | constructor : Object
指定されたオブジェクトインスタンスのクラスオブジェクトまたはコンストラクター関数への参照です。 | Object | |
| mxmlContent : Array
この SplashScreenImage の SplashScreenImageSource のソースです。 | SplashScreenImage | ||
| メソッド | 定義元 | ||
|---|---|---|---|
コンストラクターです。 | SplashScreenImage | ||
指定したデバイスパラメーターに最も一致する SplashScreenImageSource のクラスを返します。 | SplashScreenImage | ||
![]() |
オブジェクトに指定されたプロパティが定義されているかどうかを示します。 | Object | |
実装オブジェクトが作成され、MXML タグに指定されたすべてのコンポーネントプロパティが初期化された後に呼び出されます。 | SplashScreenImage | ||
![]() |
Object クラスのインスタンスが、パラメーターとして指定されたオブジェクトのプロトタイプチェーン内にあるかどうかを示します。 | Object | |
![]() |
指定されたプロパティが存在し、列挙できるかどうかを示します。 | Object | |
![]() |
ループ処理に対するダイナミックプロパティの可用性を設定します。 | Object | |
![]() |
ロケール固有の規則に従って書式設定された、このオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのストリング表現を返します。 | Object | |
![]() |
指定されたオブジェクトのプリミティブな値を返します。 | Object | |
mxmlContent | プロパティ |
mxmlContent:Array| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.6 |
| ランタイムバージョン: | AIR 3 |
この SplashScreenImage の SplashScreenImageSource のソースです。通常、このメソッドは直接呼び出さないでください。代わりに、SplashScreenImageSource 定義をインラインで SplashScreenImage コンポーネントの MXML ファイルに追加します。
実装
public function get mxmlContent():Array public function set mxmlContent(value:Array):void SplashScreenImage | () | コンストラクター |
public function SplashScreenImage()| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.6 |
| ランタイムバージョン: | AIR 3 |
コンストラクターです。
getImageClass | () | メソッド |
public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.6 |
| ランタイムバージョン: | AIR 3 |
指定したデバイスパラメーターに最も一致する SplashScreenImageSource のクラスを返します。
このメソッドは直接呼び出さないでください。Flex で内部的に呼び出されます。
最も一致する SplashScreenImageSource インスタンスを選択する Flex のデフォルトロジックをオーバーライドする必要がある場合は、SplashScreenImage コンポーネントのこのメソッドをオーバーライドします。
パラメーター
aspectRatio:String — flash.display.StageAspectRatio.PORTRAIT または flash.display.StageAspectRatio.LANDSCAPE のうちの大きいほうです。
| |
dpi:Number — モバイルデバイスの DPI です。
| |
resolution:Number — モバイルデバイスの大きいほうのサイズのピクセル単位の解像度です。
|
Class — スプラッシュ画面イメージとして表示されるイメージのクラスです。
|
関連する API エレメント
initialized | () | メソッド |
public function initialized(document:Object, id:String):void| 言語バージョン: | ActionScript 3.0 |
| 製品バージョン: | Flex 4.6 |
| ランタイムバージョン: | AIR 3 |
実装オブジェクトが作成され、MXML タグに指定されたすべてのコンポーネントプロパティが初期化された後に呼び出されます。
パラメーター
document:Object — このオブジェクトを作成した MXML ドキュメントです。
| |
id:String — document がこのオブジェクトを参照するために使用する識別子です。オブジェクトが document の deep プロパティである場合、id は 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, 10:34 AM Z
MXML シンタックスを表示