Your best bet is to create a new class that overrides .visible with a getter/setter, and add the event there (pretty much the same Henrik Andersson said). It's pretty clean and doesn't require changes anywhere else, but it also means you cannot use a Sprite but rather your new class.
Zeh On Sun, Feb 21, 2010 at 12:24 PM, Kerry Thompson <[email protected]>wrote: > Alexander Farber wrote: > > > Is there please an AS3-event broadcasted > > when a Sprite is shown or hidden? > > Not per se, but you might try Event.RENDER. I doubt it would work, > though--it's dispatched when the display list is about to be updated > and rendered. You'd get a lot of those to process, and I'm not even > sure if changing the visibility causes the update list to be updated. > > I think your best bet is to dispatch a custom event. Of course, to do > that, you would have to have the code that could change the sprite's > visibility. Another option would be to simply check the sprite's > visibility on a frame event, but that's pretty clunky. > > Cordially, > > Kerry Thompson > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

