<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.filters.DropShadowFilter;
//创建阴影滤镜
private function getDropShadowFilter():DropShadowFilter
{
var color:Number=0x979590;
var angle:Number=60;
var alpha:Number=1.0;
var blurX:Number=4;
var blurY:Number=4;
var distance:Number=3;
var strength:Number=1.0;
var inner:Boolean=false;
var knockout:Boolean=false;
var quality:Number=BitmapFilterQuality.HIGH;
return new DropShadowFilter(distance, angle, color, alpha, blurX, blurY, strength, quality, inner, knockout);
}
//记录上次选择的Image对象
private var oldImg:Image=null;
//当前选择的节点,显示阴影的方法
private function clieckHandler(event:MouseEvent):void
{
var img:Image=(event.currentTarget) as Image;
if (oldImg != null)
{
oldImg.filters=[];
}
if (img.filters.length == 0)
{
img.filters=[getDropShadowFilter()];
}
else
{
img.filters=[];
}
oldImg=img;
}
]]>
</mx:Script>
<!-- 节点工具栏 -->
<mx:Canvas width="2%" height="100%" borderStyle="solid" borderColor="black" shadowDistance="0" cornerRadius="8" borderThickness="1" dropShadowEnabled="true">
<mx:VBox height="100%" width="100%" horizontalAlign="center">
<mx:Text text=""/>
<mx:Image source="../images/application_get.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/add.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:HRule width="100%"/>
<mx:Image source="../images/application.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/arrow_in.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/arrow_right.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:HRule width="100%"/>
<mx:Image source="../images/arrow_rotate_anticlockwise.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/asterisk_yellow.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/award_star_gold_3.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:Image source="../images/bell_delete.png" completeEffect="Fade" click="clieckHandler(event);"/>
<mx:HRule width="100%"/>
</mx:VBox>
</mx:Canvas>