tags:

views:

22

answers:

1

Are IDs attributes shared between different modules in Flex ?

i.e. I have a text area with id="text1" in my menu.mxml file.

And I want to write on it from another module mainArea.mxml

The debug gives me error, so how can I share different components ?

thanks

A: 

I'd suggest you create a central model object that contains the text instead of trying to access elements by ID. If you access elements by ID -- and I'm not sure if this works cross-module -- you tightly couple your code as opposed to having a central model that takes care of that. Then the calling code does not need to know about the text area or label or whatever you happen to bind to it.

ilikeorangutans
OK. I'm going to use a data model (actionscript class) and several components in different modules will bind to it. (I guess this is what you suggest). Thanks
Patrick
Yes that's what I meant. :)
ilikeorangutans