How to map starling.event.Event with the Command?
I have an issue with Starling and Robotlegs 2. I want to dispatch an event that extends starling.event.Event from View using Mediator. The problem is that such an event cannot be mapped with a Command. Only the event that extends from the flash.events.Event. How can I do that?
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
Support Staff 1 Posted by Ondina D.F. on 12 Oct, 2015 11:04 AM
That's right.
Starling Events are different from the flash.event.Event. Also, Starling has its own EventDispatcher, so the robotlegs shared event dispatcher can't hear the events dispatched on the Starling one.
The solution is to find a way of 'translating' the starling events into custom flash events and to dispatch the custom flash events on the robotlegs' shared dispatcher.
The shared event dispatcher can be injected into mediators or even into views, if need be.
But, there are already a few Starling extensions available for robotlegs 2 which were built to solve the problem of Starling's Event, EventDispatcher and automatic mediators creation.
I don't know about the state of these projects, whether they are still maintained, whether they work with the latest version of robotlegs 2 and so on. You'll have to try them out and see which one is working for you best. I'd start with Andreas' clock example.
Jamie's
Robotlegs extension to enable simple mediator mapping to a Starling Stage instance:
https://github.com/jamieowen/robotlegs2-starling-viewmap
Robotlegs extension to enable simple mediator mapping to an Away3D View3D instance:
https://github.com/jamieowen/robotlegs2-away3d-viewmap
Andreas'
RobotLegs 2 clock example (with feathers-ui/starling) - using Jamie's robotlegs2-starling-viewmap :
https://github.com/brean/robotlegs2-starling-clock-example
Alessandro 's Extension - allows you to use Robotlegs with Starling and Feathers like you'd use with a regular display list
https://github.com/alebianco/robotlegs-utilities-starling
Vjekoslav 's Example for SARS integration:
https://github.com/Vj3k0/robotlegs-bender-example-SARS-integration
For robotlegs version 1:
Omar's Robotlegs plugin that adds some Robotlegs classes to support usage with the Starling framework.
https://github.com/s9tpepper/robotlegs-starling-plugin
I hope this helps.
Ondina
Daniil closed this discussion on 12 Oct, 2015 01:59 PM.