Actionscript :: Where To Register Mediator In Puremvc

Mar 17, 2010

Currently I am working on flex using puremvc framework. Actually my question is related to where to register mediator in puremvc framework. One of my colleague is registering mediator in views(components) creationComplete method only (inside view). While my preference is send some notification from creationComplete method which could be handle by some command and command will register mediator. So which one is better approach in terms of best practice ?

View 3 Replies


Similar Posts:


Flex :: PureMVC: Unique Mediator For Each Tab In An Interface?

Oct 12, 2009

I am building a tabbed interface for switching between various similar layers. Each layer will have a number of graphs. By dragging with the mouse the graphs can be rearranged or even moved between layers. My question is, is it best practice to register a unique mediator for each layer that keeps track of the layers content / organization, or should i keep track of it all with one central mediator.some considerations:

the layer contents and organization will be saved(in a db) so that it can be restored when a user comes back to the app.the layers themselves are functionally identical.the user can add and remove layers at will.

View 1 Replies

Flex :: Mediator Must Hold View In PureMVC?

Dec 28, 2009

I have one question about pureMvc. I use pureMvc to build an engine, in the engine init part i have an requirement

1) moduleA must init firt
2) moduleB , moduleC need init after moduleA init complate.
3) moduleD need init after moduleB & moduleC init complate.
4) moduleA , moduleB , moduleC , moduleD all extends Proxy beacuse the four system all need to send notifiation ,but no need to listen it.

But to fit for the requirement I can't use command to do it, because they have ini order and also they need to remember current state(ex: moudelB is init Complate but moudleC is not init complete then can't init moudleD) but command is stateless. The best way I think is use one Mediator to do it, beacuse it can both listen and send notification. My question is :

1) Is this a good way to use one Mediator to do it?
2) If use Mediator is good way, then when it hear first moduleA is init complate
registerCommand(FIRST_MODULE_INIT_COMPLATE , initStepTwoCommand);
sendNotification(FIRST_MODULE_INIT_COMPLATE);
removeCommand(FIRST_MODULE_INIT_COMPLATE);
Need to do things like that way or just do the inti logic in the Mediator?

View 1 Replies

Actionscript 3 :: Casting A Retrieved Mediator With PureMVC As Its Proper Class Returns Null?

Jul 15, 2010

I have a mediator that I've registered for a navigation page:

facade.registerMediator(new NavPageMediator(viewComponent));

I'm trying to retrieve that mediator on another page like so:

var navPageMediator:NavPageMediator = facade.retrieveMediator(NavPageMediator.NAME) as NavPageMediator;

However, that statement returns null. If I try to cast it using the NavPageMediator(facade.retrieveMediator(NavPageMediator.NAME)) syntax instead, I get a TypeError: Error #1034: Type Coercion failed: cannot convert com.website.mvc.view.page::NavPageMediator@237560a1 to com.website.mvc.view.page.NavPageMediator.`

I can't, for the life of me, understand why NavPageMediator@237560a1 would be unable to convert to NavPageMediator, nor what happened in between registering the mediator and retrieving it that caused this. Especially since trace(new NavPageMediator() as NavPageMediator); returns [object NavPageMediator].

Incidentally, and this may be part of my problem, I don't understand what the @hash at the end of the object is (@237560a1). Is it simply an internal identifier for that class instance?

Edit:Left a bit of important info: The SWF in which I instantiate and register the mediator is separate from the SWF in which I try to retrieve it.

View 1 Replies

ActionScript 3.0 :: Role Of Mediator On MVC?

Feb 24, 2010

what is the role of mediator on MVC? Perhaps provide a real work example like managing states?

View 1 Replies

Flash - RobotLegs - Mediator For Main Application Class?

Jan 29, 2011

I'm trying to mediate the main application class ( the 'Document class' of a Flash *.fla project)I have this on the Application Context startup():

...
mediatorMap.mapView(MyApplication,MyApplicationMediator);
mediatorMap.createMediator(contextView);

The MyApplicationMediator:

public class MyApplicationMediator
extends Mediator {
[Inject][code]....
So onRegister() gets called, but view is null. Also when I try to add the eventListeners I get a null reference error.

View 1 Replies

Flash :: Flex4 Host Component Have The Same Function As A View Mediator/helper?

Jul 17, 2011

Coming from Robotlegs/PureMVC, I am pretty familiar with the concept of the view mediator, i.e. a component that pretty much listens to events/requests coming from the "dummy" view and makes a further request, sends an application-wide signal/event, executes a command, etc, based on the request from the view. Can the host component idea introduced in Flex 4 be considered a the same as a mediator? The only thing that slightly bothers me is that host components are still considered views, because they extend SkinnableComponent or any of the classes that further inherit from it. In my view, the mediator should be completely left out of view logic.

Nevertheless, I do not want to write a skin, a host component, and a view mediator for that host component, because that would be quite an overhead, and would lead to more complexity rather than abstraction.Should I use host components as mediators, and put application-level logic there, for instance application level event dispatching?

View 1 Replies

Flex :: BlazeDS/PureMVC And Shared Vos?

Apr 21, 2010

I'm building modular application with 2 modules which share common vo: ShopRegionVO

This vo is also a BlazeDS entity and is mapped to a remote java object. When shell loads first module everything is ok. The second module is a list of ShopRegionVOs and item change is handled with the following code:

sendNotification(CoverageConstants.SET_SELECTED_REGION_COMMAND, ShopRegionVO(List(e.target).selectedItem));

The exception is thrown right here:

Main Thread (Suspended: Error #1034: Type Coercion failed: cannot convert model.vo::ShopRegionVO@14961809 to model.vo.ShopRegionVO.)
view.list::RegionListMediator/onChange
flash.events::EventDispatcher/dispatchEventFunction [no source][code].....

View 1 Replies

Actionscript 3 :: One Way Deep Linking In PureMVC?

Sep 2, 2010

A project requirement is that it be 1 way deeplinkable(a specific query string will load a section within the swf).I have a URLProxy that I use for all external linking. It makes sense to me to put the query string logic in this proxy. So in the constructor, I check for a querystring, and then send a notification if it equals a predefined value.One problem with this is that I'd like to predefine this query string key value I am checking against in an external xml file. So another proxy, loads-parses this config xml, then the URL proxy checks against this.

View 1 Replies

Actionscript 3 :: PureMVC For Flash Games

Oct 20, 2011

I dont have any experiencie using this pattern when developing a game, except on a data driven website made mostly in Flex.The question is, are there any drawbacks of this pattern?, let say, performance for example?If anyone implemented a game using this framework.

View 1 Replies

ActionScript 3.0 :: PureMVC Or Gaia Framework?

Apr 19, 2010

Which framework is the best one to execute Website projects? I was researching around Flash website blogs and articles talking about the great advantage at daily production with these frameworks.In my case i'm used to get basic/intermediate projects that consists in Animations, Transitions between swf pages and at the most important point: liquid layouts.Gaia Framework seems to help a lot at organization and singular work time reduction spent.

View 4 Replies

Way To Register Keypress

Apr 4, 2012

I've made a popup div that shows a video if you press a button. If you press Esc, the div is hidden again and the video is removed. (Using JWPlayer in Flash.)

If you click on the JWPlayer video, Flash gets the focus and JavaScript can't listen for keypresses on the document anymore. Is it possible to make JavaScript get the focus after you've interacted with the JWPlayer video player, so that you can still press the Esc button after for example pausing the video?

View 1 Replies

Flash - Popup Dialog Box Manager Using PureMVC

Apr 22, 2010

I am developing a a game in Flash using the PureMVC framework. From time to time I need to show dialog pop-up window to get a user response back (e.g. "Cancel", "OK" and other kinds of asynchronous user feedback) while "locking" the background for interactivity.

I need some management for my pop-ups: all pop-up notifications should be stacked up, so that if two (or more) pop-up messages are initiated at the same time I show them one by one.

What's the best practice here? Should I employ a proxy to manage my pop-ups (sounds unreasonable). How do I get feedback back from my dialog? using notifications?

View 1 Replies

Actionscript 3 :: Creating An API For A View Component In PureMVC?

May 8, 2010

In the context of AS3 and specifically a framework such as PureMVC, what an API for a View Component means.

View 2 Replies

Flex :: Multiple Instances Of Views In PureMVC

Sep 15, 2010

Often multiple instances of the view component would be used in multiple places in an application. Each time I do this, I register the same mediator with a different name. When a notification is dispatched, I attach the name of the mediator to the body of the notification, like so:

[Code]...

View 1 Replies

Flex :: Implementing Process Workflow In PureMVC

Oct 11, 2011

I'm looking for suggestions regarding implementing process flow / work flow management in a PureMVC based application. Our Flex application includes a number of processes such as account creation, payment processing, etc. Within our team, there is some discussion of how rigidly we should adhere to the PureMVC model. Within the PureMVC model, it seems reasonable that the current state in the process could be managed in a Proxy. Commands are clearly responsible for processing the actions required of each node and for node transitions. Mediators for managing the UI.

However, I think that there is an important bit still missing here: a ProcessController. The approaches we've reviewed all seem to either violate the PureMVC model (even just slightly) or make unreadable code. A proxy would maintain the state of the process. As such, it seems to be an appropriate way to implement the controller. However, this is putting a lot of business logic into the proxy.

[Code]...

View 3 Replies

ActionScript 3.0 :: Key Down Doesn't Register?

Aug 11, 2010

I press the key down but it doesn't do anything.

ActionScript Code:
stop();
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveLauren);

[Code].....

View 2 Replies

AS3 :: Flex - Inherited Classes And Dynamic Views In PureMVC

Jul 14, 2009

I was wondering best practices for views of inherited classes in PureMVC in this situation: Multiple classes inherit a BaseClass (lets say InheritedClass1 and InheritedClass2) Each InheritedClass has a respective view (derived from a base view class, but each unique) With a given dataset (lets say ArrayCollection of InheritedClass1/2 Objects), the respective views need to be dynamically loaded. The dataset is relatively large, so a TileList would be nice (since it only instantiates objects which are currently displayed) I can think of a couple solutions, but I find them to be too "hackish" to be the best solution:

In View: Repeater over a BaseClassView which attributes a view to a State (set to the "InheritedClass1" state to add a InheritedClass1 object) Pros: No unneeded memory increase (States' objects are instantiated when needed) Cons: View is dependent on the data types, so adds coupling In Mediator: Loop over the ArrayCollection and addChild() the views based on data type Pros: Works. Cons: Mediator is adding things to the View, which defeats the point of the separation of Mediator and View. Slower than a Repeater.

View 4 Replies

Actionscript :: PureMVC Proxies Send Notifications Themselves ApplicationFacade?

Aug 24, 2009

In the PureMVC framework, Proxies communicate with the ApplicationFacade (and thus any interested components) via a Notification. Should this Notification be sent via their own instance, or the Singleton instance of the ApplicationFacade? Frankly, does it matter?

[Code]...

The second method looks more verbose and less intuitive to me. Moreover, the Proxy has the ability to send Notifications, which, in my mind, means it probably should. Are there instances where the Proxy should only send a Notification via the ApplicationFacade instance?

View 1 Replies

Flex :: Unit Testing Puremvc Based Application?

Jul 10, 2010

I have a flex application written using PureMVC framework.Now,I want to write tests.We are using FlashBuilder 4.Is FlexUnit sufficient for testing? Are there any issues you have faced while writing tests?

View 1 Replies

Flash :: PureMVC Mediators And Views - Creation And Control?

Aug 16, 2011

I'm making an app with flash AS3 and puremvc, the way to correctly handle view mediators is sort of throwing me a little...I have 3 or 4 distinct views, each governed by it's own mediator.Each view is only displayed on its own - ie. when 1 is visible/on stage - the others are invisible/removed from stage (over simplified, but I guess could be thought of as seperate pages, viewed one at a time, a nav bar allows a user to change views when they like)

At first each view mediator I had creating and added to stage it's own view component, and as such, when it was 'turn' to show or hide that view, it was simple - addChild and removeChild for it's view component.However, I read over at puremvc.org that it's not good practice to

a. pass round the stage (which was the viewComponent for each mediator in my case - where each view was added to - eg. viewComponent.addChild(foo)

b. create its own view - which allowed me to add and remove it in the first place.

So I changed to the recommended way - when I create each mediator, what I pass in is the view component it governs (rather than the stage/main doc class eg.

var view:MyView = new MyView();
facade.registerMediator( new MyViewMediator( view ) );
viewComponent.addChild(view);

with that the case - I have no idea how I would go about removing/adding each view when needed.I could easily enough set the visibility from within each mediator, but I sort of wanted to avoid doing that - prefer removing when not in use for resource management...how I am 'meant' to go about this (as in, when a view is no longer needed on stage, remove it - temporarily, and add it later on when it is needed?)

View 3 Replies

ActionScript 3.0 :: Register Javascript Functions With IE?

Mar 16, 2010

I am trying to register a javascript-function from Flash, using the navigateToURL function like this:

navigateToURL(new URLRequest('javascript:function init(){ ...doSomething()... }', '_self' ));

to have the function init() available via ExternalInterface --> ExternalInterface.call("init", This works fine in Firefox, but Internet Explorer fails to register the function.

View 5 Replies

ActionScript 3.0 :: Register Root As Environment

Sep 14, 2010

I'm trying to update the famous Floating text in space from levitated.net (URL...)The script was originally AS1, & I'm updating it to AS3.

View 1 Replies

Flash :: AGAL And Varying Register

Dec 20, 2011

I store a UV-coord from va1 to v1. In the frag shader, an interpolated texture coordinate now is available in v1 to sample. Are there connections under the hood, like semantics, to associate v1 with being the normal coordinates?Are fragments pushed to the fragment shader per triangle or once an entire mesh's geometry vertices are run through?In the vertex shader, let's say I multiply my modelview by my vertex's position. I then want to share my z-coord with the fragment shader for something else. I store the z-cord of the transformed vector into v3. Once I am in the fragment shader and I access v3 for the z-coord, is this the same z-coord I passed in or is this z-coordinate going to be altered by the perspective divide in between? I only ask as I want to clarify the "interpolating" behavior described when storing values in these registers.

View 1 Replies

ActionScript 3.0 :: Register Point On A MovieClip?

Jan 24, 2009

when i make a MovieClip by code

ActionScript Code:
var my_mov:MovieClip = new MovieClip()
where is register point on the movieclip?

[code].....

View 2 Replies

ActionScript 3.0 :: Array Values Won't Register

Sep 2, 2010

How come these Array values won't register? Here's a code snippet from what I'm working on, I put line numbers so it's easy to refer to them. (I started with three because I erased lines of code and I didn't want to change everything)

Lines 3 to 6 are in an if clicked (is true when mouse event listener is activated) statement in the gameLoop (Event.ENTER_FRAME loop).[code]...

View 2 Replies

ActionScript 2.0 :: Make Login And Register?

Apr 25, 2011

Does anyone know how to make a login and register in flash using actionscript 2.0 and or 1.0?

View 1 Replies

Flex :: Architecture - Application Framework - PureMVC Portability Vs Swiz?

Dec 9, 2009

My company is building a Flex application that we may need to port to other platforms:

[Code]...

Currently, I'm looking into application frameworks to build upon and I'm torn between pureMVC and Swiz. I LOVE swiz for its simplicity and how it just gives you a way to hook things up and then apply your own patterns. From a flex-only perspective, this is my 1st choice. But, PureMVC is platform-independent and has already been ported over to most of the platforms that are mentioned above. How valuable is this portability? Will it really make our lives significantly easier when it comes to porting and developing/maintaining multiple applications? If so, then it seems like PureMVC is the way to go.

Alternatively, since Silverlight has the most definite business case for porting of our application, maybe we could port Swiz to Silverlight? I'm not too familiar with which AS3 language and Flex framework features Swiz depends on and whether they are available in C#/Silvelright.

View 2 Replies

Flex :: Creating RobotLegs Module Within A PureMVC Shell Application

Oct 19, 2010

I'm working on an existing modular project that was built in PureMVC. Instead of converting everything over to RobotLegs, I want to create a new module using RobotLegs and plug it into the pureMVC shell. Currently, when the module loads, I get the following flash error: ReferenceError: Error #1065: Variable IMediatorMap is not defined.

Inititally, I thought it was because my module needed a pureMVC Mediator to call the pureMVC StartupCommand to get things "hooked up" and THEN create the RobotLegs' Context. However, that didn't work and I'm still getting the error.

View 2 Replies

Actionscript :: Flex MultiCore PureMVC Notifier Initialization Error

May 27, 2011

I am trying to write a simple multicore PureMVC helloword. I am getting Error: multitonKey for this Notifier not yet initialized!

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved