Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / [OT] from AS3 to UML on: March 02, 2009, 10:42:47
Hi! I've just finished writing the code of the web application written to graduate from my university (using pureMVC off course).
Now I would like to put in my thesis uml structure. Is there any tool to output the UML from pureMVC or AS3 in general?
2  Announcements and General Discussion / General Discussion / Loading multiple information in a command on: January 03, 2009, 03:49:56
Hi, I'm having this problem: I have a loginCommand. Inside this command there is...let's say UserProxy.login which is the real login but then I have to load more information (in my case I have to load the item possesed by the logged user).
So I basically did this.

:
var _userlogin:User = notification.getBody() as User;
var _cuproxy: UsersItemsProxy = facade.retrieveProxy( UsersItemsProxy.NAME ) as UsersItemsProxy;
var _userproxy:UserProxy = facade.retrieveProxy( UserProxy.NAME ) as UserProxy;
_userproxy.login( _userlogin.username, _userlogin.password );
Alert.show(_userproxy.users[0].id);
// here i should load the items possessed by the user

The problem is that the user is loaded AFTER the Alert.show so I have an error of bad index at running time.

I'm using the delegate because I use the service in more proxy.

edit: I saw the AsyncCommand but I don't think it's the right thing to do because the command is just one: login, but I have to load more information from different proxies.
3  Announcements and General Discussion / General Discussion / error 1009, viewstack on: December 29, 2008, 06:26:40
Hi, I'm developing a little project but I have some problem. This application starts with a login view.
The main file looks like this:

:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:view="view.components.*" pageTitle="Tesi"
horizontalAlign="center" verticalAlign="middle"
creationComplete="facade.startup(this);" >
<mx:Script>
    <![CDATA[
import ApplicationFacade;
private var facade: ApplicationFacade = ApplicationFacade.getInstance();
]]>
    </mx:Script>
<mx:Panel width="900" height="500" title="TESI" id="tesi" >
<mx:ViewStack id="appView" width="100%" height="100%" >
    <view:Login id="login" />
    <view:UserProfile id="userprofile" />
    </mx:ViewStack>

</mx:Panel>
</mx:Application>

The main idea is: the user logs in and then the application loads the user data in "userprofile"
It's not working because after logs in (and that's fine) the UserProxy.login function send a notification to the application mediator to switch the view (the procedure is the same used in the login demo: http://puremvc.org/pages/demos/AS3/Demo_AS3_Flex_WebORB_Login/srcview/ ) and send a notification to the UserProfileMediator so the mediator can assign the user information to the component.

UserProfileMediator
:
package view
{
import model.UserProxy;
import model.vo.User;

import mx.controls.Alert;

import org.puremvc.as3.interfaces.IMediator;
import org.puremvc.as3.interfaces.INotification;
import org.puremvc.as3.patterns.mediator.Mediator;

import view.components.UserProfile;

public class UserProfileMediator extends Mediator implements IMediator
{
public static const NAME:String = "UserProfileMediator";

private var _uproxy: UserProxy;

public function UserProfileMediator( viewComponent:UserProfile )
{
super( NAME, viewComponent );
_uproxy = facade.retrieveProxy( UserProxy.NAME ) as UserProxy;
}

override public function listNotificationInterests():Array
{
return [
UserProxy.LOGIN_SUCCEDED
];
}

override public function handleNotification(notification:INotification):void
{
switch(notification.getName())
{
case UserProxy.LOGIN_SUCCEDED:
userprofile._us = _uproxy.users[0] as User; // TypeError: Error #1009: Cannot access a property or method of a null object reference.
break;

default:
}
}

protected function get userprofile():UserProfile
{
return viewComponent as UserProfile;
}
}
}

Here's the error.

And then the UserProfile.mxml
:
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:help="view.components.*"
width="100%" height="100%" borderStyle="solid">
<mx:Script>
<![CDATA[
import model.vo.User;
[Bindable] public var _us: User;
]]>
</mx:Script>
<mx:Label text="{_us.username}" />
</mx:HBox>

Can you help me? I don't know what I'm doing wrong. The "proxy" part is working, the user infos are loaded.
Pages: [1]