-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dispatchEvent inconsistencies with <f:Screen> & <f:PanelScreen> #16
Comments
Both classes use starling.events.Event. They're both Starling display objects, so it would be impossible to dispatch flash.events.Events from either one of them. |
Perhaps I didn't explain it correctly (apologies) Here's 2 screenshots showing the problem. Note the highlighted error. in both cases i haven't imported any Event classes, so you can see how the 2 screens expect different Event types (starling vs flash) If I import starling.events.Event the error will reverse. Does that make sense? |
Ah yes, you need to explicitly write; dispatchEvent(new starling.events.Event( starling.events.Event.COMPLETE)) I think this is a limitation of the compiler trying to automatically say its a Flash event. |
This is most likely a false error from your IDE. The Flex SDK automatically imports flash.events.Event in any MXML file (even if you don't import this class in your fx:Script element), so IDEs expect that behavior. The Feathers SDK does not import flash.events.Event automatically in MXML files. Instead it imports starling.events.Event. IDEs don't expect that, so their internal model of what has been imported in an MXML file can be wrong. The compiler should be able to compile the code without error, even if your IDE thinks its wrong. To make the IDE happy, you can use the fully qualified class name. It's not required, though. |
A good basic rule to keep in mind when using the Feathers SDK with a Flex IDE is that you shouldn't always trust the errors shown in the editor. Double-check that the compiler gives you the same error. |
You're correct, it does compile properly even though fully-qualified still shows error. - I'll make a mental note moving forward ;) - Thanks guys :) BTW. IDE is Intelli-J |
I only said fully qualified because I can't stand red in the IDE. :) But yeah I forgot it compiles fine without out it. |
Oh that's why Intellij highlight starling event in gray like unused |
My current project uses both Screen and PanelScreen as views. Just noticed that Screen uses dispatchEvent(starling.events.Event) while PanelScreen uses dispatchEvent(flash.events.Event).
This is a bit of a problem when expecting a specific event in mediators etc.
The text was updated successfully, but these errors were encountered: