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 [2]
16  Announcements and General Discussion / General Discussion / Re: loading exernal views in a flash application on: December 26, 2007, 05:48:23
Is it not so that we don't want the viewcomponents to have any knowledge of the framework? They should just expose a public API to their mediators, nothing more.

In my opinion, external swf's that are only supposed to be viewcomponents, shouldn't hold any code whatsoever. Using a MovieLoader Proxy, you can load external swf's. When a swf is loaded, the MovieLoader can send a notification to a SimpleCommand that - based on the type of the notification - then registers the appropriate mediator with the facade, passing in the newly loaded swf as its viewcomponent.
17  Announcements and General Discussion / Getting Started / Re: Notifications on: November 01, 2007, 03:48:30
About the startup idiom for Flash AS3 applications.
Why not use the base class:

package com.mydomain.myapp {
   
   import flash.display.MovieClip;

   /**
    * @author
    */
   public class StartUp extends MovieClip {
      
      public function StartUp() {
         init();
      }
      
      private function init() : void {
         ApplicationFacade.getInstance().start( this );
      }
   }
}
18  Announcements and General Discussion / Architecture / Re: Flash and Puremvc on: October 28, 2007, 12:37:17
I'm not quite sure who you mean with Simon?   ;)
19  Announcements and General Discussion / Getting Started / Re: Notifications on: October 28, 2007, 10:02:18
Thanks for the pointer to the article. That works for me too, but,

public function startup( app:Object ):void
{
    notifyObservers( new Notification( STARTUP, app ) );
}

should probably be:

public function startup( app:MovieClip ):Void
{
    notifyObservers( new Notification( STARTUP, app ) );
}

since we are passing the _root timeline as the container for our application?
20  Announcements and General Discussion / Architecture / Re: Flash and Puremvc on: October 28, 2007, 07:14:20
Well, sure I would be interested in a AS2 beta program. I can help with demo's like a complete website so users can see how things come together. And if you like I can do some work on AS3 demo's too (specifically for Flash CS3).

I did the port because most clients here (Netherlands) still want to target Flash Player 8. I already build a lot of websites in MVC and so I picked up PureMVC to start gathering my tools for projects that target Flash Player 9. And since I was very impressed with PureMVC... I did the port to AS2. At the moment I'm refactoring a recent commercial project to use the AS2 port of PureMVC and consequently I'm figuring out the specifics and posted some questions in the Getting Started forum.

I don't know if there is a need to rush things. There are a lot of AS2 frameworks out there and I don't see a lot of MVC programming in my part of the Flash world (mostly websites). And since you mentioned that you would release an AS2 port, well, I think it would be best if everyone holds his breath for a while.
21  Announcements and General Discussion / Getting Started / Re: Using a generic Proxy to load data on: October 28, 2007, 06:44:34
If I use a node in the xml data to distinguish which content gets loaded and then use the type parameter of the notification, the Mediator can decide if it needs to do something.

in the Remote Proxy
if (a node in the xml == "homepage") {
facade.registerProxy(new ViewItemProxy("ViewItemProxy", data.xml));
sendNotification( ApplicationFacade.DATA_LOADED, null, "home" );
}

in the Mediator's handleNotification()

case ApplicationFacade.DATA_LOADED:
if(notification.getType() == "home"){
var proxy:ViewItemProxy = ViewItemProxy(facade.retrieveProxy("ViewItemProxy"));
var home:Home = new Home(); // a view object
home.main(proxy);
}
break;

Works, but is it a recommended solution?
22  Announcements and General Discussion / Architecture / Re: Flash and Puremvc on: October 27, 2007, 02:37:39
Ah, an AS2 port. Well, I never thought you would release an AS2 version and since a lot of clients still want to target FP8 I did an AS2 port. Works like a charm.
23  Announcements and General Discussion / Getting Started / Re: Package structure on: October 27, 2007, 02:10:23
Ah, I should look in the CodePeek example...
24  Announcements and General Discussion / Getting Started / Using a generic Proxy to load data on: October 27, 2007, 01:22:28
Currently I could use a generic Proxy to load all xml data. In the body of the notification I can simply use a string to add to a query. The Proxy loads the data and informs a Mediator that the data is loaded, passing the data in the body of the notification.
But with several Mediators in the system all listening for DATA_LOADED this poses a problem.
I guess this could be solved in several ways but what would be considered good practice?
25  Announcements and General Discussion / Getting Started / Notifications on: October 27, 2007, 01:05:36
When do I use:

var note:Notification = new Notification();
facade.notifyObservers();

and when
sendNotification();
26  Announcements and General Discussion / Getting Started / Package structure on: October 27, 2007, 12:58:02
I am wondering about best practice when it comes to object models. Normally I would work with an om package that usually holds a (generic) object model for a viewitem. This viewitem holds data like text for headings, body text, assets to load etc, loaded using xml. If applicable I would create collections of these viewitems.
What is considered good practice? Does the Proxy just gets the data and do I use an om package for object models? Or, does my remote proxy - ContentProxy - retrieves the xml data and then uses a 'ViewItemProxy' to parse the data (which I guess would resemble the approach in the HelloFlash example...)?
Pages: 1 [2]