メソッド | プロパティ | エフェクト | イベント | スタイル | フレームあり | フレームなし

mx.controls
Alert クラス

継承を示す線継承を示す線継承を示す線継承を示す線継承を示す線継承を示す線継承を示す線


Alert クラス
mx.containers.Panel の拡張

Alert コントロールは、タイトル、ボタン ([OK] や [Cancel] など)、およびアイコンを含むポップアップダイアログボックスです。通常、アプリケーションプログラマが、システムに予期しないイベントが発生したことを伝えるために使用します。

Alert コントロールを表示するには、静的な show() メソッドを使用します。また便宜上、Application.alert() を使用することもできます。

を参照するにはここをクリックしてください

関連項目
    mx.managers.SystemManager
    mx.managers.PopUpManager
    alertClasses.AlertForm



メソッド
       getViewMetrics( ) :  Object
境界線、タイトルバー、およびスクロールバー (表示されている場合) を含め、[Alert] ダイアログの縁の線の太さを取得します。
staticshow( text:String, title:String, flags:Number, parent:MovieClip, listener, icon:String, defButton:Number) :  mx.controls.Alert
タイトル、メッセージ、および要求されたボタンの付いた Alert コントロールを表示する静的メソッドです。

mx.containers.Panel クラスから継承されるメソッド
deletePopUp   getViewMetrics   measure  

mx.containers.Box クラスから継承されるメソッド
layoutChildren   measure   pixelsToPercent   setRelativeChildHeights   setRelativeChildWidths  

mx.containers.Container クラスから継承されるメソッド
createChildren   draw   executeChildBindings   getViewMetrics   getViewMetricsAndMargins   init  

mx.core.View クラスから継承されるメソッド
childLoaded   constructObject2   createChild   createChildren   destroyAllChildren   destroyChild   destroyChildAt   draw   getBorderMetrics   getChildAt   getChildIndex   getViewMetrics   init   layoutChildren   layoutChrome   setChildIndex  

mx.core.UIComponent クラスから継承されるメソッド
drawFocus   getFocus   getFocusManager   setEnabled   setFocus  

mx.core.UIObject クラスから継承されるメソッド
addEventListener   applyProperties   buildDepthTable   commitProperties   constructObject2   createAccessibilityImplementation   createChildAtDepth   createChildren   createClassChildAtDepth   createClassObject   createEmptyObject   destroyObject   dispatchEvent   doLater   draw   drawRect   executeBindings   fillRect   findNextAvailableDepth   getRepeaterItem   getStyle   handleEvent   init   invalidate   invalidateLayout   invalidateProperties   invalidateSize   invalidateStyle   layoutChildren   measure   move   redraw   removeEventListener   setDepthAbove   setDepthBelow   setMask   setSize   setSizeNoLayout   setStyle   swapDepths  



プロパティ
staticbuttonHeight:Number
Alert ボタンの高さをピクセル単位で表します。
staticbuttonStyleDeclaration:String
ボタンテキストのスタイル宣言の名前です。
staticbuttonWidth:Number
Alert ボタンの幅をピクセル単位で表します。
staticCANCEL:Number
Alert の [Cancel] ボタンを有効にするために使用するフラグです。
staticcancelLabel:String
[Cancel] ボタンのラベルです。
staticmessageStyleDeclaration:String
メッセージテキストのスタイル宣言の名前です。
staticNO:Number
Alert の [No] ボタンを有効にするために使用するフラグです。
staticnoLabel:String
[No] ボタンのラベルです。
staticOK:Number
Alert の [OK] ボタンを有効にするために使用するフラグです。
staticokLabel:String
[OK] ボタンのラベルです。
statictitleStyleDeclaration:String
タイトルバーのテキストのスタイル宣言の名前です。
staticversion:String
このクラスのバージョンを表すストリングです。
staticYES:Number
Alert の [Yes] ボタンを有効にするために使用するフラグです。
staticyesLabel:String
[Yes] ボタンのラベルです。

mx.containers.Panel クラスから継承されるプロパティ
className   status   statusStyleDeclaration   title   titleStyleDeclaration   version  

mx.containers.Box クラスから継承されるプロパティ
direction  

mx.containers.Container クラスから継承されるプロパティ
autoLayout   childDescriptors   className   clipContent   creationIndex   creationPolicy   defaultButton   hLineScrollSize   hPageScrollSize   hPosition   hScrollPolicy   icon   label   maxHPosition   maxVPosition   numRepeaters   version   vLineScrollSize   vPageScrollSize   vPosition   vScrollPolicy  

mx.core.View クラスから継承されるプロパティ
baselinePosition   className   numChildren   version  

mx.core.UIComponent クラスから継承されるプロパティ
enabled   errorString   tabEnabled   tabIndex   version  

mx.core.UIObject クラスから継承されるプロパティ
alpha   baselinePosition   className   depth   documentDescriptor   height   heightFlex   id   instanceIndices   isDocument   kStretch   layoutHeight   layoutWidth   maxHeight   maxWidth   minHeight   minWidth   mouseX   mouseY   nestLevel   oldHeight   oldWidth   oldX   oldY   parent   parentApplication   parentDocument   percentHeight   percentWidth   preferredHeight   preferredWidth   repeaterIndices   scaleX   scaleY   styleName   tabEnabled   toolTip   version   visible   width   widthFlex   x   y  



エフェクト

mx.containers.Panel クラスから継承されるエフェクト
resizeEndEffect   resizeStartEffect  

mx.core.UIComponent クラスから継承されるエフェクト
focusInEffect   focusOutEffect  

mx.core.UIObject クラスから継承されるエフェクト
creationCompleteEffect   hideEffect   mouseDownEffect   mouseOutEffect   mouseOverEffect   mouseUpEffect   moveEffect   resizeEffect   showEffect  



イベント

mx.containers.Panel クラスから継承されるイベント
click  mouseDownOutside 

mx.containers.Container クラスから継承されるイベント
childrenCreated  scroll 

mx.core.View クラスから継承されるイベント
childCreated  childDestroyed  childIndexChanged 

mx.core.UIComponent クラスから継承されるイベント
focusIn  focusOut  invalid  keyDown  keyUp  valid  valueCommitted 

mx.core.UIObject クラスから継承されるイベント
creationComplete  dragComplete  dragDrop  dragEnter  dragExit  dragOver  draw  effectEnd  effectStart  hide  hideToolTip  initialize  load  mouseChangeSomewhere  mouseDown  mouseDownSomewhere  mouseMove  mouseMoveSomewhere  mouseOut  mouseOver  mouseUp  mouseUpSomewhere  move  resize  show  showToolTip  unload 



スタイル

mx.containers.Panel クラスから継承されるスタイル
cornerRadius   dropShadow   footerColors   headerColors   headerHeight   panelBorderStyle   shadowDirection   shadowDistance  

mx.containers.Box クラスから継承されるスタイル
horizontalAlign   horizontalGap   marginBottom   marginTop   verticalAlign   verticalGap  

mx.core.UIComponent クラスから継承されるスタイル
backgroundAlpha   backgroundColor   backgroundDisabledColor   backgroundImage   backgroundSize   barColor   borderCapColor   borderColor   borderSides   borderStyle   borderThickness   cornerRadius   disabledColor   dropShadow   errorColor   fillColors   highlightColor   modalTransparency   scrollTrackColor   selectedFillColors   shadowCapColor   shadowColor   shadowDirection   shadowDistance   symbolBackgroundColor   symbolBackgroundDisabledColor   symbolBackgroundPressedColor   symbolColor   symbolDisabledColor   themeColor  

mx.core.UIObject クラスから継承されるスタイル
color   fontFamily   fontSize   fontStyle   fontWeight   horizontalGap   leading   marginLeft   marginRight   textAlign   textDecoration   textIndent   verticalGap  



メソッドの詳細

getViewMetrics

getViewMetrics( ) :  Object

境界線、タイトルバー、およびスクロールバー (表示されている場合) を含め、[Alert] ダイアログの縁の線の太さを取得します。

戻り値
     左端、右端、上端、および下端の太さがピクセル数で指定されたオブジェクトです。


show

static  show( text:String, title:String, flags:Number, parent:MovieClip, listener, icon:String, defButton:Number) :  mx.controls.Alert

タイトル、メッセージ、および要求されたボタンの付いた Alert コントロールを表示する静的メソッドです。

メモ : Alert.show() メソッドと Application.alert() メソッドは、似ているように見えますが、パラメータの順序は異なります。

また、icon はコントロール内に表示されるイメージファイルへの URL になります。イメージの種類には JPEG、GIF、PNG、BMP、SWF などがあります。このプロパティでは次の形式を使用します。
icon="@Embed('relOrAbsoluteURL')"
参照されたイメージは、Flex がアプリケーション用 SWF ファイルを生成するコンパイル時に、生成済み SWF ファイルにパッケージ化されます。

パラメータ
    text:String - Alert コントロールに表示されるテキストストリングです。
    title:String - タイトルバーのテキストストリングです。
    flags:Number - どのボタンを Alert コントロールに配置するかを示します。有効な値は、YES、NO、CANCEL、OK です。複数のボタンを有効にするには、ビット単位の OR 演算子を使用します。たとえば、(Alert.YES | Alert.NO) のように使用します。
    parent:MovieClip - Alert コントロールが中央に配置されるオブジェクトです。
    listener - Alert コントロール上のボタンが押されたときにトリガされるオブジェクトです。このオブジェクトを正しく呼び出すためには、オブジェクトに click() メソッドがあることが必要です。
    icon:String - Alert コントロール内のテキストの左に配置されるアイコンです。
    defButton:Number - デフォルトボタンです。YES、NO、CANCEL、OK のいずれかになります。



プロパティの詳細

buttonHeight

static  buttonHeight:Number  

Alert ボタンの高さをピクセル単位で表します。デフォルト値は 22 ピクセルです。


buttonStyleDeclaration

static  buttonStyleDeclaration:String  

ボタンテキストのスタイル宣言の名前です。


buttonWidth

static  buttonWidth:Number  

Alert ボタンの幅をピクセル単位で表します。デフォルト値は 50 ピクセルです。


CANCEL

static  CANCEL:Number  

Alert の [Cancel] ボタンを有効にするために使用するフラグです。


cancelLabel

static  cancelLabel:String  

[Cancel] ボタンのラベルです。デフォルト値は "Cancel" です。


messageStyleDeclaration

static  messageStyleDeclaration:String  

メッセージテキストのスタイル宣言の名前です。


NO

static  NO:Number  

Alert の [No] ボタンを有効にするために使用するフラグです。


noLabel

static  noLabel:String  

[No] ボタンのラベルです。デフォルト値は "No" です。


OK

static  OK:Number  

Alert の [OK] ボタンを有効にするために使用するフラグです。


okLabel

static  okLabel:String  

[OK] ボタンのラベルです。デフォルト値は "OK" です。


titleStyleDeclaration

static  titleStyleDeclaration:String  

タイトルバーのテキストのスタイル宣言の名前です。


version

static  version:String  

このクラスのバージョンを表すストリングです。


YES

static  YES:Number  

Alert の [Yes] ボタンを有効にするために使用するフラグです。


yesLabel

static  yesLabel:String  

[Yes] ボタンのラベルです。デフォルト値は "Yes" です。


SimpleAlert.mxml
<?xml version="1.0"?>
<!-- Alert コントロールの使用方法を示す簡単な例 -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">

<mx:Script>
<![CDATA[
        
import mx.controls.Alert;
       
/** イベントハンドラ関数です。Alert コントロールを読み込み、静的メソッドを使用して
タイトル、メッセージ、および要求されたボタンが付いたポップアップウィンドウを示します。
        **/        
function Alerted()
        {
Alert.show("You have been alerted !!", "Alert Box",Alert.OK);
        }
    
    ]]>
    
</mx:Script>

<mx:Panel title="Alert Panel" marginTop="10">

<mx:Button label="Alert me" click="Alerted();"/>

</mx:Panel>

</mx:Application>