tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/87-spark-graphicelements-not-mapping-to-mediatorsRobotlegs: Discussion 2018-10-18T16:35:11Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T20:46:12Z2010-05-05T20:46:44ZSpark GraphicElements not Mapping to Mediators<div><p>Sorry, I forgot to include the injected ellipse in the mediator
class, but the problem remains, I included the updated project.</p></div>Garth Braithwaitetag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T20:47:05Z2010-05-05T20:47:05ZSpark GraphicElements not Mapping to Mediators<div><p>My first thought:</p>
<p><a href=
"http://github.com/robotlegs/robotlegs-framework/blob/v1.0.3/src/org/robotlegs/base/MediatorBase.as#L60">
http://github.com/robotlegs/robotlegs-framework/blob/v1.0.3/src/org...</a></p>
<p>perhaps Spark GraphicElements don't dispatch creationComplete
events?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T21:04:13Z2010-05-05T21:04:13ZSpark GraphicElements not Mapping to Mediators<div><p>Ah, an Ellipse is not a view component:</p>
<p>Ellipse <- FilledElement <- StrokedElement <-
GraphicElement <- EventDispatcher!</p>
<p>So, unfortunately, that's not going to work with auto-mediation
(which is display list driven) - you'd have to mediate manually.
Boo.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T21:27:47Z2010-05-05T21:29:35ZSpark GraphicElements not Mapping to Mediators<div><p>Poop. It's what I was afraid of.</p>
<p>Any best practices for mediating manually?</p></div>Garth Braithwaitetag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T21:36:28Z2010-05-05T21:36:28ZSpark GraphicElements not Mapping to Mediators<div><p>I mediate manually from a mediator of the parent container. This
can be the root app in some circumstances.</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T21:45:01Z2010-05-05T21:45:01ZSpark GraphicElements not Mapping to Mediators<div><p>Wait a potato.. why would you be mediating an Ellipse?</p>
<p>Regarding manual mediation:</p>
<ol>
<li>It's a good idea to disable autoCreate and autoRemove (last two
params) when mapping mediators that you plan on manually
mediating.<br></li>
<li>Always remember to remove mediators when you are done.<br></li>
<li><a href=
"http://knowledge.robotlegs.org/discussions/questions/117-any-other-way-to-create-mediators-other-than-listening-to-added_to_stage#comment_1363130">
http://knowledge.robotlegs.org/discussions/questions/117-any-other-...</a></li>
</ol></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T22:10:53Z2010-05-05T22:11:02ZSpark GraphicElements not Mapping to Mediators<div><p>I have my reasons.</p>
<p>So if I manually map mediators, is there a central class that
stores references to these mediators?</p></div>Garth Braithwaitetag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T22:20:07Z2010-05-05T22:20:07ZSpark GraphicElements not Mapping to Mediators<div><p>Fair enough.</p>
<p>Indeed, mediator instances are held in the MediatorMap.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T22:26:56Z2010-05-05T22:26:56ZSpark GraphicElements not Mapping to Mediators<div><p>Side note: bootstrapping the context in MXML can be done like
this:</p>
<pre>
<code><fx:Declarations>
<controller:AppContext contextView="{this}"/>
</fx:Declarations></code>
</pre>
<p>which removes the need for a messy lookin' script block.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T23:04:56Z2010-05-05T23:05:04ZSpark GraphicElements not Mapping to Mediators<div><p>True, but I'm on an anti-binding kick. Makes me feel like I care
about performance.</p></div>Garth Braithwaitetag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-05T23:09:06Z2010-05-05T23:09:06ZSpark GraphicElements not Mapping to Mediators<div><p>Yeh, I hear you, I'm on that same trip - ripping out binding
makes me happy.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-06T19:09:39Z2010-05-06T19:10:00ZSpark GraphicElements not Mapping to Mediators<div><p>Do you think there will ever be any plans to add support for
auto mediation mapping of Graphic Elements?</p>
<p>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?</p></div>Garth Braithwaitetag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-06T19:27:07Z2010-05-06T19:27:07ZSpark GraphicElements not Mapping to Mediators<div><p>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.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16120292010-05-08T08:34:10Z2010-05-08T08:34:13ZSpark GraphicElements not Mapping to Mediators<div><p>2 cents:<br>
1 cent: wrap your ellipse in a group<br>
2 cents: dispatch creation complete event and other events RL is
interested in all bys yourself<br></p></div>Daniel