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  PureMVC Manifold / Demos and Utils / Re: Slacker - A PureMVC AS3 / Flex Demo on: April 12, 2010, 09:33:50
ok, I got it !

I was using "NavigatorContent" for my views in the ViewStack... (I didn't understood yet why the events was fired so soon), but by replacing it with a Canvas, everything is fine !
2  PureMVC Manifold / Demos and Utils / Re: Slacker - A PureMVC AS3 / Flex Demo on: April 12, 2010, 08:55:49
Hi,

I'm trying to run this sample within Flash Builder 4, and guess what ? It doesn't want to work out.

the thing is that the events sent in the MainDisplay at the creationComplete of the views in the ViewStack are fired before the MainDisplayMediator is registered... so the MainDisplayMediator doesn't get for instance the GALLERY_CREATED event, which allows facade.registerMediator( new GalleryViewMediator( child ) ), and thus the galleryView in the onRegister function in the GalleryViewMediator is null :-(

any ideas ?
3  PureMVC Manifold / Demos and Utils / Re: Sequential - A PureMVC / AS3 Demo on: December 23, 2008, 09:03:17
Ok, thx Cliff !

works great  :)

I guess the trick was to register the comp (mediator) in the onRegister() function of the ApplicationMediator...  ::)

have a nice day.

4  PureMVC Manifold / Demos and Utils / Re: Sequential - A PureMVC / AS3 Demo on: December 23, 2008, 07:50:13
Here is the whole stuff...
5  PureMVC Manifold / Demos and Utils / Re: Sequential - A PureMVC / AS3 Demo on: December 23, 2008, 06:39:54
here is the main file "Sequential.mxml", and for the other files the code is the same than in the demo...

:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" >
<mx:Script>
<![CDATA[
import org.ApplicationFacade;
import org.view.comp.OutputComponent;

private function init():void
{
var facade:ApplicationFacade = ApplicationFacade.getInstance();
facade.startup( this );
}

public function set outputComponent( output:OutputComponent ):void
{
this.addChild( output );
}
]]>
</mx:Script>
<mx:Button label="Call AsyncCommand" click="init()"/>

</mx:Application>
6  PureMVC Manifold / Demos and Utils / Re: Sequential - A PureMVC / AS3 Demo on: December 23, 2008, 06:01:49
Hello,

I'm tryin' to do this demo with Flex... :

OutputComponent.mxml :

:
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" width="400" height="300"
title="PureMVC AsyncCommand" creationPolicy="all">

<mx:Script>
<![CDATA[

private var logCount:int = 1;

public function log( msg:String ):void
{
if ( ta_output == null ) return;
else ta_output.text += String( logCount )+ ". " + msg + "\n";
//output.text = String( logCount )+ ". " + msg + "\n";
logCount++;
}
]]>
</mx:Script>
<mx:TextArea id="ta_output" width="100%" height="100%"/>

</mx:Panel>

and my OutputMediator.as :
:
package org.view
{
import org.ApplicationFacade;
import org.puremvc.as3.interfaces.INotification;
import org.puremvc.as3.patterns.mediator.Mediator;
import org.view.comp.OutputComponent;

public class OutputMediator extends Mediator
{
public static const NAME:String = "OutputMediator";

public function OutputMediator( viewComponent:OutputComponent )
{
trace("viewComponent: "+viewComponent.ta_output);
super( NAME, viewComponent );
}

// Called by the View when the Mediator is registered
override public function onRegister():void
{
sendNotification( ApplicationFacade.BEGIN_ASYNC_COMMANDS );
}

// List the INotification names this Mediator is interested in being notified of.
override public function listNotificationInterests():Array
{
return [ ApplicationFacade.LOG_OUTPUT ];
}

// Handle INotifications.
override public function handleNotification( notification:INotification ):void
{
switch ( notification.getName() )
{
case ApplicationFacade.LOG_OUTPUT:
var logMessage:String = notification.getBody() as String;
trace("logMessage: "+ logMessage);
output.log( logMessage );
break;
}
}

public function get output():OutputComponent
{
return viewComponent as OutputComponent;
}
}
}

the thing is that my output textarea (ta_output) is null at the moment of the first async command...???
I don't understand why and can't figure out the reason...
this is not the first time I try to port a demo for flash to flex and I always have this same problem of null object...
so this time I tried the simplest demo I found, but still have this annoying thing :-(

Would you please have any idea about this issue ?
Thx for help.
Pages: [1]