Here we are with a new tip of the day.
After seeing the difference between target and currentTarget , after analysing the property dropTarget , today we will look at the property mouseChildren of the DisplayObjectContainer Class.
This property is used with MovieClip, Sprite, Loader and Stage.
Why??? Because, the DisplayObjectContainer Class is a super Class of Loader, Sprite and Stage. It means that those classes inherit the methods and properties of the DisplayObjectContainer. The MovieClip class, instead, is a subclass of Sprite so inherits its methods and properties from it.
What is so special about the mouseChildren?
Simple, it can help us resolve one problem.
As an example, let us say that we have a MovieClip containing more objects (ex: a text field) and that we want the mouse to interact with that MovieClip.
We add the needed listeners and realise that when the mouse is above the MovieClip it does not transform itself into the ‘hand’ pointer. In fact, it would do so, only if the mouse is above one of the MovieClip’s object such as the text field.
Now, it is time to act on the property mouseChildren, the following way…







{ 1 trackback }