在as中监听自定义事件 (二)

2014-11-24 10:50:59 · 作者: · 浏览: 1
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
{
// Push backgroundColor and backgroundAlpha directly.
// Handle undefined backgroundColor by hiding the background object.
if (isNaN(getStyle("backgroundColor")))
{
background.visible = false;
}
else
{
background.visible = true;
bgFill.color = getStyle("backgroundColor");
bgFill.alpha = getStyle("backgroundAlpha");
}

super.updateDisplayList(unscaledWidth, unscaledHeight);
}

private function img_mouseOutHandler(event:MouseEvent):void{

// TODO Auto-generated method stub
var e:MyEvent= new MyEvent(MyEvent.myclick);
img.dispatchEvent(e);

}




]]>






























< xml version="1.0" encoding="utf-8" >

-->


xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5">
[HostComponent("spark.components.BorderContainer")]


import bridge.MyEvent;
/**
* @private
*/
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
{
// Push backgroundColor and backgroundAlpha directly.
// Handle undefined backgroundColor by hiding the background object.
if (isNaN(getStyle("backgroundColor")))
{
background.visible = false;
}
else
{
background.visible = true;
bgFill.color = getStyle("backgroundColor");
bgFill.alpha = getStyle("backgroundAlpha");
}

super.updateDisplayList(unscaledWidth, unscaledHeight);
}

private function img_mouseOutHandler(event:MouseEvent):void{

// TODO Auto-generated method stub
var e:MyEvent= new MyEvent(MyEvent.myclick);
img.dispatchEvent(e);

}




]]>