flash的动画元件作FLEX皮肤

本文详细介绍如何在Flash中设计动画并将其导出为Flex可用的SWC文件,接着通过扩展Flash元件及自定义皮肤的方式在Flex项目中复用这些动画资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、在flash中设计好动画。并为关键帧设置名称,再导出成FLEX元件的SWC

2、将SWC添加进FLEX的LIB中

3、扩展此FLASH元件 如

package net.highall.uicomponents
{
 import flash.events.Event;
 import flash.events.FocusEvent;
 import flash.events.MouseEvent;
 
 import mx.controls.TextInput;
 
 public class HATextInputSkin extends TextInput_skin
 {
  public function HATextInputSkin()
  {
   super();
   addEventListener(Event.ADDED,initStateHandler);
  }
  private function initStateHandler(event:Event):void{
   if(!parent)return;
   var textInput:TextInput=parent as TextInput;
   this.stop();
   textInput.addEventListener(FocusEvent.FOCUS_IN,motionHandler);
   textInput.addEventListener(FocusEvent.FOCUS_OUT,motionHandler);
   textInput.setStyle("paddingLeft",12);
   textInput.setStyle("paddingTop",5);
  }
  private function motionHandler(event:Event):void{
   switch(event.type){
    case FocusEvent.FOCUS_IN:
     gotoAndStop("focusIn");
     break;
    case FocusEvent.FOCUS_OUT:
     gotoAndStop("up");
     break;
    case MouseEvent.MOUSE_OVER:
     break;
   }
  }
 }
}

 

4、引用此皮肤

 <mx:TextInput x="108" y="148" width="186" height="28" borderSkin="net..uicomponents.TextInputSkin"/>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值