PopUpManager를 사용하여 팝업의 효과 (기본 효과)를 설정하는 방법이 있습니까?팝업의 개폐 효과 애니메이션을 설정하는 방법은 무엇입니까?
예를 들어, MXML 구성 요소를 만들었으므로 해당 구성 요소를 확대 (절반 크기)하여 x, y 또는 z 축에서 360도 회전하도록합니다. PopUpManager.addPopUp() 또는 createPopUp()을 호출 할 때이 효과를 어떻게 할당할까요?
PopUpManager를 사용하여 팝업의 효과 (기본 효과)를 설정하는 방법이 있습니까?팝업의 개폐 효과 애니메이션을 설정하는 방법은 무엇입니까?
예를 들어, MXML 구성 요소를 만들었으므로 해당 구성 요소를 확대 (절반 크기)하여 x, y 또는 z 축에서 360도 회전하도록합니다. PopUpManager.addPopUp() 또는 createPopUp()을 호출 할 때이 효과를 어떻게 할당할까요?
팝업 및 닫을 때 창에 효과를 적용해야합니다.
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);
}
또한 애니메이션과 팝업을 만든 다음 그것을 확장 할 수 있습니다
:
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>