Mediating TextFields ?

Gustavo 's Avatar

Gustavo

07 Jan, 2013 05:47 PM

Hi guys!

Here is the problem of the day:
I had the brilliant(?) idea of mediating all the TextFields of an application to initiate only once the correct .text property using a culture VO that I populate from a JSON.

Anyhow, I just noticed that I can mediate Sprite's, and even InteractiveObject's but no TextField's.
Even when Mediating the InteractiveObject's I don't get the TextField's.

Independently speaking, without regarding if the approach of creating a mediator per TextField id the optimal solution. Can somebody please explain me WHY is it so that the TextField's can NOT be Mediated? or maybe tell me what am I missing in order to actually mediate them.

Thanks guys!

  1. Support Staff 1 Posted by Shaun Smith on 07 Jan, 2013 06:58 PM

    Shaun Smith's Avatar

    Hi Gustavo,

    Are you using Robotlegs 2? If so, native flash objects are filtered out for performance reasons:

    https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...

    If you're using RL1 you should almost certainly be able to mediate text fields.

  2. 2 Posted by Gustavo on 08 Jan, 2013 07:17 AM

    Gustavo's Avatar

    Hi Shaun,

    Thank you for the quick response.

    I'm using RL2.... I see now the filter in the link you sent me...

    hmmm.. I'm still wondering if this idea (Mediate TextFields to populate the .text property from external config files) would be a good approach.

    What do you think?

  3. Support Staff 3 Posted by Shaun Smith on 08 Jan, 2013 08:10 AM

    Shaun Smith's Avatar

    Hey Gustavo,

    Populating text from external files is good, but doing it by mediating such low level types sounds very fragile to me.

    If you want to, you can create a copy of the StageObserver without the filter, and install it instead of the default StageObserver by creating your own bundle:

    https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...

    I do wonder if forcing that filter on everyone is a good idea - it might be helpful to make the filter configurable.

  4. 4 Posted by Gustavo on 08 Jan, 2013 06:17 PM

    Gustavo 's Avatar

    I would vote for a configurable filter.

    This would/could also be useful in extensive projects with large teams and libraries, where the head dev's could predefine or limit (again thinking about performance) the mediation of specific types and/or packages.

  5. Ondina D.F. closed this discussion on 07 Feb, 2013 04:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac