Skip to main content
W_Bell
Inspiring
January 15, 2009
Question

_visible = true listener

  • January 15, 2009
  • 4 replies
  • 360 views
Anybody know if I can I make a listener object broadcast a visible event?
Similar to the following:

//TEST BUTTON++++++++++++++++++++++++++++++++++++++++++++++++++++++++//////////////////////////////

var listenerObject:Object = new Object();
listenerObject.myList._visible = true;
function(eventObj:Object) {;
// My code here
controls_LH.mybutton._visible = false;
}

broadcasterObject.addListener(listenerObject);


//OBJECTIVE: if myList.visible=true then hide the button
This topic has been closed for replies.

4 replies

Inspiring
January 16, 2009
I have no idea where my code went! And I didn't save it. Sorry. If you need help post back.
kglad
Community Expert
Community Expert
January 16, 2009
you're correct rr. wb will need to use a custom property of a listener object to control the visibility of his/her button.
Inspiring
January 16, 2009
I'm pretty sure watch() can't be used for the built in Flash class's properties, e.g. _x, _visible, _alpha. At least I haven't found a way.

But you can make your own "getter/setters" using watch() that then control those properties. So make your own x, visible, or alpha property. Set those with your code and and have the watch function set the _x, _visible, and _alpha.

Hopefully this example will help. I'm using the alpha so that you can easily see what happens. Put two simple clips on the stage with instance names of clip1 and clip2.
kglad
Community Expert
Community Expert
January 16, 2009
check the watch() function.