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 / stage in flex and the stage mediator on: October 13, 2009, 07:00:18
I'm stuck with trying to get a text field for example in any view class in flex.
here is the thread in some detail but I feel I need to get hold of the distinction between flash and flex and the stage.

I'm used to getting the reftostage passed to the main stage mediator but I'm told I cannot add stuff to the stage in the normal flash way....here is the link


2  PureMVC Manifold / Standard Version / difference between flex and flash on: October 06, 2009, 03:54:05
I noticed that in flex the view components are created from the main application mxml you can then have components registered to mediators.

In flash the stage component items or views are instantiated from the stage mediator, I'm wondering what this means for me trying to get to grips with flex as a flash guy. If there any specific difficulties conceptually I might face.
3  PureMVC Manifold / Standard Version / null value in flashVars vo causing error on: October 06, 2009, 08:41:49
I'm running my first flex application via pmvc and am having an issue, namely when I try and access or pass the stage here as im doing the view prep command, exactly following the flex demo skeleton application
public class ViewPrepCommand extends SimpleCommand
override public function execute( note : INotification ) : void
trace("view preparation command "+note.getBody() as Main)
facade.registerMediator( new StageMediator( note.getBody() as Main ) );

The difference is that my model prep is happening immediately as I havent any code in there yet but still I would have thought that the stage might be ready at this point since the flex application tag has sent through its complete handler.

public function StageMediator(viewComponent:Main)
super(NAME, viewComponent);
trace("stage mediator ",viewComponent )
fv = new FlashVarsVo(stage); // - something passed in which is null when traced at other end
var twidth:String=fv.getVar("_width") // - causing the error

* Retrieves the viewComponent and casting it to type Stage
public function get stage():Stage
   return viewComponent as Stage;

inside the constructor of the flashVars value object null is the traceable parameter though it looks to be passed in ok..

4  PureMVC Manifold / Standard Version / clear proxy on: September 28, 2009, 03:43:53
I tried passing a null ref into setData into a proxy to try and empty it. There is no specific method. What is the best way to empty a proxy it seems that every time i do a setData it is adding to the current proxy item count I need it to replace...

5  Announcements and General Discussion / Getting Started / LOADING_COMPLETE: start up manager - but not all loaded on: August 21, 2009, 02:53:18
Any one had any issues with the startup manager utility not correctly sending the
LOADING_COMPLETE: all resources have been successfully loaded

notification ! I'm having to manually throw in flags and if statements that the manager should be taking care of for me !

thanks for any insight or ways to debug this. I'm using a multiton

the notification should come after all my resources i registered have done loading but doesnt.

I'm wondering ...
6  PureMVC Manifold / MultiCore Version / start up manager compile error with multicore on: August 20, 2009, 02:42:26
I cant see that I'm doing anything wrong however the defaultTimeout method throws the compiler

         _monitor.defaultTimeout = 30;

 Error: Access of possibly undefined property defaultTimeout through a reference with static type org.puremvc.as3.multicore.utilities.startupmanager.model:StartupMonitorProxy.

I dont see why unless I have some outdated classes or its multicore ?
7  Announcements and General Discussion / General Discussion / multiton access of application facade. on: August 18, 2009, 03:22:37
facade.retrieveMediator(ApplicationFacade.getInstance( NAME ).startup( this ))

I was told the above is how to access the correct application facade in a multiton however startup doesnt seem to be a valid method for that ?

thanks for help
8  Announcements and General Discussion / General Discussion / load order management on: August 03, 2009, 11:42:49
I see a class in a code base I inherited where I would have thought that I can manipulate the load order, at least starting as when things load depends on the size of the resource but every little helps me ??

StartupCommand, is the name of the class. Interestingly this doesnt look like part of the download for the as3 single core, so is this not part of the framework ? And where normally would I order things in loading and can the framework be forced to obey a load order before loading the next resource ?

9  PureMVC Manifold / Standard Version / getting stage dims from within anywhere on: July 28, 2009, 07:53:10
I cant work out why I get null for the following , ultimately i want to get a stage width

stageMed = ApplicationFacade.getInstance().retrieveMediator(StageMediator.NAME) as StageMediator;

its null so far

10  Announcements and General Discussion / Getting Started / not a known Application Resource Proxy on: July 24, 2009, 06:45:12
I get the error not a known Application Resource Proxy when I try and run my proxy listed below. I can see that I missed anything

public class LangSwfProxy extends EntityProxy implements IStartupProxy

public static const NAME:String = "langSwfProxy"
//public static const SRNAME:String = "langSwfProxySR";

private var stageMed : StageMediator;
private var flashVar : FlashVarsVo;

public function LangSwfProxy()

public function load() :void
sendNotification( ApplicationFacade.LANGSWFLOADING);
stageMed = ApplicationFacade.getInstance().retrieveMediator(StageMediator.NAME) as StageMediator;
flashVar = stageMed.flashVars;
var mLoader:Loader = new Loader();
ExternalInterface.call("console.log", { LangSwfProxy:"URL: " + "assets/swf/" + LangFont.getLoadAssetString(flashVar.getVar("siteId")) } );
var mRequest:URLRequest = new URLRequest("assets/swf/"+LangFont.getLoadAssetString(flashVar.getVar("siteId")));
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

function onCompleteHandler(loadEvent:Event)
sendLoadedNotification( ApplicationFacade.LANGSWFLOADED, "", NAME );

private function errorHandler(e:IOErrorEvent):void
            sendLoadedNotification( ApplicationFacade.LANGSWFFAILED,"", NAME );

function onProgressHandler(mProgress:ProgressEvent)



thanks for any ideas...
11  Announcements and General Discussion / Getting Started / Anatomy of a chain of events on: May 01, 2009, 10:05:09
Just want to see if I have this right from what I can tell.

Objective : have a UI element send data to the model process that data and display a result in the same (or not) UI. Must keep encapsulation.

UIView > dispatchEvent to its Mediator
UIViewMediator > sendNotification(include value object or other data) to a controller (which controller)
UIViewController > sendNotification(include value object or other data) to ModelProxy
ModelProxy > sendNotification(include value object or other data) toModel - do thing and then go all the way back.

I have left out the facade here on purpose as I would like to see how it could be done using that. I think how I have it here is more traditional MVC, with pure I seem to be seeing that I can go straight to the Model with facade ?

thanks for developing this thread...
12  Announcements and General Discussion / Getting Started / run into first errors on: April 27, 2009, 12:30:42
I have tried to start off on the right foot with my facade. It is failing and I would like to work out the next step. It kicks off as the compiler errors have been commented out

I have
package at.landed

import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.facade.*;
//import at.landed.view.*;
//import at.landed.model.*;
//import at.landed.controller.*;
// A concrete Facade for MyApp
public class LandedFacade extends Facade implements IFacade
// Define Notification name constants
public static const STARTUP:String = "startup";
public static const LOGIN:String = "login";
// Singleton LandedFacade Factory Method
public static function getInstance() : LandedFacade
if ( instance == null ) instance = new LandedFacade( );
return instance as LandedFacade;
// Register Commands with the Controller
override protected function initializeController( ) : void
//registerCommand( STARTUP, StartupCommand );
//registerCommand( LOGIN, LoginCommand );
//registerCommand( LoginProxy.LOGIN_SUCCESS, GetPrefsCommand );
// Startup the PureMVC apparatus, passing in a reference to the application
public function startup( app:MyAp ) : void
sendNotification( STARTUP, app );

so for example StartupCommand is undefined and I dont have any views models or controllers created yet in my application.

Do I just create a view for example, but what should it extend etc...there seems to be little documentation on this kind of thing, once I get started I will be ok. I would like just a simple view say a button which when I click does a sum in the model via a dispatched command. and the view updates by showing something.

What is the next step.thanks
13  Announcements and General Discussion / General Discussion / Observations and a Question on: April 27, 2009, 06:09:52
I have possibly recently at last got to grips very well with (as I have used MVC for some time) the concept of MVC. So I start to look at your framework in the context of actionscript.

You use the term 'pure' yet it seems that this variation of the pattern is less clean and more complex. I will give my reasons why as a possitive Criticism of at least the Documentation.

You introduce a 4th top level class - Singleton called Facade (I understand that it is supposed to simplify things however so await to try it out but it seems I can do everything here (going against the idea of modularity facade=frame1 stick all my code here type of thing)  and undermines the strict chain of command and decoupling that MVC originally set out to do)

You introduce Proxies to the model (I suppose to encapsulate the model further- I always when using proxies think its an unnecessary step on many occasions too far - too many wrappers).

You Introduce mediators as a part of the view which itself is a Singleton, I assume the main view is a singleton but obviously there is a need for multiple view classes, so then are there each time a view its a Singleton ? Perhaps I need a view not to be a Singleton. For me I could understand the top level view being a Singleton but I don't like views being Singletons for no good reason. And back to Mediators they seem like views to me ? Confusion here. Events dispatching would be done from the views to the controller traditionally and I can understand this. Are views Abstract mediators ? So the concrete is the mediator and the abstract the view and in fact then a mediator is just another view or nested view ?

Can you see how a beginner to patterns is getting lost here. I hope so this is mostly what I want the point of this post to be. As I'm sure this is a great framework and there are benefits, just that the documentation is a bit well confusing.

e.g. You state that with Commands and the Controller "They are the home of your application’s Business Logic." well I thought and was comfortable knowing that (in MVC) the business logic is with the Model and ONLY here ! I would like an answer to this.

You are using the "ç" character in the code examples given in façade is this good practise ? I cant type it quickly and will myself substitute it.

It is just stuff stopping me from trying out the framework.


14  Announcements and General Discussion / Getting Started / flashdevelop and puremvc on: March 20, 2009, 10:52:24
I have a couple of initial questions

How can I start to use to try puremvc with flash develop and perhaps the flex sdk so as to keep open source ?

Normally I have to declare an entry point class in fd, no problem but what is it that I need to instantiate first.

I would secondly like to know how to start using flash cs3 and having assets in the library.

thanks in adv.
Pages: [1]