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 / PureMVC for games on: January 16, 2012, 01:52:11
is puremvc viable for developing games? i haven't seen examples or tutorials where puremvc framework is used.
2  Announcements and General Discussion / General Discussion / Mediators and their ViewComponent on: December 07, 2011, 10:41:11
Hello everyone,

I've read some post here regarding mediators and components. However, i want to know more something specific.

Basically, I have a panel view with child views
The panel view is a movieclip which is mediated by "PanelMediator"..
This is in StartupCommand:
:
// Create and Register the Application and its Mediator.
var app:PanelView= note.getBody() as Shell;
facade.registerMediator(new PanelMediator(app));

Then i had the child views given a mediator, say "SomeChildMediator" passing the component.
This is in PanelMediator:
:
override public function onRegister():void
{
   facade.registerMediator(new SomeChildMediator(panelView.child_mc));
}

private function get panelView():PanelView
{
 return viewComponent as PanelView;
}

Now, I add mouse event to the child view component(note the child view also contains related views).
This is in SomeChildMediator:
:
override public function onRegister():void
{
   chilView.btn1.addEventListener(MouseEvent.Click, onBtn1Click);
}

private var onBtn1Click(e:MouseEvent):void
{
   //show an btn background, can i do this?
  //childView.btn1.background.visible = true;
}

private function get childView():MovieClip
{
 return viewComponent as MovieClip;
}
I get that the component or module should encapsulate most of its state and behavior and
exposing only an api, which would look like this(if I'm not mistaken).
:
PanelView.doSomething();
However, Should "SomeChildMediator" directly change the state? Since it is only mediating the child view of
panelview, which i dont have a class of ChildView.as like PanelView.as. Also i will be dealing with a complex
panel or toolbar soon with lots of buttons(toggle state, some animation).  ???

Thanks in advance........
 


3  PureMVC Manifold / MultiCore Version / Attaching pipes to modules on: November 30, 2011, 01:26:39
Hello,

I recently started studying the pipes utility. However, I stumble some rocks ahead.
I have this module cores( which are individual swf ), both will be loaded to a main swf.
I was successful in communicating the two modules using interface but I believe using pipes
will provide me greater flexibility as I introduce more modules.
I can't seem to know when to attach the pipe fittings to the modules. Both of my modules now
have a ModuleJunctionMediator, I still cant grasp the idea on how to connect the pipes to the
module.

Regards
Michael
4  PureMVC Manifold / Standard Version / loading external swf as viewcomponent on: November 02, 2011, 08:16:37
Hi, im still learning how to get around the PureMVC framework.
Im a bit confused as to how i should load external swf(basically they are movieclips which contains buttons, sprites, etc.). I separated my single project(all movieclips,etc. in 1 big .fla file) into modules(e.g. editTools,commonTools).
I did these things so far..
1. In my applicationfacade
:
override protected function initializeController():void {
            super.initializeController();
    //starting the application
            registerCommand(STARTUP, StartupCommand);
}
2.In on StartupCommand.as
:
public class StartupCommand extends SimpleCommand implements ICommand {
        // Register the Proxies and Mediators
        override public function execute(note:INotification):void    {
// Create and register proxy
facade.registerProxy(new CanvasProxy());
                        //the stage here should add all the viewcomponent
var stage:Stage = note.getBody() as Stage;
                        //how can i get reference to the external swf
                        //and add it on stage and pass reference to the mediator
                        //stage.addChild(theswf);
                        //facade.registerMediator(new EditToolMediator(theswf));
       }
}

Btw, i have a ToolbarProxy which i think should handle the loading of swf
:
public class ToolbarProxy extends Proxy implements IProxy {

//Cannonical name of the Proxy
public static const NAME:String = 'ToolbarProxy';

public function ToolbarProxy() {
super(NAME, new ToolbarVO()); //pass the cannonical name to the superclass
}

public function loadToolbar():void
               {
                    var request:URLRequest = new URLRequest();
                    var loader:URLLoader = new URLLoader();
 
                      request.url = vo.dataURL;
 
                     loader.addEventListener( Event.COMPLETE, handleLoadingToolbarComplete );
 
                   loader.load( request );
              }
 
        private function handleLoadingToolbarComplete(e:Event):void
        {
            vo.Toolbar_mc = e.target;
 
            sendNotification( PureMvcConstants.TOOLBAR_LOADED, vo.Toolbar_mc );
        }
 
        public function get vo():ToolbarVO
        {
            return data as ToolbarVO;
        }
And the ToolbarVO
:
public class ToolbarVO
{
public function ToolbarVO()
{
public var dataURL:String = 'toolbar.swf';
public var Toolbar_mc:MovieClip = new MovieClip();
}

}


More Power &
Best Regards
Pages: [1]