Spark GraphicElements not Mapping to Mediators
Messing with Spark GraphicElements but they aren't mapping to mediators.
I included a simple example project with trace statements illustrating the problem.
I might be doing something dumb, but it looks right to me.
- ElementMediatorTest.fxp 49.2 KB
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Garth Braithwai... on 05 May, 2010 08:46 PM
Sorry, I forgot to include the injected ellipse in the mediator class, but the problem remains, I included the updated project.
Support Staff 2 Posted by Shaun Smith on 05 May, 2010 08:47 PM
My first thought:
http://github.com/robotlegs/robotlegs-framework/blob/v1.0.3/src/org...
perhaps Spark GraphicElements don't dispatch creationComplete events?
Support Staff 3 Posted by Shaun Smith on 05 May, 2010 09:04 PM
Ah, an Ellipse is not a view component:
Ellipse <- FilledElement <- StrokedElement <- GraphicElement <- EventDispatcher!
So, unfortunately, that's not going to work with auto-mediation (which is display list driven) - you'd have to mediate manually. Boo.
4 Posted by Garth Braithwai... on 05 May, 2010 09:27 PM
Poop. It's what I was afraid of.
Any best practices for mediating manually?
Support Staff 5 Posted by Joel Hooks on 05 May, 2010 09:36 PM
I mediate manually from a mediator of the parent container. This can be the root app in some circumstances.
Support Staff 6 Posted by Shaun Smith on 05 May, 2010 09:45 PM
Wait a potato.. why would you be mediating an Ellipse?
Regarding manual mediation:
7 Posted by Garth Braithwai... on 05 May, 2010 10:10 PM
I have my reasons.
So if I manually map mediators, is there a central class that stores references to these mediators?
Support Staff 8 Posted by Shaun Smith on 05 May, 2010 10:20 PM
Fair enough.
Indeed, mediator instances are held in the MediatorMap.
Support Staff 9 Posted by Shaun Smith on 05 May, 2010 10:26 PM
Side note: bootstrapping the context in MXML can be done like this:
which removes the need for a messy lookin' script block.
10 Posted by Garth Braithwai... on 05 May, 2010 11:04 PM
True, but I'm on an anti-binding kick. Makes me feel like I care about performance.
Support Staff 11 Posted by Shaun Smith on 05 May, 2010 11:09 PM
Yeh, I hear you, I'm on that same trip - ripping out binding makes me happy.
12 Posted by Garth Braithwai... on 06 May, 2010 07:09 PM
Do you think there will ever be any plans to add support for auto mediation mapping of Graphic Elements?
I'll be looking at forking and trying to implement it, but would it ever be merged in the trunk if I do get it working?
Support Staff 13 Posted by Shaun Smith on 06 May, 2010 07:27 PM
If you can figure out how to do it, then sure, it would almost certainly be merged in. To be honest though, I don't see any way to automatically do something with an entity that doesn't land on stage and doesn't dispatch any useful events. I'd be very happy to be proved wrong though.
14 Posted by Daniel on 08 May, 2010 08:34 AM
2 cents:
1 cent: wrap your ellipse in a group
2 cents: dispatch creation complete event and other events RL is interested in all bys yourself
Stray closed this discussion on 10 Feb, 2011 05:17 PM.