Packagejp.nium.utils
Classpublic final class StageUtil
InheritanceStageUtil Inheritance Object

StageUtil クラスは、Stage 操作のためのユーティリティクラスです。 StageUtil クラスを直接インスタンス化することはできません。 new StageUtil() コンストラクタを呼び出すと、ArgumentError 例外がスローされます。 The StageUtil class is an utility class for stage operation. StageUtil class can not instanciate directly. When call the new StageUtil() constructor, the ArgumentError exception will be thrown.



Public Methods
 MethodDefined By
  
getDocument(stage:Stage):Sprite
[static] SWF ファイル書き出し時にドキュメントとして設定されたクラスを返します。 Returns the class that set as document when writing the SWF file.
StageUtil
  
getMarginLeft(stage:Stage):Number
[static] ステージの左マージンを取得します。 Get the left margin of the stage.
StageUtil
  
getMarginTop(stage:Stage):Number
[static] ステージの上マージンを取得します。 Get the top margin of the stage.
StageUtil
  
toSWFBasePath(stage:Stage, url:String):String
[static] 指定された URL ストリングを SWF ファイルの設置されているフォルダを基準とした URL に変換して返します。 絶対パスが指定された場合には、そのまま返します。 Translate the specified URL string to the URL based on the folder where the SWF file is setting.
StageUtil
Method Detail
getDocument()method
public static function getDocument(stage:Stage):Sprite

SWF ファイル書き出し時にドキュメントとして設定されたクラスを返します。 Returns the class that set as document when writing the SWF file.

Parameters

stage:Stageドキュメントを保存している stage インスタンスです。 The stage instance which save the document.

Returns
Spriteドキュメントとして設定された表示オブジェクトです。 The display object that set as document.

Example
         var documentRoot:Sprite = getDocument( stage );
         trace( documentRoot.root == documentRoot ); // true
         
getMarginLeft()method 
public static function getMarginLeft(stage:Stage):Number

ステージの左マージンを取得します。 Get the left margin of the stage.

Parameters

stage:Stageマージンを取得したい stage インスタンスです。 The stage instance to get the margin.

Returns
Number左マージンです。 The left margin.

Example
         
getMarginTop()method 
public static function getMarginTop(stage:Stage):Number

ステージの上マージンを取得します。 Get the top margin of the stage.

Parameters

stage:Stageマージンを取得したい stage インスタンスです。 The stage instance to get the margin.

Returns
Number上マージンです。 The top margin.

Example
         
toSWFBasePath()method 
public static function toSWFBasePath(stage:Stage, url:String):String

指定された URL ストリングを SWF ファイルの設置されているフォルダを基準とした URL に変換して返します。 絶対パスが指定された場合には、そのまま返します。 Translate the specified URL string to the URL based on the folder where the SWF file is setting. In case it specified the absolute path, it will return as is.

Parameters

stage:Stage基準となる SWF ファイルの stage インスタンスです。 The Stage instance of the SWF file to be the baseine.
 
url:String変換したい URL のストリング表現です。 The URL string representation to translate.

Returns
String変換された URL のストリング表現です。 The URL string representation which translated.