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
1  Announcements and General Discussion / Architecture / Re: Mediators / Notification and System Memory AS3 Flash on: March 05, 2009, 03:20:20
thankyou guys, i'll give it a whirl and post back my rersults  :)
2  Announcements and General Discussion / Architecture / Re: Mediators / Notification and System Memory AS3 Flash on: March 04, 2009, 03:50:48
Hi Cliff / Jason,
Thanks for your help guys

Sorry Cliff I should have explained a little better the mediator's are not added to the stage, they create the necessary components - custom, sprite or otherwise and control everything about them.
I have been reading a lot on Garbage Collection as well, seems daft that you can't control it.
Basically my app is a full flash site, so between each page there are new sprites, listeners and any custom components....
Lets say you jump between four different galleries - 20 images on each gallery.
So thats around 80 images, each with  their own lens sprite, box sprite, bkg solid sprite.
Each one of these images is associated to a large that can or cannot be loaded into the background, depends on the user.
Each gallery has an alpha, and a line to define it.
So Sprite wise you are looking at say 240 sitting in memory between those pages - is that a bargeload????
I didn't really want to clear these as it is nice to just take them off the display list and them throw them back when the user goes to that page - lazy way of having the system remember where the user last was on that page.
Is there any profile thing for straight flash?

Hi Jason, yes I am storing the bitmap data of any image loaded in a proxy so they are only ever loaded once..... This bad??
All my events are deleted between pages.
When I want to remove an object completely I use 'object = null' - which I do for the large images.

But I believe the problem is somewhere around the UILoader or the caching.....
In the image load command I have traced the System.totalMemory when I start the UILoader and then when it hits the complete handler, on the complete I get the massive jump....
Would something in there be doing it??

mmmmmm
3  Announcements and General Discussion / Architecture / Mediators / Notification and System Memory AS3 Flash on: March 03, 2009, 02:17:36
Sup Pure MVC'ers,
So basically I need some help, as we all do ;) and I suspect there is more of a question for Cliff than anyone.

What I have is a base mediator( responsible for any tweening, adding and removing itself from the stage ).
BaseMediator is extended by SpriteMediator( sprite mediator is responsible for for any graphics, solid fills, les's, boxes, lines..... ) then I have ImageMediator( you guessed it, responsible for for loading and masking images.... ).

Any new modules I need to make extend mediators - ImageMediator / SoundMediator / MovieMediator, whatever. So all I have to do is call my new module Mediator and the notification trickles down using a switch case command with super.handleNotification( note ) in the default, which I thought was pretty cool - however when I checked the system memory each time a note is passed to its parent the system memory increases by 4k. Which I know is not much, but through 4 different mediators and then to a command to load an image is 20k, plus the system has listener events called on resize, keyboard..... all mounting up.

Basic debocal, when I load a background image the memory usage was going up 2-3megs when the image is 200k. So after this long winded - whats going on, my question is this does the mvc system garbage collect the notification objects that is sent to mediators and commands and if not, how would you suggest implimenting this feature???


Cheers
~D
4  Announcements and General Discussion / Architecture / Re: Mediator Extension on: October 09, 2008, 06:12:58
Sweet cheers Cliff,
Being able to look at some coding helps me get it.


Chur
~D
5  Announcements and General Discussion / Architecture / Re: Mediator Extension on: October 09, 2008, 02:20:27
Cheers Joel,
Your way seems like it may be nicer than mine, not adjusting the frame work.....

My workaround evolved all my custom mediators extending there BaseMediatorType instead of Mediator, BaseMediatorType being a new Mediator Class based on the pureMVC Mediator which has a new private function BaseHandleNotifications - this takes care of all the base functionality - I need for that particular mediator type i.e. BaseMovie has different functionality from BaseImage.

Within each new custom mediator I do a switch case on the notification coming in and if it does not match anything - in the default I call BaseHandleNotifications function and away we go......

That's a lot of bases.... don't know if I covered them all though?
Whats the general practice with playing with the framework Cliff??
I might try to implement yours Joel, it seems like it might be more scalable.....


Cheers
~D
6  Announcements and General Discussion / Architecture / Mediator Extension on: October 08, 2008, 06:48:27
Hi Guys,
I have a quick question and hope that someone can point in the right direction.

Flash/AS3 standard core version, no fancy flex or anything.
I basically want to create a set of base mediators, which contain certain listNotificationInterests and the corresponding handleNotification's, these base mediators have common notifications throughout such as adding its component to the stage, using tweener to move it round, so on......

Then build all custom mediators out this set, that way if I want to extend anything I just extend the base mediator and everything using it has the new functionality.

Problem I ran into was that Mediator sets up abstract public classes listNotificationInterests and handleNotification to be over-ridden by custom mediators, I didn't really want to start playing round with the frame work, I wanted the custom mediator to extend the base - not override them......
Please forgive any ignorance - as I'm sure there is already a way - i just can't follow at the mo.....
Should I be using a controller to setup and pass the notifications array to the mediator?
Has anyone done something like this?
Is there a better way?


Chur
~D
7  Announcements and General Discussion / Architecture / Re: RemoteProxy / Mediator without view / runtime creation Mediator on: July 02, 2008, 09:53:56
Sup Bro,
I have done a couple of these things in an application that I am building, I do not know if it is best practice or not I am still going through that in another post but,

Mediator without viewComponent
For my swfAddress, I gave the stage root as a view for that mediator - I created that in a startup command - the name that I gave it is a constant.
I keep my constants in a separate file and just import them in as needed, so anything in the menu that needs to know the name of the mediator can just get it via my constants file. If I need to change pages, call new information or whatever within my RIA I just make it go through the swfAddress mediator and thus the browser buttons are all good.

Two mediators depending on one RemoteProxy call
In terms of dynamic mediators, I basically read in an xml list - within this list, I look within the tags for say id="item_group gallery".
This I know is a gallery so I instigate a gallery mediator which triggers several things.
I use a macro command to trigger several simple commands, to the macro command I give an object which has the page name, base mediator name and a section of xml.
The most important thing here is that the thumbs are all created dynamically, I give the page name _ base mediator name _ image name as the uniq mediator name.

When each of these thumbs are created their names are stored in an array, the array is stored in the base mediator and can be retrieved via a custom return function in the base mediator.
The last simple command in the macro command list can retrieve the base mediator as an object and then call that function of the object - I then have a list of all the uniq thumb names which I can run through in a for loop and send notifications to.

Hope helps......
Sounds like you were kinda on this way though, I'm still unsure if this is best practice though - Cliff??

Chur
~D
8  Announcements and General Discussion / Architecture / Re: Trouble with view components - mad stuck on: July 01, 2008, 05:07:55
Hi Guys,
Thanks for the help - I actually just put a slight delay on the file that loads the images.
Gives it a slight break in between calling the load image class, giving half a second between calls.

In terms of having the one mediator instanced, I send in a the page name, then a uniq image name to make the individual mediator name.
It seems to work pretty well - but in terms of a gallery, it means I have to keep an array of the thumbs in the gallery mediator that can get returned via custom call, I couldn't really think of a better way.....

Anyways Thanks guys.
9  Announcements and General Discussion / Architecture / MEDIATOR MADNESS - sale on now!!! do they really have to go? on: July 01, 2008, 04:17:55
sup sup,
I have created my first flash based website in pureMVC, firstly i'd like to thank Cliff and everyone else that has helped me along the way - shot fellas.

I am in the process of refining things - basically I want to optimise the sh@t out of it!
I'm about to start playing with the wonderful bitmap and BitmapData classes in flash cs3 so I only ever have to load in one image and clone it across multiple pages if it needs resizing blah blah blah.....
Anyway I digress, at the moment the application I have made creates bucket loads of mediators, only ever once, but never the less they are always present and just added to the stage when needed - each time you go to a new page it has new mediators, we are looking at anywhere from 15 - 40 mediators per page depending on the amount of images present in that page.
So the first page may have 20, the next page may have 25 - so when you go to the third page you already have 45 mediators then the next pages mediators.......

I know in the last one I posted, Cliff said there was no ceiling except for the processor on the computer, but am I pushing it with this amount?
So my question is by me being lazy and not getting rid of the last pages mediators so I don't have to create them again bad?
If a mediator is created on previous page but not used on the current does it slow down the whole app?


Please tell me I can be lazy.....
Cheers
~D
10  Announcements and General Discussion / Architecture / Re: Trouble with view components - mad stuck on: June 13, 2008, 04:41:38
Hey man,

I gave it a level of abstraction so that I could easily extend the imageMediator if I wanted to add more functionality, such as using paper vision 3d on each image so it is aware of its x y z and encapsulated within is own mediator.
It also reduced the notifications interests in half ( down to maybe 6, with more to be added later ), and clearly separates tweens. ie. moving a single image and moving the whole set of images - allowing me to funk-ify the transitions between each image.

I'll give that a shot though and see what happens.


Cheers
~D
11  Announcements and General Discussion / Architecture / Trouble with view components - mad stuck on: June 12, 2008, 07:36:16
Hi Guys,
Hope all is well within the land of MVC, having lots of fun with a website I am making in flash using pureMVC framework at the moment :)

I am however having a little bit of trouble with a revolving image box I made in pureMVC.
Essentially I am just reading in a XML file which has a list of images, a mediator is created for every image, that image get loaded into the view component automatically in the constructor, and all of these mediators are linked to master mediator.

The master mediator controls the fading in and out event, tells which mediator to do what - which in turn controls the view component of the image.

Everything is cool, and this seems to work fine - unless we add more than 20 images to the list.......
20 seems to be the magic number I do not understand why?

I thought that perhaps it maybe because all the images are automatically loaded in, the mediators are created one after the other, leaving only a couple of Millie seconds between each mediator / image load that this may cause some issues?

Would this be the case?
Can you suggest a better way for a noob to go about this?


Cheers
~D
12  Announcements and General Discussion / Architecture / Re: Dynamic Mediators and Notifications on: April 26, 2008, 07:33:58
chur Cliff
chur Joel

will break it down and go from there.


Cheers
~D
13  Announcements and General Discussion / Architecture / Re: Dynamic Mediators and Notifications on: April 24, 2008, 10:02:17
Hi Joel,
Chur for the reply, what would you recommend then?

I could easily have 10 - 20 functions in my notifcationsList - but it seems like alot and becomes a large switch case statement.....
How would I go about simplifying the coding and not creating a huge document for other users as well as my self??

Cheers
~D
14  Announcements and General Discussion / Architecture / Re: Dynamic Mediators and Notifications on: April 23, 2008, 02:55:24
Hi Cliff,
Thanks for the thats a ninja move - I know you are probable kept pretty busy.

My listNotificationsInterests is starting to get around 5 or 6 in the array - I know in your documentation you said if it gets over 3 or 4 then you should be looking at segregating them out, is it possible for one component to have multiple Mediators? Is that a wise move?

I would be pretty keen to get your input on the coding at specific points within this project if thats  alright??

Cheers
~D
15  Announcements and General Discussion / Architecture / Re: Dynamic Mediators and Notifications on: April 21, 2008, 05:54:31
sorry clif not  keith I is tired
Pages: [1] 2