2010-07-05 4 views
0

간단한 애니메이션을하려고합니다. 나는 creationcomplete 내에서 List를 페이드 인시키고 크기를 조정하고자한다. 내 문제는 요소 애니메이션이 시작되기 전에 항상 요소 플래시를 볼 수 있다는 것입니다. 다시 말해, 사용자는 요소가 1 초 동안 나타나는 것을 보게 될 것입니다. 그런 다음 애니메이션을 페이드 인하고 크기를 조정합니다. 여기있는 사람이 나에 대해 도와 줄 수 있기를 바랬다. 감사합니다 ...플렉스 애니메이션 질문

내 코드. AS

:

protected function compList_creationCompleteHandler(event:FlexEvent):void 
{ 

    compinfoResult.token = getCompList.compinfo(); 
    compinfoResult.addEventListener(ResultEvent.RESULT, completeLoading); 

    function completeLoading(event:ResultEvent):void{ 

    fadeList.play(); //the animation will fire when the List get the result from the server... 
    scaleList.play(); 

} 
} 

mxml 


    <s:Scale id="scaleList" scaleXFrom="0" scaleXTo="1" scaleYFrom="0" 
    scaleYTo="1" duration="500" target="{compList}" /> 
    <s:Fade id="fadeList" alphaFrom="0" alphaTo="1" target="{compList}" /> 


    <s:List id="compList" 
    width="280" 
    height="560" 
    x="0" 
    y="0" 
    alpha="0" 
    creationComplete="compList_creationCompleteHandler(event)" 
    itemRenderer="itemRenderer.compListItemRenderer" 
    change="compList_changeHandler(event)"/> 

답변

1

첫째, 당신의 취향에 동시에 또는 순차적으로 하나 하나의 변화로 이러한 결합 것 : 그런 다음

<s:Sequence id="effectSequence"> 
    <s:Scale id="scaleList" scaleXFrom="0" scaleXTo="1" scaleYFrom="0" 
scaleYTo="1" duration="500" target="{compList}" /> 
    <s:Fade id="fadeList" alphaFrom="0" alphaTo="1" target="{compList}" /> 
</s:Sequence> 

, 나는 트리거하지 것이다 이것은 이벤트와 함께 수동으로. 대신 효과를 사용하십시오.이 경우 creationCompleteEffect을 권하고 싶습니다.

<s:List id="compList" 
    width="280" 
    height="560" 
    x="0" 
    y="0" 
    alpha="0" 
    creationComplete="compList_creationCompleteHandler(event)" 
    itemRenderer="itemRenderer.compListItemRenderer" 
    change="compList_changeHandler(event)" 
    creationCompleteEffect="{effectSequence}"`/> 
+0

Nice..Thanks lot.That의 내가 필요 .. : D – FlyingCat

+0

도울 수있을 다행! – JeffryHouser