|
|
Show Posts
|
Pages: [1] 2
|
1
|
Announcements and General Discussion / Getting Started / Re: I have smaller and now needed one big application
|
on: September 30, 2009, 11:56:43
|
Ok, I made simple module HelloModule like a separate project. And I created project that I attached here and move HelloModule to this project like PipesWorks demo. I want to have one button on my shell project that when I click on it starts my Hello module. Hello module have one button which popup Alert with some message. I want to understand how this mechanism work so I can add more and more modules to shell project. Problem: When I click on hello button that should print Alert message it tells me that this button is null. I believe that my problem is because I didn't add any Junction to shell or module project I don't know how to do this . But this HelloModule when it is in separate project works.
|
|
|
5
|
Announcements and General Discussion / Getting Started / Re: I have smaller and now needed one big application
|
on: September 22, 2009, 07:49:21
|
Lucky me, this is training project Ok, I transfer all my simple applications to the multycore PureMVC, it works, fine. But now I don't have any idea how to combine this. I saw 'modularity' project. And I try to add my simple app there but... I add same widget component like others and I get button but that i snot my component. I am not sure that I understand how to create modular app. Is there any simpler tutorial/project?
|
|
|
7
|
Announcements and General Discussion / Getting Started / Re: Native window and PureMVC
|
on: August 18, 2009, 04:41:30
|
Ok, but my current component is something like popup (it is my update window). Where to register mediator for it? I send notification from startup command to see if there is new version and based on result this native window should be opened, but I need to register mediator somehow or application break.
faca.registerMediator(new myNativeComponent(?));
|
|
|
8
|
Announcements and General Discussion / Getting Started / Native window and PureMVC
|
on: August 14, 2009, 05:46:35
|
I make NativeWindow component (based on script from TourDeFlex application). But I don't know how to implement PureMVC on native component. Is there any code sample, or can somebody show some simple viewComponent-mediator example. Just how to catch event from button from native component.
Thanks
|
|
|
9
|
Announcements and General Discussion / Getting Started / Re: App update and PureMVC - urgent
|
on: August 14, 2009, 05:43:31
|
Nope, not my error (partly). A little bug in PureMVC.
A have made View component and mediator. But in mediator:
override public function listNotificationInterests():Array { return null; }
instead
return [];
Because of this I received following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at org.puremvc.as3.multicore.core::View/registerMediator()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:193] at org.puremvc.as3.multicore.patterns.facade::Facade/registerMediator()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:227] at org.puremvc.as3.multicore.patterns.proxy::PopManagerProxy/openPopUpWindow()[D:\workspace\workspace-flex\SpinnakerFlexLib\src\org\puremvc\as3\multicore\patterns\proxy\PopManagerProxy.as:44] at org.puremvc.as3.multicore.patterns.proxy::PopManagerProxy/retrievePopUp()[D:\workspace\workspace-flex\SpinnakerFlexLib\src\org\puremvc\as3\multicore\patterns\proxy\PopManagerProxy.as:79] at com.spinnaker.poppo.control::UpdaterCommand/execute()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\control\UpdaterCommand.as:24] at org.puremvc.as3.multicore.core::Controller/executeCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\Controller.as:117] at Function/http://adobe.com/AS3/2006/builtin::apply() at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100] at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127] at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294] at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277] at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60] at com.poppo.main.control::StartupCommand/execute()[D:\poppo_projekat\poppo\trunk\air\src\com\poppo\main\control\StartupCommand.as:125] at org.puremvc.as3.multicore.core::Controller/executeCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\Controller.as:117] at Function/http://adobe.com/AS3/2006/builtin::apply() at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100] at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127] at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294] at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277] at com.spinnaker.poppo::ApplicationFacade/startup()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\ApplicationFacade.as:61] at Poppo/initApp()[D:\poppo_projekat\poppo\trunk\air\src\Poppo.mxml:72] at Poppo/___Poppo_WindowedApplication1_applicationComplete()[D:\poppo_projekat\poppo\trunk\air\src\Poppo.mxml:11] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308] at mx.managers::SystemManager/preloader_preloaderDoneHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3024] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:434] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1451] at mx.preloaders::DownloadProgressBar/initCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1503] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:291] at mx.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:442] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308] at mx.core::UIComponent/set initialized()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] at mx.managers::LayoutManager/validateNow()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:748] at mx.core::UIComponent/commitCurrentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7200] at mx.core::UIComponent/setCurrentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7118] at mx.core::UIComponent/set currentState()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:4361] at com.spinnaker.poppo.view.child.components::ApplicationBottomBar/init()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\view\child\components\ApplicationBottomBar.mxml:25] at com.spinnaker.poppo.view.child.components::ApplicationBottomBar/___ApplicationBottomBar_Canvas1_creationComplete()[D:\poppo_projekat\poppo\trunk\air\src\com\spinnaker\poppo\view\child\components\ApplicationBottomBar.mxml:4] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9308] at mx.core::UIComponent/set initialized()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8633] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.3.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8573]
It would be much better to throw some error information, "You cannot return null from this method. .."
|
|
|
10
|
Announcements and General Discussion / Getting Started / App update and PureMVC - urgent
|
on: August 14, 2009, 02:34:02
|
Hi,
I need to add update functionlity. I have everything ready but I put my first call to update method in startup command like this: sendNotification(UpdaterCommand.UPDATE); this should open update popup (if there is update) and rest is up to user. Problem... I receive bunch of errors and my view component and mediator are not connected properly.
Where is the best place to put call to update command?
|
|
|
12
|
Announcements and General Discussion / Getting Started / StartupCommand can't see view component
|
on: July 09, 2009, 07:50:00
|
Sometime happens that I try to register new component (mxml) with mediator in PrepViewCommand, and when I type app. there is no my component, what could be reason for this?
cmpPizzaOrderWindow is the problem...
public class PrepViewCommand extends SimpleCommand implements ICommand { override public function execute(notification:INotification):void { var app:DemoComboWithPureMVC = notification.getBody() as DemoComboWithPureMVC; facade.registerMediator(new PizzaOrderWindowMediator(app.cmpPizzaOrderWindow)); } }
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="view.components.*"> <mx:Script> <![CDATA[ private static const NAME:String="DemoComboWithPureMVC";
private var facade:ApplicationFacade=ApplicationFacade.getInstance(NAME);
private function init():void { facade.startup(this); } ]]> </mx:Script> <components:PizzaOrderWindow id="cmpPizzaOrderWindow" x="250.5" y="10"/> </mx:WindowedApplication>
|
|
|
13
|
Announcements and General Discussion / Getting Started / popup question
|
on: July 02, 2009, 01:10:19
|
How to register mediator for popup? I dont know what parameter to pass in: facade.registerMediator(new DetailsPopupMediaotr(???));
I use the following popup class, I wonder is this one http://www.nutrixinteractive.com/blog/?p=329 better, somehow? package util.popup { import flash.display.DisplayObject; import flash.display.Sprite;
import mx.core.Application; import mx.core.IFlexDisplayObject; import mx.managers.PopUpManager;
import org.puremvc.as3.multicore.patterns.facade.Facade;
/** * Used to handle popup opening controling registering and unregistering mediators * * @author */
public class PopManager extends PopUpManager { private static var popupList:Array=new Array();
/** * Opens a popup window. Window component is crated and mediator is assigned to it. * Targeted for PureMVC multicore so method requires moduleId to be passed */ public static function openPopUpWindow(ComponentClass:Class, MediatorClass:Class, moduleUid:String, modal:Boolean=true, parent:DisplayObject=null):IFlexDisplayObject { if (parent == null) { parent=Application.application as DisplayObject; } var window:IFlexDisplayObject=PopUpManager.createPopUp(parent, ComponentClass, modal); var obj:Facade=Facade.getInstance(moduleUid)as Facade;
obj.registerMediator(new MediatorClass(window)); PopUpManager.centerPopUp(window); return window; }
/** * Removes PopUp window and unregisteres associated mediator */ public static function closePopUpWindow(window:IFlexDisplayObject, mediatorName:String, moduleUid:String):void { PopUpManager.removePopUp(window); Facade.getInstance(moduleUid).removeMediator(mediatorName); }
/** * * Tries to retrieve popup window from the list of popups already opened. If there is no window opened with * provided mediator name associated with it, a new one is created and displayed. */ public static function retrievePopUp(ComponentClass:Class, MediatorClass:Class, mediatorName:String, moduleUid:String, modal:Boolean=true):IFlexDisplayObject { if (popupList[mediatorName]) { PopUpManager.addPopUp(popupList[mediatorName]as IFlexDisplayObject, Application.application as Sprite, modal); PopUpManager.bringToFront(popupList[mediatorName]); } else { popupList[mediatorName]=openPopUpWindow(ComponentClass, MediatorClass, moduleUid, modal) } return popupList[mediatorName]; }
/** * Removes popup from display list. The actual popup object still exists in the list and can be retrieved */ public static function hidePopUp(window:IFlexDisplayObject, mediatorName:String):void { PopUpManager.removePopUp(window); }
/** * Removes the popup completle. Also unregisters mediator. */ public static function destroyPopUp(window:IFlexDisplayObject, mediatorName:String, moduleUid:String):void { closePopUpWindow(window, mediatorName, moduleUid);
if (popupList[mediatorName]) { popupList[mediatorName]=null; } } }
}
|
|
|
15
|
Announcements and General Discussion / Getting Started / Re: Where should data be stored
|
on: June 23, 2009, 11:43:59
|
loginUserData is always null when I try to call it from mediator ------------------------------ LoginCommand public class LoginCommand extends SimpleCommand implements ICommand { override public function execute(notification:INotification):void { var myUser:User = notification.getBody() as User; var loginProxy:LoginProxy; loginProxy = facade.retrieveProxy(LoginProxy.NAME) as LoginProxy; loginProxy.tryLogin(myUser.username, myUser.password); } }
LoginProxy public class LoginProxy extends Proxy implements IProxy { public static const NAME:String = "loginProxy"; private var loginRemoteService:RemoteObject; public function LoginProxy() { super(NAME, new User()); } override public function onRegister():void { loginRemoteService = new RemoteObject("fluorine"); loginRemoteService.source = "BL.Sample"; loginRemoteService.LoginUserByEnteredData.addEventListener(ResultEvent.RESULT, onResult); loginRemoteService.addEventListener(FaultEvent.FAULT, onFault); } private function onResult(evt:ResultEvent):void { data = evt.result as User; sendNotification(ApplicationFacade.LOGIN_SUCCESFUL, loginUserData); } private function onFault(evt:FaultEvent):void { sendNotification(ApplicationFacade.LOGIN_FAILED); } public function get loginUserData():User { return data as User; } public function tryLogin(p1:String, p2:String):void { loginRemoteService.LoginUserByEnteredData(p1, p2); } }
Mediator override public function handleNotification(notification:INotification):void { switch (notification.getName()) { case ApplicationFacade.LOGIN_SUCCESFUL: var uProxy:LoginProxy; uProxy = facade.retrieveProxy(LoginProxy.NAME) as LoginProxy; var u:User = notification.getBody() as User; Alert.show("welcome: " + u.realName+ ", " + u.City); break; case ApplicationFacade.LOGIN_FAILED: Alert.show("sorry pal, wrong password"); break; } }
|
|
|
|
|