WEB开发网
开发学院图形图像Flash 积少成多Flash(11) - Flex 3.0 动画效果(effect) 阅读

积少成多Flash(11) - Flex 3.0 动画效果(effect)

 2009-11-28 00:00:00 来源:WEB开发网   
核心提示: 11、SoundEffect.mxml<?xmlversion="1.0"encoding="utf-8"?><!--播放一段音频--><mx:Panelxmlns:mx="http://www.adobe.com/

11、SoundEffect.mxml

<?xml version="1.0" encoding="utf-8"?>
<!--
    播放一段音频
-->
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
    title="Effect - SoundEffect (音效)">
    
    <mx:SoundEffect id="soundEffect" source="@Embed('assets/bomb.mp3')" />
    
    <mx:Image source="@Embed('images/logo.png')"
        x="24" y="24" width="48" height="48"  
          mouseDownEffect="{soundEffect}"
     />
    
</mx:Panel>

12、Parallel.mxml

<?xml version="1.0" encoding="utf-8"?>
<!--
    对各种 effect 做并行展示
-->
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
    title="Effect - Parallel (效果并行), AddItemAction, RemoveItemAction">
    
    <mx:Script>
        <![CDATA[
        
            import mx.collections.ArrayCollection;
            
            [Bindable]
            private var dp:ArrayCollection = new ArrayCollection(["webabcd", "webabcd", "webabcd"])
            
            private function addItem():void
            {
                dp.addItemAt("webabcd", dp.length);
            }
            
            private function removeItem():void
            {
                dp.removeItemAt(dp.length - 1);
            }
            
        ]]>
    </mx:Script>
    
    <mx:Parallel id="parallel">
        <mx:AddItemAction filter="addItem" startDelay="500" />
        <mx:RemoveItemAction filter="removeItem" startDelay="500" />
        <mx:Blur startDelay="500" duration="1000" blurXFrom="0" blurXTo="10" blurYFrom="0" blurYTo="10" filter="addItem" />
    </mx:Parallel>
    
    <mx:Label text="顺便说明 AddItemAction, RemoveItemAction"  x="10" y="10"/>
    
    <mx:List id="list" dataProvider="{dp}" fontSize="16"  y="36" x="10" height="178" width="360"
        itemsChangeEffect="{parallel}"/>
     
     <mx:ControlBar horizontalAlign="center">
         <mx:Button label="增加一项" click="addItem();" />
         <mx:Button label="删除一项" click="removeItem();" />
     </mx:ControlBar>
     
</mx:Panel>

上一页  3 4 5 6 7 8 9  下一页

Tags:积少成多 Flash Flex

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接