Skip to content
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

DataEvent class #48

Closed
elsassph opened this issue Oct 30, 2011 · 7 comments
Closed

DataEvent class #48

elsassph opened this issue Oct 30, 2011 · 7 comments

Comments

@elsassph
Copy link

Hello,

I know it's trivial, but while you're reimplementing the event dispatching model in Starling API you might as well include a DataEvent class.

@PrimaryFeather
Copy link
Contributor

Hi Philippe,
you mean an Event that has a data property of type Object (or Dictionary?), right? You're right, that sounds like a good idea!!!

@elsassph
Copy link
Author

Yep I mean a simple flash.events.DataEvent class in the startling API.

It's better to dispatch a string value than check the target object to know what it's about.

@PrimaryFeather
Copy link
Contributor

Hm, I have never used that event class manually -- only when built-in classes (like XMLSocket) dispatch them.

But in principle, you want just an event that you can attach a string to, right? That would work perfectly fine with a "DataEvent" class that has a "data" property of type "Object" -- and then, people could attach a dictionary, as well (I know several developers who are too lazy to always create custom Event-subclasses with properties, LOL!)

Would that help?

@elsassph
Copy link
Author

Well it sounds reasonable to allow passing any object as the data instead of just a string.

I'm using it a lot for instance for navigation actions:
dispatchEvent(new DataEvent("navigate", true, true, "menuscreen"));

@PrimaryFeather
Copy link
Contributor

Makes sense, thanks for the suggestion! I'll make it so! =)

@elsassph
Copy link
Author

As a side note I suggest you use the * type (data:*).

@PrimaryFeather
Copy link
Contributor

The "data" property is now part of any Starling event object. That should settle this! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants