Flex PureMVC 的一些小问题
刚学Flex PureMVC这个框架,在网上找了一个小Demo想调试一下,
遇上了下面问题不知道怎么去解决:
Multiple markers at this line:
-1046: 找不到类型,或者它不是编译时常数: ApplicationFacade。
-1120: 访问的属性 ApplicationFacade 未定义。
package com{ import com.superwulei.controller.Startupcommand; import org.puremvc.as3.multicore.interfaces.IFacade; import org.puremvc.as3.multicore.patterns.facade.Facade; public class ApplicationFacade extends Facade implements IFacade { public static const STARTUP:String = "startup"; public static const USER_ADD:String = "user_added"; public static const USER_DELETE:String = "user_delete"; public function ApplicationFacade(key:String){super(key);} public static function getInstance(key:String):ApplicationFacade { if (instanceMap[key] == null)instanceMap[key] = new ApplicationFacade(key);return instanceMap[key]as ApplicationFacade; } public function startup(app:demo):void { sendNotification(STARTUP, app); } override protected function initializeController():void { super.initializeController(); registerCommand(STARTUP, Startupcommand); } } }?
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:component="com.superwulei.view.conponent.*" creationComplete="facade.startup(this);"> <mx:Script> <![CDATA[ import com.ApplicationFacade;private var facade:ApplicationFacade = ApplicationFacade.getInstance("demo"); ]]> </mx:Script> <component:UserForm id="userForm"/> <component:UserList id="userList"/> </mx:Application>?
?
1 楼 SeaInSeashell 2011-04-13 嘿嘿,我踩应该是没有org.puremvc.as3.multicore.patterns.facade.Facade这个吧!把这个org这个包加进去就可以了.....