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

Pages: [1]
Print
Author Topic: Commands calling mediators/proxies in timed sequence  (Read 7847 times)
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« on: October 30, 2008, 09:34:02 »

Hi,

I have a command that runs when I want my application to return to idle mode ( IdleTimeoutCommand ). This command tells the views to transition to their idle state. 

I want a simple way of controlling - and timing - how the view go to their idle state.  For an example I want the menu to go first, then the background graphics, and so on.

Am I allowed to have the command call the view for an example with TweenLite.delayedCall()?

So call view A after 0.5 seconds, B after 0.8 seconds and so on?

Could it happen that the command is removed from memory before it gets to call the view?

Confusing???

Best,
Sammi
Logged
marek
Jr. Member
**
Posts: 14



View Profile WWW Email
« Reply #1 on: November 07, 2008, 07:36:35 »

Am I allowed to have the command call the view for an example with TweenLite.delayedCall()?
for sure command shouldn't call the view but just send notification. Observer will respond with view right action inside the view. TweenLite can be used - that is not a problem even with delayedCall however I do believe that all transition functionality should be stored within the View. Mediators react for received notifications that can carry a object contains transition sequence. That is my solution.

If you want to take them down one by one... hmm....
you might create a function that will be called everytime one of them has been removed or tweened. You can fire it using
:
TweenLite.delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array):TweenLite
Function will check if there any objects left - all available in the conatainer or within array that can store it. If yes will take another from the stage or list you predefined and perform expected action. My feeling is to keep it simple but not too much. ;)
Logged
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« Reply #2 on: November 10, 2008, 03:22:31 »

Thank you for your response.

I always to this ;)  I tend to call the mediators the "view" because they belong to the view.  But people obviously often misunderstand and think I am talking about the view components.

But I still think you are right.  Using notifications are cleaner even if they mean more code.

Best,
Sammi
Logged
Pages: [1]
Print