///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> Flash实例


/pc/bin/msg.pl?file_id=k_flashjq16 target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
谈谈您的看法

///pc/img/blank.gif" width="1" height="1">
16.用鼠标控制一Movie clip
移动、缩放、旋转之一

预览成品:用鼠标控制一Movie clip移动、缩放、旋转。

///pc/homepage/flashsl/flash16/swf/move.zip">下载源程序


逐步说明:
  1)新建一文件如图所示:

///pc/homepage/flashsl/flash16/img/flash001.gif" width="285" height="358" align="left" alt="总体程序">






其中在图层movie clip layer中放的是电影图符movie clip,在图层controls中放的是按钮left(向左的箭头)、right(向右的箭头)、up(向上的箭头)、down(向下的箭头)、grow(带有“+”的指向左上角的箭头)、shrink(带有“-”的指向右上角的箭头),在图层background中放的是场景中的背底图。

 

 

 

 

  2)用鼠标右键点击movie clip,在弹出的菜单中选择“Properties”项,进入属性对话框,切换到Definition选项卡,在Instance Name域中输入实体名字“target_item”。

///pc/homepage/flashsl/flash16/img/flash002.gif" width="483" height="243" alt="动感球体的实体名字">

  3)设置“left”按钮的Action为:

///pc/homepage/flashsl/flash16/img/flash003.gif" width="423" height="202" alt="left按钮的Actions">

   On (Release)
    Set Property ("/target_item", X Position) = GetProperty         ("/target_item", _x)-5
    Set Property ("/target_item", Rotation) = GetProperty          ("/target_item", _rotation)-5
   End On
即鼠标每点击一下该按钮,实体名字为“target_item”的movie clip向左移动5,并逆时针旋转5度。
  4)设置“right”按钮的Action为:
   On (Release)
    Set Property ("/target_item", X Position) = GetProperty         ("/target_item", _x)+5
    Set Property ("/target_item", Rotation) = GetProperty          ("/target_item", _rotation)+5
   End On
即鼠标每点击一下该按钮,实体名字为“target_item”的movie clip向右移动5,并顺时针旋转5度。

上一实例(鼠标双击)  下一步

/pc/bin/msg.pl?file_id=k_flashjq16 target="_blank">///pc/img/message.gif" width="64" height="54" alt="请您留言" border="0">
谈谈您的看法


网页制作 网页设计 网站建设 网站设计 网站制作 做网站 做网页