PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: dgtlmonk on October 07, 2009, 10:17:07



Title: Flash CS4 Scene - Mediator
Post by: dgtlmonk on October 07, 2009, 10:17:07
Hi,

  A little confused on how would i handle different flash scene through a mediator .. anyone have this before?

Kind Regards,
Joel


Title: Re: Flash CS4 Scene - Mediator
Post by: puremvc on October 08, 2009, 06:15:32
You might not want to do that. Of the laundry list of reasons not to use scenes given in the Flash CS3 help, the following is perhaps the most relevant here:

"Scenes combined with ActionScript might produce unexpected results. Because each scene Timeline is compressed onto a single Timeline, you might encounter errors involving your ActionScript and scenes, which typically requires extra, complicated debugging."

-=Cliff>


Title: Re: Flash CS4 Scene - Mediator
Post by: ninjaparade on October 19, 2009, 10:17:27
I agree with Cliff on this.

I've built quite a few applications with the pmvc framework in Flash. and what I do, and please Cliff correct me if you feel this isn't best practice, but I export a MovieClip from the flash library that would be considered the "viewComponent" using "Export for Actionscript".

In doing this, That viewComponent would be controlled by its Mediator, and that Mediator would listen to the notifications that are meant for that viewComponent and handle it accordingly. Information (data) would then be passed to the viewComponent through that Mediator and the other way around.

There is a great tutorial regarding this topic should you consider going this route you can find it here.

http://hubflanger.com/building-a-flash-site-using-puremvc/

hope this Helps.

Ninja