apache / royale-asjs

Apache Royale ASJS
Apache License 2.0
374 stars 116 forks source link

How to Replace CairngormEvent in Apache Royale ? #1067

Open mzamoun opened 3 years ago

mzamoun commented 3 years ago

Hi,

How to replace CairngormEvent in apache royale ?

I have this code witch not compile :

import com.adobe.cairngorm.control.CairngormEvent;

public class RightClickEvent extends CairngormEvent {
carlosrovira commented 3 years ago

Don't remember the implications of CairngormEvent, but in Royale you mostly need to use Royale Event import org.apache.royale.events.Event; so just extend from that class. If you need to make the event bubbles, just put that param to true

mzamoun commented 3 years ago

Ok, thanks it says that dispatch() doesn't exist ?

carlosrovira commented 3 years ago

I think you refer to a method "dispatch()" in CairngormEvent, but that's only Cairngorm. In Royale is like in Flex you need the host class to be a dispatcher or similar. I recommend to search in list since I think Greg Dove posted a link with a Cairngorm migration to Royale, maybe it will be of help to you. Also I recommend you to switch to Crux since is far more potent and easy to use and also I think Greg did a "command" like Cairngorm class for people coming from Cairngorm. If you want to see Crux in action you can check our examples for the jewel crux version of TodoMVC example that use it.

HTH