Flexbuilder を使用して次の mxml ファイルを実行しようとすると、エラー メッセージが表示されます
1046: タイプが見つからないか、コンパイル時の定数ではありません: AlertDataObject。
このコードは main.mxml ファイルからのものです
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
horizontalAlign="center"
verticalAlign="middle"
xmlns:components="components.*"
xmlns:ConferenceRequestForm="components.core.ConferenceRequestForm.*"
xmlns:ConferenceHomeScreen="components.core.ConferenceHomeScreen.*"
xmlns:ConferenceLoginForm="components.core.ConferenceLoginForm.*"
xmlns:debug="components.debug.*"
xmlns:RandomUserMaker="components.debug.RandomUserMaker.*"
xmlns:RandomConferenceMaker="components.debug.RandomConferenceMaker.*"
initialize="initializeApplication();"
creationComplete="openConferenceHomeScreen();">
<mx:Script>
<![CDATA[
import flash.events.MouseEvent;
public function debugButtonHandler(event:MouseEvent):void{
userCredentials.logIn('admin', 'admin', "John", "Admin", 7, 99,0)
openReportsForm();
}
]]>
</mx:Script>
<mx:Button label="Debug Button" id="debugButton_btn" click="debugButtonHandler(event);" enabled="true" visible="false"/>
<RandomConferenceMaker:RandomConferenceMaker id="rcm" visible="false"/>
<RandomUserMaker:RandomUserMaker id="rum" visible="false"/>
<mx:Script source="../classes/ConferenceApp_action.as"/>
</mx:Application>
これはConferenceApp_action.asファイルの先頭で、 AlertDataObjectに失敗しているクラスを定義しているクラスへのインポートを含む、ほとんどのアプリケーション ロジックが含まれています。
//Built-In Classes
import mx.managers.PopUpManager;
//events
import mx.events.CloseEvent;
//custom events
import classes.AlertDataObject;
これは、エラーを作成しているConferenceApp_action.asファイル内の行です。
private function showChoiceWindow(data:AlertDataObject):void{
.
.
.
}
これは AlertDataObject クラスです。
package classes
{
public class AlertDataObject
{
/****************
Constants
****************/
static public var TITLE_ALERT:String = "Alert";
static public var TITLE_CONFIRM:String = "Please Confirm";
static public var TITLE_DEBUG:String = "Debug";
static public var TITLE_SUCCESS:String = "Success";
static public var TITLE_FAILURE:String = "Failure";
static public var TITLE_ERROR:String = "Error";
/****************
Properties
****************/
private var __title:String;
private var __text:String;
.
.
/****************
Getters / Setters
****************/
public function get title():String{
return __title;
}
.
.
.
/****************
Constructor
****************/
public function AlertDataObject($text:String, $title:String="Alert", $yesFunction:Function=null, $yesFunctionArguments:Object=null, $noFunction:Function=null, $noFunctionArguments:Object=null, $dataProvider:Object=null, $icon:Class=null){
//store basic props
__title = $title;
__text = $text;
//store confirm props
__yesFunction = $yesFunction;
__yesFunctionArguments = $yesFunctionArguments;
__noFunction = $noFunction;
__noFunctionArguments = $noFunctionArguments;
//store dataProvider object
__dataProvider = $dataProvider;
//store misc. props
__icon = $icon;
}
}
}
Flex が AlertDataObject クラスを正しく認識しないのはなぜですか?