Author Topic: More getters please.  (Read 481 times)

JazzMasta

  • Newbie
  • *
  • Posts: 4
  • Flash developer since -05
More getters please.
« on: March 05, 2010, 10:56:28 AM »
I would really like to see some more getters throughout the framework, for easier customization of elements and asul objects from my own plugins.

Example:
I'm building a plugin where I want to access the TextField in a Text asul object, to add a listener for TextEvent.TEXT_INPUT.

If there were a getter in the Text class like:
public function get tf():TextField {return textField;}
it would really make it easier..

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1342
  • MegaZine3 Developer
    • MegaZine3
Re: More getters please.
« Reply #1 on: March 28, 2010, 02:22:06 PM »
You can add that listener directly to the Text asul element. The textfield specific events are forwarded from the underlying TextField element.
(see http://svn.mightypirates.de/megazine/trunk/src/de/mightypirates/asul/components/Text.as lines 388+)

Technically, listeners registering with the Text asul element are just added to the textfield itself for those event. The events are:
TextEvent.LINK, TextEvent.TEXT_INPUT, Event.CHANGE and. Event.SCROLL.
« Last Edit: March 28, 2010, 02:25:53 PM by Florian Nücke »
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.