I can't seem to setup mouse events (onRelease/onRollOver/...) on both a symbol and its child symbols.
I have a m_Background
symbol, which contains two non-overlapping rectangles, lets say m_Left
and m_Right
and the following code within my class for the object containing the m_Background
symbol (rest of the code is pretty much empty and functions called just contain a trace to check what is being called)
class MyComponent extends UIComponent
{
var m_Background:MovieClip;
function configUI()
{
m_Background.m_Left.onPress = Delegate.create(this, Function1);
m_Background.onRollOver = Delegate.create(this, Function2);
m_Background.onRollOut = Delegate.create(this, Function3);
}
}
With that code, the onRollOver
and onRollOut
events trigger fine but onPress doesn't. And if I comment out the last 2 lines, onPress starts working again. Also the order of declaration doesn't seem to matter and onPress always ends up overwritten (because it's on a child element I assume?)
Any suggestions on how to solve that conflict to have all events work as expected on nested symbols?