• Data is negligible even longer delay included in the event.


• Raise the event in a row without delay, even if you can handle in Flex.



• The time the Event is passed to the swc in the Dll is the time that one function ends.


• Data transfer test results.


      You can receive all the treatment in less than one second in Flex in 2893 when the char array length Raise an event that contains as much as 1000 times.


Test environment;

- OS: Windows 7 64 bits

- Flash Builder 4.6

- VisualStudio 2010 - C ++

(Korean)


by 무위자연 2015. 1. 22. 08:49

If you have to deal with the issue at the Event dispatch in Flex.




This is not a problem occurring in the dispatch occurs in the event handler.




When A event raises and  a B event handler to handle the case.


Example.


// Normal  case, Use right


main.addEventListener (CustomEventA.DataSend, csEventHandler, false, 0, true);


// Abnormal case, Use wrong


main.addEventListener (CustomEventB.DataSend, csEventHandler, false, 0, true);




private function csEventHandler (e: CustomEventA): void


{


// handle events


}




When the CustomEventA raises to normal operation.


If CustomEventB is the same as a event handler, errors occurs. It is difficult to find this error because error message show at the dispatch event CustomEvent B


"TypeError: Error # 1034: Type Coercion failed: can not convert CustomEventB @ 64e6ca1 to CustomEventB will aereo is to be opened in this way.


If you make a new event handler for CustomEvent B, it can be solved


(Korean)

by 무위자연 2015. 1. 22. 08:48

Flex에서 Event dispatch시에 해당 이슈가 발생할 경우에 대한 대처.


이는 dispatch에서 발생하는 문제가 아니라 해당 이벤트 핸들러에서 발생하게 된다.


A 이벤트를 Raise를 하고 B 이벤트 핸들러로 처리하는 경우이다.


예.

//정상 처리, Use right

main.addEventListener(CustomEventA.DataSend, csEventHandler, false, 0, true);

//비정상 이벤트 등록, Use wrong

main.addEventListener(CustomEventB.DataSend, csEventHandler, false, 0, true);


private function csEventHandler(e:CustomEventA):void

{

//handle events

}


CustomEventA가 Raise되었을때는 정상 동작한다.

CustomEventB가 Raise가 되면 dispatch쪽에 애러가 나지만 실제 csEventHandler가 호출되는 순간에 제목과 같은 애러가 뜬다. 애러나는 라인이 dispatch쪽이라 찾기가 어려우므로 글로 남긴다.

"TypeError: Error #1034: Type Coercion failed: cannot convert CustomEventB@64e6ca1 to CustomEventB 이런식으로 애러가 뜨게 될 것이다.

CustomEventB 처리를 위한 새로운 이벤트 핸들러를 등록해주면 해결이 가능하다.



by 무위자연 2015. 1. 9. 13:54
• 이벤트에 포함된 Data가 길어져도 delay가 생기지 않습니다.

• 이벤트를 delay  없이 연속으로  Raise하더라도 Flex에서 처리 가능합니다.

• Dll에서 swc로 Event가 전달되는 시점은 하나의 함수가 끝나는 시점입니다.

• 데이터 전달 테스트 결과.

     char 배열 2893 길이 만큼이 포함된 event를 1000번 Raise 할 경우에 Flex에서 1초 이내에 모두 받아서 처리가 가능합니다.

[테스트 환경]
- OS : Windows 7 64 bits
- Flash Builder 4.6
- VisualStudio 2010 - C++


by 무위자연 2015. 1. 6. 14:15

Flex / AIR 플랫폼에서 native 구현부를 ANE라고 한다.


ANE를 만들기 위해서는 다음과 같은 동작이 필요하다


하기 예는 Windows를 환경에서의 과정이다.


1. native 코드로 (여기서는 C++) 기능을 구현한다.

구현시엔 하기와 같은 파일을 첨부하며 Flex에서 호출할수 있도록 함수 리스트를 추가해준다.


#include "FlashRuntimeExtensions.h"  


기능 구현

FREObject functions(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])   

{

//C++ 코드

}

함수 리스트 추가

void ContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctions, const FRENamedFunction** functions) { 

 *numFunctions = 12; //사용할 함수 개수

 FRENamedFunction* func = FRENamedFunction*)malloc(sizeof(FRENamedFunction)*(*numFunctions)); 

  func[0].name = (const uint8_t*)함수이름"; //Flex에서 call할때 쓸 이름

 func[0].functionData = NULL; 

 func[0].function = 실제 구현한 함수의 포인터; 

*functions = func;  //설정한 함수리스트를 함수의 포이턴에 추가해준다.

2. native 구현한 함수를 call하는 Flex 프로젝트를 생성하여 빌드한다.

빌드해서 만들어진 swc의 확장자를 바꿔서 압축을 풀면 catalog.xml/library .swf 파일을 확인할수 있다.


3. 1번에서 만든 dll / 2번에서 빌드한 swc, xml, swf 파일을 하나의 폴더에 복사한다.


4. C:\Users\User\Documents\flex_sdk_4.6\flex_sdk_4.6\bin\adt -package -target ane 생성될 ane파일명.ane extension.xml -swc 2번에서 생성한.swc -platform Windows-x86 1번에서 생선한.dll library.swf

5. 생성된 ane 파일을 Flex/AIR에서 프로젝트 properties - flex build packaging - native extensions에서 추가하면 해당 ane를 사용할수 있다.





by 무위자연 2014. 12. 11. 11:36
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지

RIA 월드.
by 무위자연 2008. 3. 20. 09:28

*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
| 1 2 |