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 [3] 4
31  Announcements and General Discussion / General Discussion / Re: How to handle ONLY ONE callout on: March 26, 2009, 02:25:40
Cliff, So I tried what you said and I am getting this error "Error #2025: The supplied DisplayObject must be a child of the caller." when I call mainstage.removeSuperDetails();

Code in StageMediator------------------------

sdc = the callout that is on stage.
Code on MainStage -------------------------
public function removeSuperDetails() : void
               sdc = null;
               this.dispatchEvent( new Event ( NODECALLOUTCLOSED, true ) );
32  Announcements and General Discussion / General Discussion / Re: How to handle ONLY ONE callout on: March 25, 2009, 07:23:43
Cliff, you have it correct.  The issue is that I close the callout for several different reasons, such as if the user drags the stage or zooms or clicks a home button.  I also close the callout if they click the X button to close. I also close the callout when a user clicks another marker, which is what causes issues. Since I am closing an instantly opening a new one.

I am beginning to think that it might be better to not destroy the callout, but rather hide it and then just move it to a new marker and change the VO in the calloutProxy. That way I won't have to destroy anything, but I am not sure if this is best and how I would handle the any changes in regards to the calloutMediator, if I need to at all?

33  Announcements and General Discussion / General Discussion / How to handle ONLY ONE callout on: March 25, 2009, 04:29:01
So I have a Puremvc (Single) / Flex app and in this app I have 'Callouts', which are like Google Maps callouts when you click on a marker. Just like Google Maps I only want to allow one Callout open ever. Just like Google Maps I if my app is dragged I need the Callout to follow so right now when my callout is created I addEventListener for enterframe event and then send my Callout its new coord, which are my markers new location.

All this works fine, but the issue is I cannot seem to find a clean way to remove the callout and its eventlistener when a new node is clicked.  I have a very dirty hack that more than likely breaks PureMVC best practice right now and of course it isn't stable, thus I am posting.

And no I cannot use the Flex popup, this is for several reasons that would take to long to explain.  Also to make matters worse my callout is on the main stage because it needs to be on top always and my markers are down about 4 levels in the display list.

All that being said does anyone have any suggestions on the best way to handle this?  The issue again seems to be in removing a callout and then immediately creating a new one. I have traced the issue back to UIComponents.callLaterDispatcher.  When I click a new marker I send a notification that ends up in a callout being closed, but then immediately creating a new one and UIComponent ends up storing all this in a queue that I guess is getting backup in workload. Or it could be something else. Anyway i figure via PureMVC their is a better way to do this. Would I be correct?  Maybe something like not removing the eventlistener and callout but hiding it and then just assigning it to a new marker and then turning it back on?

Though when I do want to close it manually, not by clicking another marker how would it get removed?

Hope I didn't lose you.

34  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 24, 2009, 08:27:43
Cliff, I am beginning to think you have done this before?  ;D
35  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 23, 2009, 03:25:42
Cliff, so how would I bind my views to a model? By model I assume a Proxy with VO object?
36  Announcements and General Discussion / General Discussion / Proxy referencing other proxies on: March 23, 2009, 03:23:40
Is it bad form to have proxies referencing other proxies, so as to have access to the retrieved proxies data?

Or would it be better to use a command to create a proxy and send in the data from another proxy then.

execute {
facade.retrieProxy (myproxy);
facade.registerProxy( new Proxy( myproxy.getData() ) );
37  Announcements and General Discussion / Architecture / True or False? Not good pratice to have import org.puremvc* in Mediators on: March 10, 2009, 02:48:40
Is it true that you should not have references to other mediators from medicators?  Thus, if you are import org.puremvc * in your mediators you are doing something wrong?

38  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 10, 2009, 10:11:46
Thanks Cliff.
39  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 10, 2009, 06:57:43
Thanks for all your help. I am not good at Statemachine either.  I will try to use it, but hope someone else with Statemachine experience can lend some advice.
40  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.
41  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 09, 2009, 01:03:47
Ok, think google maps.  You can scale/zoom with a slider, but you can also double click the map and it will resize and position, thus updated the slider from the map (map has control).  You can also scale google maps via the mousewheel.  I can do both mousewheel and doubleclick, but I can also do ctrl + move mouse up/down to zoom.  I mean I push ctrl then hold my mouse button down then drag up to zoom in or drag down to zoom out.

So when I try doing the doubleclick, mousewheel, or ctrl-mousedown-drag I play hell trying to get it to work.  I set a flag on vslider component that says if zoom set out side of slider than dirty the flag then when my handleSliderChange function is called it first checks to see if the flag is dirty if so it bails out, returns. It just seems ugly/dirty and breakable.  I had to remove the doubleclick as it was causing all kinds of issues.

42  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 09, 2009, 08:31:29
Sorry you are correct!

You said "You just need a flag or a state to set the  active component.
On thumbDrag you set the slider as the active one.
On mouse+key event you set them to the active ones.

The active ones change the values of the passive ones and of themselves and the dimensions of the sprite when they are clicked or dragged or whatever.

If you change the values on changeEvent they are both active or you have an endless loop if you don't know which one has triggered the changes."

This is exactly what is happening. From what I have read Flex's slider.changeEvent is suppose to be dispatched from mouse manipulation only, but its being dispatched via my programmic changes as well.

Would this be appropriate to use a Proxy and Command?  Maybe the Command can update/retrieve Proxy changes and update which ever component (slider or sprite) did not initiate the change, with the Proxy data?

43  Announcements and General Discussion / General Discussion / Re: Vslider changeEvent & Zoom? on: March 09, 2009, 06:55:03
Thanks for the example.  Unfortunately, I can't use another slider.  Guess I will have a look at State Machine.
44  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. 

45  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?

Pages: 1 2 [3] 4