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]
16  Announcements and General Discussion / Architecture / Continous x,y coordinates from multiple sprites on: March 09, 2009, 08:33:53
So, I have this Flex project where I am creating popups on the main stage for several sprites on the display list. So if you click a sprite it opens a new popup.  The issue is the sprites move so I need the popups to move also.

And no I can't put the popups in the sprite because sprite isn't high enough on the hierarchy so it isn't an option.  So I have SpriteMediators for each sprite and a popupmediator for each popup.

What I am thinking of doing is having the sprite dispatch continous events that contain the x,y of the sprite. Then have the spritemediator convert those events to notifications.  Then have the popupmediators receive those notifications and alter the popup accordingly.  The issue is how can I tell which spritenotification goes with which popupmediator?

Maybe this is the totally wrong structure?  I am not using the multicore and I can't switch to that as I have a deadline in two days.  If multicore is the best way to go I can switch it later, but I need a temporary fix for now.
17  Announcements and General Discussion / General Discussion / Vslider changeEvent & Zoom? on: March 08, 2009, 01:33:30
I was wondering if someone can lend me a hand brain on this issue.  I have an application that has a Vslider. When you navigate the vslider a sprite on the stage should scale depending if the user is increasing/decreasing the slider.  Nothing to abnormal here....user can click on the slider, drag the slider, all the normal stuff (livedragging = true). I listen to the change event of the slider when that event is dispatched I send a notification that my sprite should change its scale based on the data that was sent with the notification.

The catch is that with a keyboard(ctrl) + mouse drag the user can scale the sprite independent of the Vslider.  The issue is that when you do the ctrl+mouse drag, I have to tell the Vslider that the sprites scale has changed so it, the vslider, needs to change its value to match, so say we scaled the sprite to 1.25, I need to tell the vslider that it shouldn't be scale=1 anymore and it needs to match the sprites scale.

The issue is that when I tell the slider to move it dispatches its changed event, which then causes it to dispatch its changeevent but the sprite is s already the correct size.  The other issue is that the vslider I can set via sending it a zoom value, such as in this case 1.25.  But the framework I am using with the sprite doesn't accept values such as 1.25.  It only accepts the difference between 1.25 and 1.00 so .25; 

So my issue is how can I get both to stay in sink?  I think the changeevent of the vslider is only suppose to send the change event when altered by the mouse, but I am doing it via a method, so guessing their is  bug in the code.  Not sure the best way to implement with Puremvc, with cairngorm I would use a global variable or VO and bind to that. 

TIA
18  Announcements and General Discussion / General Discussion / DisplayObject not being removed from memory getting Error #2025 on: February 25, 2009, 09:28:43
So I have on my main Application page 3 components:

Graph: displaylist[0]
Menu: displaylist[1]
vslider: displaylist[2]

I am trying to create a popup (can't use popup manager because popup needs to be between Graph and Menu (see above).

So I am instantiating a component that looks like a callout on DisplayList[1] pushing everything else up. So far so good.  To create the callout you click on child objects of Graph the first time you click an object, creating a callout and its Mediator, it opens the callout. You can then close the callout, which also removes the Mediator. But when I click another node the first callout isn't deleted from memory so it tries to use that callout and that is when i get the #2025 error.

I have double checked that all references to the first callout are deleted or removed. Still I get the error?

Any suggestions?

TIA, J
19  Announcements and General Discussion / General Discussion / Should notifications always go through a Command on: February 15, 2009, 04:11:59
Should all notifications be registered with a command?  If not when should then vs. when shouldn't they?

Should you only registerCommand's when they are big events like on startup, major changes, or shut downs?

20  Announcements and General Discussion / Architecture / 1000 Sprites /w data. Mediator for each? Memory? on: February 13, 2009, 12:41:55
I am building my first PureMVC based project and wondering which would be the best way to go.

My app can have up to 1000 sprites, think node/edge (tree structure), and I am thinking of giving each node and edge its own mediator and proxy.  I don't have to do this as I have a collection item that keeps track of each node and edge group ( so 500 in each), which contains functions to manipulate each node/edge.  But, it would make things a little more flexible if I can handle some mouse related events on each node and edge directly. 

So my question is? Is there any issues with memory usage with giving each node/edge (up to 1000 total) their own proxy and mediator?  Keep in mind my app will already be a memory/cpu hog because of all the sprites.

Or should I go with just a mediator and proxy for the container that holds all 1000 sprites?


 
21  Announcements and General Discussion / Architecture / To multicore or not to multicore? on: February 03, 2009, 04:50:11
I am starting a PureMVC Flex app and wondered if anyone can lend some puremvc experience upon me.

I have an app that has two modes design and view mode. I am trying to go the easiest path here so I am not sure if Modules would be a better way to go or would it be better to go another way. 

The issue is I have mouse click events and keyboard events that I listen for and their functions are completely different in each mode. So would modules be easiest or do something like remove Proxies and Mediators be the best route?

TIA, J
Pages: 1 [2]