Giter Club home page Giter Club logo

Comments (7)

PrimaryFeather avatar PrimaryFeather commented on May 18, 2024

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!!!

from starling-framework.

elsassph avatar elsassph commented on May 18, 2024

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.

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on May 18, 2024

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?

from starling-framework.

elsassph avatar elsassph commented on May 18, 2024

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"));

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on May 18, 2024

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

from starling-framework.

elsassph avatar elsassph commented on May 18, 2024

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

from starling-framework.

PrimaryFeather avatar PrimaryFeather commented on May 18, 2024

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

from starling-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.