我似乎无法在符号及其子符号上设置鼠标事件(onRelease/onRollOver/...)。
我有一个m_Background
符号,它包含两个不重叠的矩形,比如说m_Left
和m_Right
我的类中包含m_Background
符号的对象的以下代码(其余代码几乎是空的,调用的函数只包含一个跟踪以检查正在发生的事情称为)
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);
}
}
使用该代码,onRollOver
andonRollOut
事件可以正常触发,但 onPress 不会。如果我注释掉最后两行,onPress 会再次开始工作。此外,声明的顺序似乎并不重要,并且 onPress 总是最终被覆盖(因为它在我假设的子元素上?)
有关如何解决该冲突以使所有事件在嵌套符号上按预期工作的任何建议?