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  PureMVC Manifold / MultiCore Version / Trying to understand multicore on: March 06, 2009, 08:01:47
Ok, so I've got my module loaded into my application.  Check.  Now I would like to understand the initializeNotifier method and onRegister method a little better.  What is the difference between the two? When would I use one and not the other?  Currently, I have a mediator that registers a proxy, and then tried to retrieve it shortly after ... but it retrieves null.

It's driving me nuts.  I've made break points ... debugged, etc.  I just can't figure out why my proxy retrieves null.  I've seen other posts like this ... but not much from the multicore arena.

 Thanks for any help!
17  PureMVC Manifold / MultiCore Version / Re: Module hell. ModuleEvent won't fire. on: March 04, 2009, 05:07:39
figured it out.  This post:
http://www.joshuaostrom.com/2008/08/14/flex-modules-watch-your-scope/

Lesson learned.  Locally scoped variables get trashed quick by the garbage collection.
18  PureMVC Manifold / MultiCore Version / Module hell. ModuleEvent won't fire. on: March 04, 2009, 04:38:03
I can't figure this out.  I'm going to rip my hair out.  My module is loading with one of the Fabrication examples I modified.  "loading"

However, I can't add the module to the display list, because the ModuleEvent class won't fire anything back! 

:
trace( moduleVO.url );
var moduleLoader:FlexModuleLoader = new FlexModuleLoader();

moduleLoader.id = moduleVO.getElementID();
moduleLoader.url = moduleVO.url;
moduleLoader.router = applicationRouter;

if (moduleVO.moduleGroup != null)
{
moduleLoader.moduleGroup = moduleVO.moduleGroup;
moduleLoader.defaultRoute  = moduleVO.moduleGroup;
}
else
{
moduleLoader.defaultRouteAddress = applicationAddress;
}

moduleLoader.addEventListener(FabricatorEvent.FABRICATION_CREATED, moduleCreated);
moduleLoader.addEventListener(FabricatorEvent.FABRICATION_REMOVED, moduleRemoved);
moduleLoader.addEventListener(ModuleEvent.READY, moduleReadyListener);
trace( moduleLoader );
moduleLoader.loadModule();

My module loads, because my console says it does ... but I can never seem make it to this function:

:
private function moduleReadyListener( event:ModuleEvent ):void
{
trace( "module ready!" );
event.target.removeEventListener(ModuleEvent.READY, moduleReadyListener);
moduleContainer.addChild(event.target as DisplayObject);
}

any sugestions.  I feel like this is something really simple.  Why wouldn't the eventListener be ... listening?
19  Announcements and General Discussion / Architecture / Re: External swf uses PureMVC framework ontop of existing framework. on: December 11, 2007, 10:07:25
Yes, yes.  Sorry, I was a bit vague in my reply.  Looking closer at the ApplicationDomain class solved my problem.  Thanks.
20  Announcements and General Discussion / Architecture / Re: External swf uses PureMVC framework ontop of existing framework. on: December 11, 2007, 08:46:05
Dragos,

I really appreciate your reply!  That is exactly what I needed to be reminded of.  Right now, I'm loading everything inside the currentDomain, and therefore none of the "Introduction" class definitions are partitioned from the "Main" definitions.  What I need to do is create a new ApplicationDomain when loading.

Thanks again!

Ty
21  Announcements and General Discussion / Architecture / External swf uses PureMVC framework ontop of existing framework. on: December 10, 2007, 07:07:25
I have one "Main" swf that loads a bunch of other swf files into it.  "Main" has a ApplicationFacade Class that initializes the concrete Facade.

One of the swf files, "Introduction", is complex and is also built using the PureMVC framework, has an Application Facade class, and initializes the concrete facade.

My problem, is that since the root swf "Main" has already initialized the Facade, I'm unable to load my external swf "Introduction" on top, because this line:
:
var facade:ApplicationFacade = ApplicationFacade.getInstance();
// Send the STARTUP notification
var note:Notification = new Notification( ApplicationFacade.APP_STARTUP, this);
facade.notifyObservers(note);
// facade returns NULL meaning that another instance of it was already created

..returns null, because it sees that:
:
       public static function getInstance(): ApplicationFacade {
            if ( instance == null ) {
instance = new ApplicationFacade( );
}
            return instance as ApplicationFacade;
        }

...instance is NOT null, and when "return instance as ApplicationFacade", it returns null.


How do I go about this?  Both Main and Introduction trying to access the concrete org.puremvc.patterns.facade.Facade class. 

Thanks,

Ty

22  Announcements and General Discussion / Getting Started / When to initialize commands, and question about Notifications on: December 06, 2007, 11:29:04
Ok,

I have an existing video application that has few distinct peices:

  • the Video Player
  • Channel List
  • Videos

The app loads all its data from a database, which is constantly changing.

Here is a breakdown of some of the events fired off in my application:

start app
load remotingProxy
establish rtmp connection
load channel list (loads channel thumbs, titles, etcs)
load first channel (creates horizontal list of video thumbs offstage, with titles, video frames)
show first channel (list moves on stage)
show first video
load videoplayer (sits ontop of video window, attaches videostream)
vp events (play, pause, stop, seek, mute, volume, fullscreen)
close videostream
next video
prev video
next channel
prev channel
..
.
etc.

This is just a few pieces of the main functionality. 

First Question:

Do all these get listed in the ApplicationFacade class as notification names?  What if my app was much bigger than this, would I list all 100+ notifications here?  If not, where would I list them? In my existing (very mediochre) architecture, the main pieces of fuctionality all have their own facade which lists notifications specific to that component.  I just need a straight answer, what is best practice for this scenario?

Second Question:

I'm trying to better understand the controller functionality in the PureMVC architecture.  Other than at startup, where and when would I need to register new commands?

Third Question:

In my application, would it be best to have one mediator for a set of components (such as the video boxes)? ... and if not, would I instaniate a new mediator for each videobox component after each one loads?  Same kinda goes for the channel list ...

If I manage to finish this application, I would be more than willing to provide a much simpler version (using xml sheets, and progressive video) as a demo.

I really do appreciate this new framework, and have spread the word to my fellow colleagues.  Thanks much Cliff!



23  Announcements and General Discussion / Getting Started / Re: MacroCommands and Assets on: December 06, 2007, 10:37:13
Good call.  This post (http://forums.puremvc.org/index.php?topic=91.msg328#msg328) also really helped me out.

Sorry for the late response, I really appreciate your feedback Cliff.
24  Announcements and General Discussion / Getting Started / MacroCommands and Assets on: November 30, 2007, 11:44:23
What would be the best sequence of events for initializing:

Splash.swf (includes loader)
Intro.swf
Background.swf
Proxy1
Proxy2
Proxy3
StageAssets.swf

Only the StageAssets are dependant on the proxies.  If I was using the StartupCommand Class:

:
package com.me.myapp.version1.controller
{
    import org.puremvc.interfaces.ICommand;
    import org.puremvc.patterns.command.*;
   
    import com.me.myapp.version1.ApplicationFacade;

    public class StartupCommand extends MacroCommand implements ICommand
    {

        override protected function initializeMacroCommand() : void   
        {
addSubCommand(com.me.myapp.version1.controller.AssetPrepCommand);
addSubCommand(com.me.myapp.version1.controller.ModelPrepCommand);
addSubCommand(com.me.myapp.version1.controller.ViewPrepCommand);
}
    }
}

Would the AssetPrepCommand fall under the view anyways?  Just need a little guidance to get me started ...
25  Announcements and General Discussion / General Discussion / Re: first project with pureMVC on: November 22, 2007, 09:38:00
Why is the swf footprint so big?  When I compile the project ... it seems to be a massive 346kb.  When I extract the files it seems to be 222kb (which is still pretty big don't you think) and when I compile it, it's 346kb.  What gives?  Is there a setting in Flashdevelop that I'm not aware of?
Pages: 1 [2]