2012-10-26 4 views

답변

2

팝업 및 닫을 때 창에 효과를 적용해야합니다.

private var win:TitleWindow; 

private function addWindow():void{ 
    win = new TitleWindow(); 
    win.addEventListener(CloseEvent.CLOSE, onClose); 
    PopUpManager.addPopUp(win, this); 
    PopUpManager.centerPopUp(win); 
    var scale:Scale = new Scale(win); 
    ... set scale properties for cool zoom in 
    scale.addEventListener(EffectEvent.EFFECT_END, onZoomInComplete); 
    scale.play(); 
} 

private function onClose(event:CloseEvent):void{ 
    var scale:Scale = new Scale(win); 
    ... set scale properties for cool zoom out 
    scale.addEventListener(EffectEvent.EFFECT_END, onZoomOutComplete); 
    scale.play(); 
} 

private function onZoomInComplete(event:EffectEvent):void{ 
    //Depending on what effects you apply, you may need to re-center the popup 
    //after the zoom in effect is over.. may not need this though 
    PopUpManager.centerPopUp(win); 
} 

private function onZoomOutComplete(event:EffectEvent):void{ 
    PopUpManager.removePopUp(win); 
} 
또한 애니메이션과 팝업을 만든 다음 그것을 확장 할 수 있습니다
0

:

AnimatedPanelWindow.mxml : 다음

<?xml version="1.0" encoding="utf-8"?> 
<s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:s="library://ns.adobe.com/flex/spark" 
       xmlns:mx="library://ns.adobe.com/flex/mx" 

       creationCompleteEffect="{addedEffect}" 
       removedEffect="{removedEffect}" 

       > 


    <fx:Declarations> 

     <s:Parallel id="removedEffect" target="{this}" suspendBackgroundProcessing="false"> 
      <s:Scale3D scaleYTo="0" duration="500" startDelay="0" disableLayout="false" 
         autoCenterProjection="true" autoCenterTransform="true" applyChangesPostLayout="true"/> 
      <s:Fade alphaFrom="1" alphaTo="0" duration="250" startDelay="50"/> 
     </s:Parallel> 

     <s:Parallel id="addedEffect" target="{this}" suspendBackgroundProcessing="false"> 
      <s:Scale3D scaleYFrom="0" scaleYTo="1" duration="250" disableLayout="false" 
         autoCenterProjection="true" autoCenterTransform="true" applyChangesPostLayout="true"/> 
      <s:Fade alphaFrom="0" alphaTo="1" duration="200"/> 
     </s:Parallel> 

     <s:Move id="moveEffect" target="{this}" effectUpdate="trace('moving')"/> 

    </fx:Declarations> 


</s:Panel> 

을 그리고 그것을 확장 :

<?xml version="1.0" encoding="utf-8"?> 
<c:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:s="library://ns.adobe.com/flex/spark" 
       xmlns:mx="library://ns.adobe.com/flex/mx" 
       xmlns:c="views.*" 


</c:AnimatedPanelWindow> 
관련 문제