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  PureMVC Manifold / Standard Version / Re: RetrieveProxy Returning NULL on: September 12, 2008, 01:26:03
Forget about it I was Registering the Mediators First!!!!!!!!!!!!!!! Dumb :( ... well it happens.
2  PureMVC Manifold / Standard Version / Re: RetrieveProxy Returning NULL on: September 12, 2008, 01:12:41
Hi,

I'm having the exact same problem. But haven't managed to sort it out and fix it.

I have two proxies and both of them return NULL using the standard version AS3.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

Don't know what I'm missing :(
Registered from the StartupCommand
:
    facade.registerProxy( new QuestionsProxy() );

From the QuestionsMediator I call it
:
public function QuestionMediator(viewComponent:Object) {
// pass the viewComponent to the superclass where
// it will be stored in the inherited viewComponent property
super(NAME, viewComponent);

// Proxy
_questionProxy = facade.retrieveProxy( QuestionsProxy.NAME ) as QuestionsProxy;
_questionProxy.getQuestions( null ); // CANT access getQuestions object reference is null why>?????

trace(_questionProxy); // Returns NULL
}
:
/*
Proxy - PureMVC
*/
package com.jer.voting.model
{
import org.puremvc.as3.interfaces.IProxy;
import org.puremvc.as3.patterns.proxy.Proxy;

import lib.jer.as3.net.RemoteObject;
import lib.jer.as3.events.RemoteObjectEvent;
import com.jer.voting.ApplicationFacade;

/**
* A proxy
*/
public class QuestionsProxy extends Proxy implements IProxy {

public static const NAME:String = "QuestionsProxy";
private var connection:RemoteObject;
private var gateway:String = ApplicationFacade.GATEWAY;

public function QuestionsProxy(data:Object = null) {
super(NAME, data);
init();
}

private function init():void {
connection = new RemoteObject(gateway);
connection.addEventListener(RemoteObjectEvent.RESULT, onRemoteResult);
connection.addEventListener(RemoteObjectEvent.FAULT, onRemoteFault);
}

private function onRemoteResult(event:RemoteObjectEvent):void {
sendNotification(ApplicationFacade.REMOTE_RESULT, event.data);
}

private function onRemoteFault(event:RemoteObjectEvent):void {
trace("FAULT : " + event);
}

public function getQuestions(s:Object):void {
trace( "Question" );
if (connection) {
trace("SENDING : " + s);
connection.method = "getPoll";
connection.send();
}
}

}
}
Pages: [1]