You can extend the Button class to plus a reference to the Label to do that. But, this way is not recommended since it violates some OOP rules.
If you can share us your purpose, we may help you find another way to achieve that.
I want to keep in the rules, so
this is an eduction system every object hast it own sound clip
my screen has a control (ubutton) based on a button and 4 controles based on a label (ulable) id l1,l2,l3,l4 each ulabe will play one sound
so when you can click on the ulabe and it will pay the sound dog, cat, etc..
that all works fine
I want to click on the button ubutton, it will play its own sound clip, then some how play the sound form for each of the ulabes
i did try
which did not work
but the I read you should use "events" in Flex so I was thinhing i shoud do somenting like
send event playsound to l1
send event playsound to l2
send event playsound to l3
send event playsound to l4
a nother example, when i click on a button at the top of the screen the coulor of all ulabe (words) should highligh, so one button sending out a message and all other button reacting to this event
if this is not clear I can build a small exmaple
let me try and make this simple
If I have components / objects , A and B
B has some code that plays a sound
how do I in the code of A, call the methord defined in object B to play the sound
What happens with l1.playsound();
Do you get an error?
I have tried
1120: Access of undefined property b11.
1119: Access of possibly undefined property b11 through a reference with static type Class.
In both cases flex thinks they is not