*Tips

Determine the type of transition you are defining

  • With dynamic transitions, you know what effects you want to play, but not which targets they will play on.
  • With explicit transitions, you know exactly what happens to each individual target.

Complex transitions may consists of both dynamic and explicit elements

 

Tips for dynamic transitions:

  • List all possible targets in the parens composite effect
  • By default, all effects play on all specified targets. Use filter with dynamic transitions to limit the target set
  • Dynamic transitions can ve used with a wide variety of stage changes

 

Tips for explicit transitions

  • Specify targets on the child effects, or on a composite effect when all child effects of the composite effect have the same targets
  • By default, all effects play on all specified targets. For explicit transitions, make sure the targets are correctly set.
  • Explicit transitions typically require a different transition for each change to the view state

 

*TroubleShooting

TroubleShooting a transition effect that does not play

  • Is the effect target being hidden or removed? If so, make sure add an <mx:RemoveChild>property to the view state definition, or an <mx:SetPropertyAction name="visible"> tag in the transition definition
  • Does the change to the view state define settings that pertain to the transition effect? - pertain - 속하다

    For example, if you have a Resize Effect, you must change the width or height property of the target when the view state changes to trigger the effect

  • Check that you specified the correct targets to the transition
  • Check that your filter settings on the effect and on any parent effect are not excluding the target

 

Troubleshooting an effect playing on too manu targets

  • Add a filter for a dynamic transition, or change the targets for an explicit transiton

Troubleshooting wrong effect parameters

  • Did you specify explicit parameters on the effect? Are They correct?
  • Ensure that you correctly set the showTarget property for mask effects such as the Iris effect, and the wipe effects
  • Is the effect target being hidden or removed? If, so make sure you add an <mx:RemoveChild> property to the view state definition to remove the target, or an <mx:SetPropertyACtion name="visible"> tag in the transition definition to hide the target

    Troublsshooting when an application does not look correct after a transition

  • Some effects leave the target witth changed properties. For example, a Fade effect leaves the alpha property of the target at the alphaTo value specified to the effect If you use the Fade effect on a target that sets alpha property to zero, you must set the alpha property to a nonzero value before the object appears again.
  • Try removing one effect at a time from the transition until it no longer leaves your application with the incorrect appearance

 

 

 

이 글은 스프링노트에서 작성되었습니다.

by 무위자연 2008. 3. 14. 16:56

Effect를 동시에 실행시킬때 Parallel로 묶는다. 이때 Parellel에 묶는 Target을 지정할수 있는데 -복수일때는 targets- 묶이는 effect에 지정한 target은 parellel에서 target을 지정하지 않더라도 빠지지 않는다. 하지만 지정되지 않은 target는 parellel에서 지정하지 않으면 그 Effect효과에서 빠지게된다.

ex.

<mx:Parallel targets="{[loginPanel, registerLink, loginButton, confirm]}" >
               
                <mx:Resize duration="500" easingFunction="Bounce.easeOut"/>
                <mx:Sequence target="{confirm}">
                    <mx:Blur duration="200" blurYFrom="1.0" blurYTo="20.0"/>
                    <mx:Blur duration="200" blurYFrom="20.0" blurYTo="1.0">                       
                    </mx:Blur>
                </mx:Sequence>
               
 </mx:Parallel>

여 기서 Parellel의 target중에 confirm을 빼더라도 confirm에 걸려있는 blur Effect는 여전히 잘! 동작한다. 하지만 loginButton을 빼주게 된다면 resize할때 easingFunction이 먹지 않게 된다.

이것을 잘 이용하면 Effect가 들어가지 않아도 되는 target을 선별적으로 골라내서 Effect효율을 높일수 있다

 

이 글은 스프링노트에서 작성되었습니다.

by 무위자연 2008. 3. 14. 11:47

Event Handling

Flex의 component들은 자신의 동작에 대한 결과를 이벤트를 통해서 자신을 포함한 다른 component에게 알릴수 있다.

이 이벤트를 통해서 component간의 소통이 가능하게 된다.

한 component에서 Event를 dispatch를 하게 되었을때  이 이벤트에 대한  addEventListener를 등록한 component가

발생한 이벤트를 기반으로 새로운 동작을 할 수 있다.

이벤트의 기본구성은

이벤트가 발생한 target과 이벤트가 발생한 target을 포함하고 있는 currentTarget 가 있고

이 이벤트에는 이 이벤트를 사용하는 component가 필요한 data도 포함되어 있다.

Resize Event를 예로 들어보자.
package mx.events
{

import flash.events.Event;

public class ResizeEvent extends Event // 이벤트를 상속받아서 자신만의 이벤트를 만드는 것이 용이하다.
{
 
    public static const RESIZE:String = "resize"; //이벤트가 가지는 여러가지 상황에 대한 static정의를 한다면 쉽게 이벤트의 구분자를 가질수 있다.

//이벤트의 생성자이다.
   public function ResizeEvent(type:String, bubbles:Boolean = false,
                                cancelable:Boolean = false,
                                oldWidth:Number = NaN, oldHeight:Number = NaN)
    {
        super(type, bubbles, cancelable);

        this.oldWidth = oldWidth;
        this.oldHeight = oldHeight;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  oldHeight
    //----------------------------------
   
    public var oldHeight:Number;

    //----------------------------------
    //  oldWidth
    //----------------------------------

    public var oldWidth:Number;

    //--------------------------------------------------------------------------
    //
    //  Overridden methods: Event
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    override public function clone():Event //이벤트 릴레이가 필요한 경우에 override해서 사용하는 부분으로 이 이벤트와 완전히 똑같은 이벤트를 하나 만들어내는것이다.
    {
        return new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight);
    }
}
}

여기 있는 ResizeEvent가 발생했을때 필요한 정보는 현재 이벤트가 발생하기 전의 예전 너비와 높이가 필요해서 properties로서 들어가있다.

이벤트를 만들 경우에 필요한 변수와 종류는 제한이 없다. 이벤트의  properties에 원활한 접근을 위해서 setter, getter함수를 정의해주는 것이 좋다.

 

그렇다면 이벤트를 dispatch하는 방법은?

이벤트를 발생시킬 대상을 정한다. 일반적인 경우에 부모 혹은 자신에게 이벤트를 dispatch시킨다.

ex) var resize:ResizeEvent = new ResizeEvent(ResizeEvent.RESIZE, false, false, 100, 100);

dispatchEvent(resize); || parent.dispatchEvent(reszie);

 

이벤트 처리를 위한 EventListener를 작성하는 방법.

mxml의 경우.

<mx:Button id="b1" label="Click Me” click="myEventHandler(event)"/>

 

as의 경우

 

b1.addEventListener(MouseEvent.CLICK, myEventHandler);

 

 

두가지 모두 동일한 동작을 한다. 하지만 customizing된 Event의 경우 as에 등록하는 것이 용이하다.

 

 

private function myEventHandler(event:Event):void

 

{

 

Alert.show("An event occurred");

 

}

 

 

 

이벤트의 흐름.

자식은 부모에게 이벤트로 자신의 상태나 액션을 알려줄수 있고 부모는 그것을 통해서 자식의 상황에 따른 자신의 상황도 바꿀수 있는 기회를 가지게 된다.

그리고 레벨이 2단계를 넘어갈 경우 이벤트 릴레이를 하게 된다. 이 릴레이를 통해서 부모/자식의 통신뿐 아니라 2단계, 3단계 이상의 depth를 가지는 component와의 통신이 가능하게 되는 것이다. 또한, depth는 같으나 상속관계에 있지 않은 다른 component와의 통신도 가능하게 된다. 이런 이벤트 릴레이가 원활하게 하는데 있어서  앞에서 설명한 직접 이벤트의 clone이 유용하게 쓰일수 있다. 필요에 따라서 이러한 이벤트 릴레이 없이  필요한 component에 집적 이벤트를 dispatch시킬수 있다. 하지만 이 경우 상속관계와 component들의 구조를 이벤트 발생시키는 component에서 알아야 해서 유연성이 떨어지는 방법임으로 극히 제한적인 경우에만 사용하여야 한다.

이런 기본적인 이벤트 흐름과 다른 몇가지 이벤트가 있다.

mouseEvent가 그 중에 하나이다.

ppt Flex발표29 설명 그리고 stopPropogation 이벤트를 현재 받은 component에서 더이상 bubbling되지 않게 한다.

이벤트처리가 아주 힘든 것 예.ListBase itemRenderer가 있고 그 위에 뭐가 있기때문에 이벤트 릴레이가 쉽지 않다. 그래서 IDropInListItemRenderer를 쓴다!

 

이 글은 스프링노트에서 작성되었습니다.

by 무위자연 2008. 2. 1. 16:07

우리 프로젝트의 마이다스의 손인 내가

 

이번에는 MyCollection을 맡게 되었다.

 

요건 안 없어질려나..?

 

내가 맡은 부분은 신을 낼라그러면 없어지고 그래 ㅋ

 

가장 뼈아픈건 LifeBrowser...ㅠ.ㅠ.

 

이 글은 스프링노트에서 작성되었습니다.

by 무위자연 2007. 9. 17. 16:10
metaWeblog newPost MyDescriptionfromLocal

local에서 만든 것은 아니고 이글루스 트랙백때문에 테스트하려고 내용을 수정한 것임
by 무위자연 2007. 7. 31. 18:15
사용자 삽입 이미지
by 무위자연 2007. 7. 31. 18:07
metaWeblog newPost MyDescriptionfromLocal
by 무위자연 2007. 7. 31. 17:39
MyDescriptionfromLocal
by 무위자연 2007. 7. 31. 17:38
MyDescription
by 무위자연 2007. 7. 31. 17:36
| 1 2 3 |