BLOG ARTICLE 전체 글 | 126 ARTICLE FOUND

  1. 2012.12.18 Flex에서 문서 보여주기
  2. 2012.12.13 [FlexExample] 모션인식(Motion Detection) 예제
  3. 2012.12.04 Flex itemRenderers에 대한 이해(Understanding Flex itemRenderers)
  4. 2012.11.20 사용자 이벤트 송출하기 (Dispatching Cumstom Event)
  5. 2012.11.09 [FMS] 스트림 녹화 (Recording stream using Flex,FMS)
  6. 2012.11.05 버전관리툴(CVS, SVN, GIT)의 비교 2
  7. 2012.10.26 [FlexExample] Print클래스를 이용한 여러가지 인쇄옵션
  8. 2012.10.26 [FMS] 비디오 파일 스트리밍 대략적인 흐름
  9. 2012.10.04 [FMS] Responder, NetConnection.call()
  10. 2012.10.04 History of ActionScript OOP support
  11. 2012.09.28 mms.cfg(Macromedia Security Configuration)
  12. 2012.09.26 [Network] 네크워크 주소변환 (Network Address Transmission,NAT)란?
  13. 2012.09.26 [FMS] Best practices for real-time collaboration using Flash Media Server
  14. 2012.09.25 SharedObject Reference
  15. 2012.09.25 DispatchEvent Example
  16. 2012.09.17 NetStreamInfo Class
  17. 2012.09.17 Capabilities Class
  18. 2012.09.17 ActionScript Reference
  19. 2012.09.14 Custom Event Dispatch
  20. 2012.09.14 PopUpManager Examples (Simple PopUpManager Example)
  21. 2012.09.13 Flex의 ItemRenderer (Setting the itemRenderer or itemEditor property in ActionScript )
  22. 2012.09.13 [FMS] RTMP, RTMFP
  23. 2012.09.10 Repeater Class
  24. 2012.09.07 [FlexExample] 여러가지 패널예제 모음(Draggalbe, Resizable, Movable, Minimize, Maximize Panel)
  25. 2012.09.06 [FlexExample] 현 마우스 좌표위치구하기 (Get x-coordinate,y-coordinate)
  26. 2012.09.04 Speex vs Nellymoser
  27. 2012.09.03 [FlashPlatform] Sound 중요한 개념 및 용어 (Important sound concepts and terms)
  28. 2012.08.23 [FMS] SSAS application.onConnect()
  29. 2012.08.23 [FMS] Buying guide
  30. 2012.08.23 Comparison between the three flash servers Flash Media Server, Wowza and Red5

 

어떤 이유인지 몰라도 Flex에서 바로 PDF파일을 읽는 기능은 지원이 안되는군요.  기술적으로 구현이 되지 않은 것은 아닐터인데, 왜 Open시키지 않을까요...

 

Flex에서 PDF문서를 보여주기 위해서는 몇가지 작업을 해야합니다.

 

 

첫번째 방법은 유료 컴포넌트를 이용하는 방법입니다. FlexPaper라는 유료 컴포넌트를 판매하고 있네요.

 

FlexPaper에서 문서를 보여주기 위해서는 최종적으로 PDF파일로 변환시켜야 합니다. OpenOffice엔진을 사용하고 있고,

 

OpenOffice를 서비스에 띄어놓고 중간에 JODConverter라는 라이브러리를 통해 모든 문서를 PDF 파일로 변환시켜  FlexPaper

 

에서 보여지는 구조인데, 유료라 패스~

 

 

 

 

 

 

 

 

제가 사용한 방법은 JODConverter 유틸로 파일변환 과정을 거쳐 최종적으로 swf파일로 변환하여 tweener라는 유틸을

 

통해 확대축소 페이지넘김 등을 하게 됩니다.

 

 여기로 가시면 소스코드를 받아보실 수 있습니다.

 

*참고로 제가 구현한 방법은 Tomcat 서버딴에서 Runtime.getRuntime().exec() 메소드를 이용하여 변환하게 했습니다.

 

단점은 그림파일이 많이 들어가거나, 페이지 수가 많아지면 파일 변환 과정시간이 너무 오래걸립니다. 또한 변환과정에

 

 문서 퀄리티도 떨어지구요.  그리고 외부 라이브러리를 통하기 때문에, 근본적이 해결책이 아니라는 겁니다.

 -> 수정합니다. 문서퀄리티 준수합니다.

 

 

 

 

결론적으로는 HTML5를 통해 문서를 이미지화 시켜서 뿌리는 방법이 가장 빠른 방법이 되지 싶네요.  프로젝트 진행하면 할수록 HTML5는 필수가 되어가네요. ㅠㅠ


* html을 pdf로 바꾸기...

* jodconverter 예제 다운로드

* How to convert docx/odt to pdf/html with Java? 

* Tweener란? http://cafe.naver.com/flashactionscript/18906

* Tweener : http://hosted.zeh.com.br/tweener/docs/en-us/

AND

 

1. 웹캠을 이용하여 모션움직임을 감지하는 예제입니다. 소스 분석은 아직 해보지 않았지만, 이 예제는 모션의 움직임이 있냐없냐를 판별합니다.

 

 

*source : http://dougmccune.com/blog/2008/04/03/simple-flex-motion-detection-example/

*souce code :MotionDetectionExample.fxp

 

 

 

 

2. 웹캠을 이용하여 움직이는 물체를 추적(Motion Tracking)하는 예제입니다.

 

*source : http://nocreativity.com/blog/webcam-motion-detection-coolness

*souce code :MotionDetectionExample2.fxp

AND


Flex는 대용량 데이터를 여러가지 방법으로 나타내는 다양한 컨트롤들을 제공합니다. 예를들면 List, DataGrid, Tree, Charts, AdvancedDataGrid 등이 있죠. 기본적으로는 List콘트롤은 간단한 텍스트만 뿌려주게 되어있습니다.  하지만 itemRenderers을 이용하면 더욱 다양한 방법으로 List를 나타낼 수 있습니다. 즉, 데이터를 뿌려주는 컨트롤들을 커스터마이징하기위해서는 itemRenderers을 사용해야 합니다.  itemRenderers를 이용하는 리스트들의 각각의 열(row)의 컨텐츠들에 더욱 완성더 높은 콘트롤들을 제공함으로써, 더욱 매력있고 창의적이고 실용적인 어플리케이션을 만들 수 있습니다.



아래 모든 예제들은 똑같은 데이터를 사용할 것입니다. : 책에 대한 정보 - 저자, 제목, 발행일, 썸네일이미지 등.  각 레코드는 아래와 같이 XML 노드들입니다.

 

<?xml version="1.0" encoding="UTF-8"?>

<root>

      <book>

            <author>이헌세</author>

            <title>공포의 외인구단</title>

            <image>assets/공포의외인구단.jpg</image>

            <date>Dec 3, 2004</date>

      </book>

      <book>

            <author>이헌세</author>

            <title>버디</title>

            <image>assets/버디.jpg</image>

            <date>Feb 28, 2006</date>

      </book>

</root>

*source code : BookInfo.xml

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx">

     

      <fx:Declarations>

            <fx:XML id="testData" source="BookInfo.xml"/>

      </fx:Declarations>

     

      <mx:List dataProvider="{testData.book}" width="100%" height="100%">

            <mx:itemRenderer>

                  <fx:Component>

                        <mx:Label text="{data.author}: {data.title}" />

                  </fx:Component>

            </mx:itemRenderer>

      </mx:List>

</s:Application>

*source :InlineItemRendererExample1.fxp

 위 예제는 매우 간단한 itemRenderer의 예제입니다. 이 예제에서 중요한 두가지 중요한 포인트는 첫째, inline itemRender는 <mx:itemRenderer>태그를 사용해서 정의합니다. <fx:Component>태그는 그안에 위치하여야 합니다. 그래야 Flex 컴파일러가 inline 컴포넌트임을 알 수 있습니다.  둘째, <mx:Label>태그에서의 데이터바인딩 하는 방식은 {data.author}: {data.title} 이런식으로 합니다.

 

리스트 컨트롤의 itemRenderer Data 속성에 정의되어 있는 레코드를 각각의 itemRenderer객체에 주어야 합니다. 코드를 보시면 주어진 리스트의 열들을 보시면, inline itemRenderer객체는 <book>이라는 XML 노드로 정의된 자신만의 Data 속성을 가질 것 입니다. 리스트를 스크롤 하면, 새로운 열에대한 itemRenderers를 재사용 함으로써 Data 속성은 바뀔 것입니다. 쉽게말해 10개의 Data가 있다고 하면, <mx:itemRenderer>를  10번 쓸 필요가 없다는 말입니다.

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx">

     

      <fx:Declarations>

            <fx:XML id="testData" source="BookInfo.xml"/>

      </fx:Declarations>

     

      <mx:DataGrid width="100%" height="100%" dataProvider="{testData.book}" variableRowHeight="true">

            <mx:columns>

                  <mx:DataGridColumn headerText="Pub Date" dataField="date" width="85" />

                  <mx:DataGridColumn headerText="Author" dataField="author" width="125"/>

                  <mx:DataGridColumn headerText="Title" dataField="title">

                        <mx:itemRenderer>

                             <fx:Component>

                                   <mx:HBox paddingLeft="2">

                                         <fx:Script>

                                               <![CDATA[

                                                     override public function set data( value:Object ) : void {

                                                           super.data = value;

                                                           var today:Number = (new Date()).time;

                                                           var pubDate:Number = Date.parse(data.date);

                                                           if( pubDate > today ) setStyle("backgroundColor",0xff99ff);

                                                           else setStyle("backgroundColor",0xffffff);

                                                     }

                                               ]]>

                                         </fx:Script>

                                         <mx:Image source="{data.image}" width="50" height="50" scaleContent="true" />

                                         <mx:Text width="100%" text="{data.title}" />

                                   </mx:HBox>

                             </fx:Component>

                        </mx:itemRenderer>

                  </mx:DataGridColumn>

            </mx:columns>

      </mx:DataGrid>

</s:Application>

*source code :InlineItemRendererExample2.fxp

 

위 예제는 조금 더 복잡한 <mx:List>를 이용한 inline itemRenderer예제입니다. 처음예제와 크게 다르지 않습니다.

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                     xmlns:s="library://ns.adobe.com/flex/spark"

                     xmlns:mx="library://ns.adobe.com/flex/mx"

                     creationComplete="initApp();"

                     >

     

      <fx:Declarations>

            <fx:XML id="testData" source="BookInfo.xml"/>

      </fx:Declarations>

     

      <fx:Script>

            <![CDATA[

                  import events.BuyBookEvent;

                  import mx.controls.Alert;

                 

                  private function initApp() : void

                  {

                        addEventListener( BuyBookEvent.BUY_BOOK, handleBuyBook );

                  }

                 

                  private function handleBuyBook( event:BuyBookEvent ) : void

                  {

                        Alert.show("You have selected '"+event.bookData.title+"' by "+event.bookData.author, "Buy This Book");

                  }

            ]]>

      </fx:Script>

      <mx:TileList width="100%" height="100%"

                         dataProvider="{testData.book}" columnWidth="275" rowHeight="135">

            <mx:itemRenderer>

                  <fx:Component>

                        <mx:HBox verticalAlign="top">

                             <fx:Script>

                                   <![CDATA[

                                         import events.BuyBookEvent;

                                         import mx.core.FlexGlobals;

                                        

                                         public function buyBookEventHandler():void

                                         {

                                               var e:BuyBookEvent = new BuyBookEvent();

                                               e.bookData = data;

                                               dispatchEvent(e);

                                         }

                                   ]]>

                             </fx:Script>

                             <mx:Image source="{data.image}" width="70" height="70" />

                             <mx:VBox height="115" verticalAlign="top" verticalGap="0">

                                   <mx:Text text="{data.title}" fontWeight="bold" width="100%"/>

                                   <mx:Spacer height="20" />

                                   <mx:Label text="{data.author}" />

                                   <mx:Label text="Available {data.date}" />

                                   <mx:Spacer height="100%" />

                                   <mx:HBox width="100%" horizontalAlign="right">

                                         <s:Button label="Buy" click="buyBookEventHandler();" />

                                   </mx:HBox>

                             </mx:VBox>

                        </mx:HBox>

                  </fx:Component>

            </mx:itemRenderer>

      </mx:TileList>

</s:Application>

*source :InlineItemRendererExample3.fxp

 

위 예제는 조금 더 복잡한 예제이지만, <mx:itemRenderer>태그안에 <fx:Component>태그를 갖는 똑같은 구조입니다. <fx:Component>의 목적은 코드상의 ActionScript 클래스 권한을 생성하기위한  MXML 구문을 제공하기 위한것입니다.

 

 

 Example1

 

*source : http://blog.flexdevelopers.com/2009/06/flex-examples-item-renderers-in.html

*source code :ItemRenderersExample.fxp


 

 












 

AND

 

Flex에서 버튼컨트롤의 click이벤트와 같이 대부분의 일반적인 이벤트들을 이미 정의해 놓았음에도, 개발하다보면 사용자이벤트를 만들어야 될 경우가 많습니다. 사용자 이벤트를 만들기 위해서는 다음 3가지를 필히 준수 해야 합니다.

 

첫째, event객체라는 것을 명시하기 위해 flash.events.Event 클래스로 부터 하위 클래스 생성.

둘째, event를 공용으로 쓰기위해 [Event] 메타데이터 태그 사용, 그렇게해야 MXML컴파일러가 인식 함.

셋째, dispatchEvent()메소드를 통해 이벤트 송출.

 

 

Event클래스로 부터 하위 클래스 생성 (Creating a subclass from the Event class)

 

모든 이벤트에 대한 정보를 event listener에게 전송하기 위해 event 객체를 사용합니다. 모든 event 객체의 근간은 flash.events.Event클래스입니다. 사용자 이벤트를 정의할 때, Event 타입의 event객체를 직접 송출 할 수 있고, 혹은 다른 타입의 Event 객체를 송출하기 위한 Event 클래스로 부터 하위클래스를 만들 수 있습니다.  일반적으로 event객체에 정보를 추가할 필요가 있을 때 Event클래스로 부터 하위클래스를 생성합니다.

 

예를들어, event객체들은 node라 불려지는 속성을 포함하는 Flex Tree control과 관련되어 있습니다.  ... 작성중...

AND

 

 

Stream녹화하는 예제를 찾는 중, Red5를 이용한 예제는 수없이 많았지만 FMS를 이용한 예제를 찾기 힘들어 포스팅 합니다.

 

Server Side소스는 따로 필요없습니다.  rtmp PATH만 잡아주시면 됩니다. 핵심은 Stream을 퍼블리싱 할 때, 두번째 값으로 "record"를 넘겨주시면 됩니다.

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                          xmlns:s="library://ns.adobe.com/flex/spark"

                          xmlns:mx="library://ns.adobe.com/flex/mx"

                          minWidth="955"

                          minHeight="600"

                          creationComplete="initApp();"

                          >

        <fx:Script>

               <![CDATA[

                       import mx.controls.Alert;

                       private var ns:NetStream = null;

                       private var nc:NetConnection = null;

                       private var cam:Camera = null;

                       private var mic:Microphone = null;

                      

                       private var vid1:Video;

                       private var vid2:Video;

                      

                       private var msg:Boolean;

                       private var metaSniffer:Object;

 

                      

                       private function initApp():void

                       {

                              initDevice();

                              initConnection();

                              videoSetup();

                             

                              recordBtn.addEventListener (MouseEvent.CLICK,startRecord);

                              stopBtn.addEventListener (MouseEvent.CLICK,stopAll);

                              playBtn.addEventListener (MouseEvent.CLICK,startPlay);

                       }

                      

                       private function initDevice():void

                       {

                              cam = Camera.getCamera();

                              cam.setKeyFrameInterval(12);

                              cam.setMode(240, 180, 15);

                              cam.setQuality(0, 80);

                              mic = Microphone.getMicrophone();

                       }

                      

                       private function initConnection():void

                       {

                              nc = new NetConnection();

                             

                              nc.connect('rtmp://localhost/RecordTest/');

                              nc.addEventListener("netStatus", checkConnect);

                       }

                      

                       private function videoSetup():void

                       {

                              vid1 = new Video(cam.width, cam.height);

                              vid1.attachCamera(cam);

                              currentVideo.addChild(vid1);

                             

                              vid2 = new Video(cam.width, cam.height);

                              recordedVideo.addChild(vid2);

                       }

                      

                       private function checkConnect (e:NetStatusEvent):void

                       {

                              msg=(e.info.code=="NetConnection.Connect.Success");

                              if (msg)

                              {

                                      ns = new NetStream(nc);

                                      metaSniffer=new Object();

                                      ns.client=metaSniffer;

                                      metaSniffer.onMetaData=getMeta;

                              }

                       }

                      

                       private function getMeta (mdata:Object):void

                       {

                              //Dummy to avoid error

                       }

                      

                       private function startRecord(e:Event):void

                       {

                              if(ns)

                              {

                                      recordBtn.label = "Recording";

                                      ns.attachAudio(mic);

                                      ns.attachCamera(cam);

                                      ns.publish("myStream", "record");

                              }

                       }

                      

                       private function stopAll(e:Event):void

                       {

                              playBtn.label = "Playing";

                              recordBtn.label = "Record";

                              ns.close();

                       }

                      

                       private function startPlay(e:Event):void

                       {

                              if(ns)

                              {

                                      playBtn.label="Playing";

                                      vid2.attachNetStream(ns);

                                      ns.play("myStream");

                              }

                       }

               ]]>

        </fx:Script>

        <s:VGroup>

               <s:HGroup>

                       <s:VideoDisplay width="300" height="300" id="currentVideo" />

                       <s:VideoDisplay width="300" height="300" id="recordedVideo" />

               </s:HGroup>

               <s:HGroup>

                       <s:Button label="Record" id="recordBtn" />

                       <s:Button label="Stop" id="stopBtn" />

                       <s:Button label="Play" id="playBtn" />

               </s:HGroup>

        </s:VGroup>

</s:Application>

*source code :RecordTest.fxp

 

 

AND

 

버전관리 툴을 사용해 보고자 알아보던 중, 어느것이 지금 프로젝트에 알맞으며, 각 버전관리 툴마다 장단점을 알아보고자 Googling하던 중 다음을 찾게되었습니다.  

 

*source : http://en.wikipedia.org/wiki/Comparison_of_revision_control_software

 

 

놀라웠던 것은 버전관리 툴의 종류가 너무 많다는 것입니다. 하나하나 따져가며 비교분석 해보고 싶었으나 그 막대한 양에 포기!

 

가장 많이 알려져 있는 SVN, CVS, GIT 중 GIT로 결정!

 

기능이 조금씩은 다르다 하지만 일단 뭐 무료이고, 각 로컬에 저장가능하다는 점이 맘에 들었습니다.  아직 체험해보지 못했지만 속도 또한 빠르다 하더군여...

 

AND

 

 

1. 기본이 되는 인쇄 예제

 

*source : http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf65381-7ffc.html

*source code : DGPrint.fxp

 

 

2. screen layout이랑 print layout 설정하기

*source : http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c80.html

*source code :DGPrintCustomComp.fxp

 

 

3. 자동으로 페이지 나누기

*source : http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c7e.html

*source code :MultiPagePrint.fxp

 

4. Advance Datagrid Print

*source : http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c7e.html

*source code :ADGPrint.fxp

 

AND

 

NetConnection으로 일단 커넥션을 열어두고 그 정보를 NetStream 클래스에 넘겨준다음에 NetStream에서 데이터를 스트리밍으로 받아서 Video에 넘겨주면 그 데이터를 재생시켜주는 순서를 갖게됩니다.

Flash Media Server로부터 파일을 스트리밍하려는 경우 NetConnection 및 NetStream클래스를 사용하여 원격 서버 인스턴스에 연결하고 지정된 스트림을 재생할 수 있습니다. RTMP(Real-Time Messaging Protocol)서버를 지정하려면 NetConection.connect() 메세드에 null이 아니라 원하는 RTMP URL(예:“rtmp://localhost/appName/appInstance”)을 전달합니다. 지정된 FMS에서 특정 라이브 또는 녹화된 스트림을 재생하려면 NetStream.publish()에 의해 제작된 라이브 데이터를 식별하는 이름을, 녹화된 스트림을 재생하려면 재생 항목에 대해 기록된 파일 이름을 NetStream.play()메서드에 전달합니다.

 

AND

Responder 클래스는 구체적인 작업의 성공 혹은 실패와 관련에 서버로 부터의 반환값들을 다루기 위해 NetConnection.call()에 사용되는 객체를 제공합니다. NetConnection.call()이 사용이 될 때, 현재 작동에 대한 네트워크 작동의 현재 연결상태, 혹은 현재 연결상태와 관련된 실패가 일어날 수 있습니다. Operation errors는 NetConnection에러 핸들링 대신 Responder객체를 target으로 합니다.

The Responder class provides an object that is used in NetConnection.call() to handle return values from the server related to the success or failure of specific operations. When working with NetConnection.call(), you may encounter a network operation fault specific to the current operation or a fault related to the current connection status. Operation errors target the Responder object instead of the NetConnection object for easier error handling.

 

파라미터(Parameters)

 

result - 서버로 부터 성공&반환값 호출이 있으면 작동되는 함수 (The function invoked if the call to the server succeeds and returns a result)

 

status -  서버가 에러를 반환하면 작동되는 함수(The function invoked if the server returns an error)

 

다음 예제는 NetConnection클래스의 call메소드를 이용해 FMS와 Flex의 Data를 주고 받는 예제입니다.

 

 

 

 

 

 

 

NetConnection클래스의 call메소드 Reference문서를 보면 아래와 같이 나와있습니다.

 

call(command:String, responder:Responder, ... arguments):void
Calls a command or method on Flash Media Server or on an application server running Flash Remoting.

 

첫번째 값으로 서버단에서 실행 할 명령이나 메소드가 들어가고, 두번째 값으로 서버로부터 들어오는 응답을 받기위한 객체인 Responder, 마지막인자로 서버에 보낼 메시지가 들어갑니다. 

 

_nc.call("sendMsg", r, "From Client to Server : My Name is Client. What is your name?");

 

서버의 "sendMsg"에게 "From Client to Server : My Name is Client. What is your name?" 라는 메시지를 보내고, 서버는 다음과 같이 클라이언트로 부터 받은 메시지를 출력합니다.

 

 

 

 

client.sendMsg = function(msg){

        trace(msg);

        return "From Server to Client : Hello Client, My Name is Server";

    };

 

서버는 "From Server to Client : Hello Client, My Name is Server" 라는 메시지를 클라이언트에게 보냅니다.  클라이언트의 Responder인스턴스인 r이 서버에서 보낸 메시지를 받은 후, 출력합니다.

 

*source code : NetConnectionCallExample.fxp

AND

 

This section begins with a brief history of ActionScript and OOP and continues with a discussion of the ActionScript 3.0 object model and how it enables the new ActionScript Virtual Machine (AVM2) to perform significantly faster than previous versions of Flash Player that contain the old ActionScript Virtual Machine (AVM1).

 

History of ActionScript OOP support

Because ActionScript 3.0 builds upon previous versions of ActionScript, it may be helpful to understand how the ActionScript object model has evolved. ActionScript began as a simple scripting mechanism for early versions of the Flash authoring tool. Subsequently, programmers began building increasingly complex applications with ActionScript. In response to the needs of such programmers, each subsequent release has added language features that facilitate the creation of complex applications.

ActionScript 1.0

ActionScript 1.0 refers to the version of the language used in Flash Player 6 and earlier. Even at this early stage of development, the ActionScript object model was based on the concept of the object as a fundamental data type. An ActionScript object is a compound data type with a group of properties. When discussing the object model, the term properties includes everything that is attached to an object, such as variables, functions, or methods.

Although this first generation of ActionScript does not support the definition of classes with a class keyword, you can define a class using a special kind of object called a prototype object. Instead of using a class keyword to create an abstract class definition that you instantiate into concrete objects, as you do in class-based languages like Java and C++, prototype-based languages like ActionScript 1.0 use an existing object as a model (or prototype) for other objects. While objects in a class-based language may point to a class that serves as its template, objects in a prototype-based language point instead to another object, its prototype, that serves as its template.

To create a class in ActionScript 1.0, you define a constructor function for that class. In ActionScript, functions are actual objects, not just abstract definitions. The constructor function that you create serves as the prototypical object for instances of that class. The following code creates a class named Shape and defines one property named visible that is set to true by default:

// base class 
function Shape() {} 
// Create a property named visible. 
Shape.prototype.visible = true;

This constructor function defines a Shape class that you can instantiate with the new operator, as follows:

myShape = new Shape();

Just as the Shape() constructor function object serves as the prototype for instances of the Shape class, it can also serve as the prototype for subclasses of Shape—that is, other classes that extend the Shape class.

The creation of a class that is a subclass of the Shape class is a two-step process. First, create the class by defining a constructor function for the class, as follows:

// child class 
function Circle(id, radius) 
{ 
this.id = id; 
this.radius = radius; 
}

Second, use the new operator to declare that the Shape class is the prototype for the Circle class. By default, any class you create uses the Object class as its prototype, which means that Circle.prototype currently contains a generic object (an instance of the Object class). To specify that Circle’s prototype is Shape instead of Object, use the following code to change the value of Circle.prototype so that it contains a Shape object instead of a generic object:

// Make Circle a subclass of Shape. 
Circle.prototype = new Shape();

The Shape class and the Circle class are now linked together in an inheritance relationship that is commonly known as the prototype chain. The diagram illustrates the relationships in a prototype chain:

The base class at the end of every prototype chain is the Object class. The Object class contains a static property named Object.prototype that points to the base prototype object for all objects created in ActionScript 1.0. The next object in our example prototype chain is the Shape object. This is because the Shape.prototype property was never explicitly set, so it still holds a generic object (an instance of the Object class). The final link in this chain is the Circle class, which is linked to its prototype, the Shape class (the Circle.prototype property holds a Shape object).

If we create an instance of the Circle class, as in the following example, the instance inherits the prototype chain of the Circle class:

// Create an instance of the Circle class. 
myCircle = new Circle();

Recall that we created a property named visible as a member of the Shape class. In our example, the visible property does not exist as a part of the myCircle object, only as a member of the Shape object, yet the following line of code outputs true:

trace(myCircle.visible); // output: true

Flash Player is able to ascertain that the myCircle object inherits the visible property by walking up the prototype chain. When executing this code, Flash Player first searches through the properties of the myCircle object for a property named visible, but does not find such a property. Flash Player looks next in the Circle.prototype object, but still does not find a property named visible. Continuing up the prototype chain, Flash Player finally finds the visible property defined on the Shape.prototype object and outputs the value of that property.

In the interest of simplicity, this section omits many of the details and intricacies of the prototype chain, and aims instead to provide enough information to help you understand the ActionScript 3.0 object model.

ActionScript 2.0

ActionScript 2.0 introduced new keywords such as class, extends, public, and private, that allowed you to define classes in a way that is familiar to anyone who works with class-based languages like Java and C++. It’s important to understand that the underlying inheritance mechanism did not change between ActionScript 1.0 and ActionScript 2.0. ActionScript 2.0 merely added a new syntax for defining classes. The prototype chain works the same way in both versions of the language.

The new syntax introduced by ActionScript 2.0, shown in the following excerpt, allows you to define classes in a way that many programmers find more intuitive:

// base class 
class Shape 
{ 
var visible:Boolean = true; 
}

Note that ActionScript 2.0 also introduced type annotations for use with compile-time type checking. This allows you to declare that the visible property in the previous example should contain only a Boolean value. The new extends keyword also simplifies the process of creating a subclass. In the following example, the two-step process necessary in ActionScript 1.0 is accomplished in one step with the extends keyword:

// child class 
class Circle extends Shape 
{ 
    var id:Number; 
    var radius:Number; 
    function Circle(id, radius) 
    { 
        this.id = id; 
        this.radius = radius; 
        } 
}

The constructor is now declared as part of the class definition, and the class properties id and radius must also be declared explicitly.

ActionScript 2.0 also added support for the definition of interfaces, which allow you to further refine your object-oriented programs with formally defined protocols for inter-object communication.

The ActionScript 3.0 class object

A common object-oriented programming paradigm, most commonly associated with Java and C++, uses classes to define types of objects. Programming languages that adopt this paradigm also tend to use classes to construct instances of the data type that the class defines. ActionScript uses classes for both of these purposes, but its roots as a prototype-based language add an interesting characteristic. ActionScript creates for each class definition a special class object that allows sharing of both behavior and state. For many ActionScript programmers, however, this distinction may have no practical coding implications. ActionScript 3.0 is designed such that you can create sophisticated object-oriented ActionScript applications without using, or even understanding, these special class objects. For advanced programmers who want to take advantage of class objects, this section discusses the issues in depth.

The following diagram shows the structure of a class object that represents a simple class named A that is defined with the statement class A {}:

Each rectangle in the diagram represents an object. Each object in the diagram has a subscript character A to represent that it belongs to class A. The class object (CA) contains references to a number of other important objects. An instance traits object (TA) stores the instance properties that are defined within a class definition. A class traits object (TCA) represents the internal type of the class and stores the static properties defined by the class (the subscript character C stands for “class”). The prototype object (PA) always refers to the class object to which it was originally attached through the constructor property.

The traits object

The traits object, which is new in ActionScript 3.0, was implemented with performance in mind. In previous versions of ActionScript, name lookup could be a time-consuming process as Flash Player walked the prototype chain. In ActionScript 3.0, name lookup is much more efficient and less time consuming, because inherited properties are copied down from superclasses into the traits object of subclasses.

The traits object is not directly accessible to programmer code, but its presence can be felt by the improvements in performance and memory usage. The traits object provides the AVM2 with detailed information about the layout and contents of a class. With such knowledge, the AVM2 is able to significantly reduce execution time, because it can often generate direct machine instructions to access properties or call methods directly without a time-consuming name lookup.

Thanks to the traits object, an object’s memory footprint can be significantly smaller than a similar object in previous versions of ActionScript. For example, if a class is sealed (that is, the class is not declared dynamic), an instance of the class does not need a hash table for dynamically added properties, and can hold little more than a pointer to the traits objects and some slots for the fixed properties defined in the class. As a result, an object that required 100 bytes of memory in ActionScript 2.0 could require as little as 20 bytes of memory in ActionScript 3.0.

Note: The traits object is an internal implementation detail, and there is no guarantee that it will not change or even disappear in future versions of ActionScript.

The prototype object

Every ActionScript class object has a property named prototype, which is a reference to the class’s prototype object. The prototype object is a legacy of ActionScript’s roots as prototype-based language. For more information, see History of ActionScript OOP support.

The prototype property is read-only, which means that it cannot be modified to point to different objects. This differs from the class prototype property in previous versions of ActionScript, where the prototype could be reassigned so that it pointed to a different class. Although the prototype property is read-only, the prototype object that it references is not. In other words, new properties can be added to the prototype object. Properties added to the prototype object are shared among all instances of the class.

The prototype chain, which was the only inheritance mechanism in previous versions of ActionScript, serves only a secondary role in ActionScript 3.0. The primary inheritance mechanism, fixed property inheritance, is handled internally by the traits object. A fixed property is a variable or method that is defined as part of a class definition. Fixed property inheritance is also called class inheritance, because it is the inheritance mechanism that is associated with keywords such as class, extends, and override.

The prototype chain provides an alternative inheritance mechanism that is more dynamic than fixed property inheritance. You can add properties to a class’s prototype object not only as part of the class definition, but also at run time through the class object’s prototype property. Note, however, that if you set the compiler to strict mode, you may not be able to access properties added to a prototype object unless you declare a class with the dynamic keyword.

A good example of a class with several properties attached to the prototype object is the Object class. The Object class’s toString() and valueOf() methods are actually functions assigned to properties of the Object class’s prototype object. The following is an example of how the declaration of these methods could, in theory, look (the actual implementation differs slightly because of implementation details):

public dynamic class Object 
{ 
    prototype.toString = function() 
    { 
        // statements 
    }; 
    prototype.valueOf = function() 
    { 
        // statements 
    }; 
}

As mentioned previously, you can attach a property to a class’s prototype object outside the class definition. For example, the toString() method can also be defined outside the Object class definition, as follows:

Object.prototype.toString = function() 
{ 
    // statements 
};

Unlike fixed property inheritance, however, prototype inheritance does not require the override keyword if you want to redefine a method in a subclass. For example. if you want to redefine the valueOf() method in a subclass of the Object class, you have three options. First, you can define a valueOf() method on the subclass’s prototype object inside the class definition. The following code creates a subclass of Object named Foo and redefines the valueOf() method on Foo’s prototype object as part of the class definition. Because every class inherits from Object, it is not necessary to use the extends keyword.

dynamic class Foo 
{ 
    prototype.valueOf = function() 
    { 
        return "Instance of Foo"; 
    }; 
}

Second, you can define a valueOf() method on Foo’s prototype object outside the class definition, as shown in the following code:

Foo.prototype.valueOf = function() 
{ 
    return "Instance of Foo"; 
};

Third, you can define a fixed property named valueOf() as part of the Foo class. This technique differs from the others in that it mixes fixed property inheritance with prototype inheritance. Any subclass of Foo that wants to redefine valueOf() must use the override keyword. The following code shows valueOf() defined as a fixed property in Foo:

class Foo 
{ 
    function valueOf():String 
    { 
        return "Instance of Foo"; 
    } 
}

The AS3 namespace

The existence of two separate inheritance mechanisms, fixed property inheritance and prototype inheritance, creates an interesting compatibility challenge with respect to the properties and methods of the core classes. Compatibility with the ECMAScript language specification on which ActionScript is based requires the use of prototype inheritance, which means that the properties and methods of a core class are defined on the prototype object of that class. On the other hand, compatibility with ActionScript 3.0 calls for the use of fixed property inheritance, which means that the properties and methods of a core class are defined in the class definition using the const, var, and function keywords. Moreover, the use of fixed properties instead of the prototype versions can lead to significant increases in run-time performance.

ActionScript 3.0 solves this problem by using both prototype inheritance and fixed property inheritance for the core classes. Each core class contains two sets of properties and methods. One set is defined on the prototype object for compatibility with the ECMAScript specification, and the other set is defined with fixed properties and the AS3 namespace for compatibility with ActionScript 3.0.

The AS3 namespace provides a convenient mechanism for choosing between the two sets of properties and methods. If you do not use the AS3 namespace, an instance of a core class inherits the properties and methods defined on the core class’s prototype object. If you decide to use the AS3 namespace, an instance of a core class inherits the AS3 versions because fixed properties are always preferred over prototype properties. In other words, whenever a fixed property is available, it is always used instead of an identically named prototype property.

You can selectively use the AS3 namespace version of a property or method by qualifying it with the AS3 namespace. For example, the following code uses the AS3 version of the Array.pop() method:

var nums:Array = new Array(1, 2, 3); 
nums.AS3::pop(); 
trace(nums); // output: 1,2

Alternatively, you can use the use namespace directive to open the AS3 namespace for all the definitions within a block of code. For example, the following code uses the use namespace directive to open the AS3 namespace for both the pop() and push() methods:

use namespace AS3; 
 
var nums:Array = new Array(1, 2, 3); 
nums.pop(); 
nums.push(5); 
trace(nums) // output: 1,2,5

ActionScript 3.0 also provides compiler options for each set of properties so that you can apply the AS3 namespace to your entire program. The -as3 compiler option represents the AS3 namespace, and the -es compiler option represents the prototype inheritance option (es stands for ECMAScript). To open the AS3 namespace for your entire program, set the -as3 compiler option to true and the -es compiler option to false. To use the prototype versions, set the compiler options to the opposite values. The default compiler settings for Adobe Flex Builder 3 and Adobe Flash CS4 Professional are -as3 = true and -es = false.

If you plan to extend any of the core classes and override any methods, you should understand how the AS3 namespace can affect how you must declare an overridden method. If you are using the AS3 namespace, any method override of a core class method must also use the AS3 namespace along with the override attribute. If you are not using the AS3 namespace and want to redefine a core class method in a subclass, you should not use the AS3 namespace or the override keyword.

 

*source : http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WS5b3ccc516d4fbf351e63e3d118a9b90204-7f3f.html

AND

 

Macromedia® Security Configuration 파일 (mms.cfg)의 주된 목적은, IT 부문이 엔터프라이즈 전체에 Flash Player 를 설치(Install) 하는 것을 희망하고 있는 기업 및 엔터프라이즈 환경을 지원(support)하면서, 공통의 글로벌 보안 및 프라이버시 설정 (설치(Install)시의 설정의 선택에 의해 지원(support))을 몇개인가 적용하는 것입니다.

유저 보안 레벨의 개념을 지원(support)하는 operating system에서는, 파일을 변경 또는 삭제하기 위해서 시스템 관리 책임자 (또는 root)의 허가를 필요로 하는 것을 나타내는 플래그가 파일을 뒤따르고 있습니다.

  • "mms.cfg" 를 사용하는 Mac OS X 시스템에서는, 보안 설정 파일은 "/Library/Application Support/Macromedia/mms.cfg" 에 있습니다.
  • Microsoft Windows 에서는, 파일은, 시스템 디렉토리 (예를 들어 디폴트의 Windows XP 설치(Install)에서는 "C:\winnt\system32\macromed\flash\mms.cfg") 내부의 Macromedia Flash Player 폴더에 있습니다.

이 파일을 사용해, 데이터의 로드, 프라이버시, 및 로컬 파일에의 액세스를 취급하는 보안 설정을 지정할 수 있습니다. 이 설정에는 다음과 같은 것이 있습니다.

*source : http://flexdocs.kr/docs/flex2/docs/00001372.html

 

한마디로 mms.cfg는 보안성절을 하는 파일입니다.

 

윈도우 환경에서는 다음의 경로에 파일을 찾으실 수 있습니다.

 

32비트 윈도우 시스템 : C:\Windows\System32\Macromed\Flash\mms.cfg
64비트 윈도우 시스템 : C:\Windows\SysWOW64\Macromed\Flash\mms.cfg

 

* Ivan's blog (How to deploy mms.cfg config file to your Adobe Flash Player clients?) - http://ivan.dretvic.com/2012/05/how-to-deploy-mms-cfg-config-file-to-your-adobe-flash-player-clients/

 

* Adobe의 보안에 관한 문서 - http://www.adobe.com/devnet/flashplayer/articles/flash_player10_security_wp.html

'Adobe Platform > Flex' 카테고리의 다른 글

사용자 이벤트 송출하기 (Dispatching Cumstom Event)  (0) 2012.11.20
History of ActionScript OOP support  (0) 2012.10.04
SharedObject Reference  (0) 2012.09.25
DispatchEvent Example  (0) 2012.09.25
NetStreamInfo Class  (0) 2012.09.17
AND

 

위키백과를 보면 다음과 같이 정의되어 있습니다. (영어버전의 위키피아로 들어가시면 더 많은 자료와 설명을 보실 수 있습니다. :)

 

네트워크 주소 변환(Network Address Translation, 줄여서 NAT)은 컴퓨터 네트워킹에서 쓰이는 용어로서, IP 패킷TCP/UDP 포트 숫자와 소스 및 목적지의 IP 주소 등을 재기록하면서 라우터를 통해 네트워크 트래픽을 주고 받는 기술을 말한다. 패킷에 변화가 생기기 때문에 IP나 TCP/UDP의 체크섬(checksum)도 다시 계산되어 재기록해야 한다. NAT를 이용하는 이유는 대개 사설 네트워크에 속한 여러 개의 호스트가 하나의 공인 IP 주소를 사용하여 인터넷에 접속하기 위함이다. 많은 네트워크 관리자들이 NAT를 편리한 기법이라고 보고 널리 사용하고 있다. NAT가 호스트 간의 통신에 있어서 복잡성을 증가시킬 수 있으므로 네트워크 성능에 영향을 줄 수 있는 것은 당연하다.

 [출처] 위키피아(영문), 위키피아(한글)

 

일차원적으로 쉽게 설명하면, 일반 가정에서 쓰는 인터넷선으로 부여받은 ip로는 컴퓨터 한대밖에 인터넷이 안됩니다.  여기서 보통 여러대의 컴퓨터로 인터넷을 하려고 사용하는 것이 공유기 입니다. 공유기의 기능은 집으로 들어온 하나의 ip를 여러개의 ip주소로.... 각각의 이름(주소)이 다른 ip주소로 배분을 해줍니다. 이 배분해주는 기술을 NAT라고 합니다.

 

아래는 NAT의 장단점을 기술한 것입니다.

 

Network Address Translation(네트워크 주소 변환)


NAT는 IPv4의 주소 부족 문제를 해결하기 위한 방법으로서 고려되었으며, 주로 비공인(사설, local) 네트워크 주소를 사용하는 망에서 외부의 공인망(public, 예를 들면 인터넷)과의 통신을 위해서 네트워크 주소를 변환하는 것이다. 즉 내부 망에서는 사설 IP 주소를 사용하여 통신을 하고, 외부망과의 통신시에는 NAT를 거쳐 공인 IP 주소로 자동 변환한다. NAT를 사용하면,

장점:
1. 공인 IP 주소 1개에, 여러 개의 비공인 주소를 매핑할 수 있어 비용절감 효과가 있다.
2. 사설 IP 주소를 사용함으로써 외부에서 볼 때 내부의 망 구조를 알 수 없어 보안 효과가 있다.

단점:
외부망과의 통신시 주소 변환을 거쳐야 하므로 느려지며, 사용자가 많을수록 속도 저하가 커진다.

이러한 NAT 기능은 보통 라우터나 방화벽 등에 설치하며, 라우팅 정책에 따라 사설 IP 주소와 변환될 IP 주소를 static하게 혹은 dynamic하게 매핑할 수 있으며 테이블로 관리된다. 시스코 라우터인 경우,

1. 사설 IP 주소를 정적인 하나의 공인 IP 주소로 매핑
2. 사설 IP 주소를 임의의 공인 IP 주소들 중에서 어떤 하나와 매핑
3. 사설 IP 주소에 특정 TCP 포트를 더한 것을 하나의 공인 IP 주소로 매핑
4. 공인 IP 주소를 사설 IP 주소 중의 하나로 (순서는 라운드 로빈 방식을 사용) 매핑 할 수 있다.

[출처] 네크워크 용어사전


AND

* 이 포스팅은 영문포스팅을 직접 번역한것입니다. 전문가가 아닌만큼 오역이 있을 수 있다는 점 참고하세요. - Kevin

 

Flash Player 10버전에서 Adobe사는 Real-Time Media Flow Protocol(RTMFP)를 소개했었습니다.  실시간 어플리케이션을 사용할 경우, RTMFP는 RTMP와 비교했을 때 많은 이점들을 제공합니다. (특히나 대기시간 감소시킬때와 p2p 연결시)

With the release of Flash Player 10, Adobe introduced Real-Time Media Flow Protocol (RTMFP). When used for real-time collaboration applications, RTMFP provides several advantages when compared to Real-Time Messaging Protocol (RTMP)—most notably, reduced latency and direct peer-to-peer connections.

 

하지만 RTMFP를 사용하기 위해서는 Flash Player는 Flash Media Server4나 코드네임 Cirrus와 같은 실시간 통신서비스에 연결해야 합니다. Adobe에서 호스팅 된 Cirrus서비스는 개발을 목적으로 사용 할 수 있습니다. 불필요한것을 뺀 오직 rendezvous(연결?) 서비스만 제공하는 아주 기본이 되는 버전의 FMS를 볼 수 있습니다. 그 버전은 미디어 중계(media relay), 공유객체(shared obejct), 원격 메소드 호출(remote method invocation), 혹은 FMS4의 다른 버전들의 특징들을 지원하지 않습니다.

To use RTMFP, however, Flash Player needs to connect to a real-time communications service such as that provided by Adobe Flash Media Server 4 or Codename Cirrus. The Cirrus service (rtmfp://p2p.rtmfp.net), hosted by Adobe, can be used for development purposes. You can view it as a stripped-down version of Flash Media Server (FMS) 4 that exclusively provides a rendezvous service: it does not support media relay, shared objects, remote method invocation, or other features of Flash Media Server 4.

 

RTMFP를 사용해 상용 어플리케이션을 DEPLOY하기 위해서는, Flash Media Server 4 버전을 사용해야 합니다. FMS의 뛰어난 기능들을 사용할 수 있을 뿐만 아니라, 어플리케이션 deployment를 방지 할 수 있는 Cirrus서비스의 제한과 관련된 방화벽을 설정할 수 있습니다. (deploy시킨다는게 먼말이지 ㅜㅜ)

To deploy commercial applications using RTMFP, you must use Flash Media Server 4. Not only can you take advantages of all FMS capabilities, but you can address firewall-related limitations of the Cirrus service that would prevent successful deployment of your application.

 

이 글은, RTMP와 대비되는 RTMFP의 이점을 서술하고 있습니다. 그리고 RTMFP에 의해 직면된 과제들을 서술하고 있습니다.  그다음으로는, FMS를 사용한 직면된 과제들의 해결책을 제공합니다. 마지막으로 비디오미팅 샘플 어플리케이션을 제공합니다. 이 어플리케이션은 여러가지 다른 환경(여러 버전의 Flash Player버전, 여러종류의 네트워크 방화벽)에서 어떻게 균일하게 동작하는지를 보여줍니다.

In this article, I first point out the advantages of RTMFP versus RTMP. I then describe the challenges faced by RTMFP. Next, I provide solutions for these challenges using Flash Media Server. Finally, I present a sample video meeting application demonstrating how to seamlessly work around different versions of Flash Player instances and network firewall devices.

 

이 글은 중고급 Actionscript개발자들을 위한 글입니다.(ㅠㅠ) 기본적인 스트림 어플리케이션을 어떻게 만드는지는 설명하지 않았고, 좀 더 심화된 주제에 중점을 뒀습니다. RTMFP API는 다음 링크를 보세요. http://www.adobe.com/devnet/flashplayer/articles/rtmfp_cirrus_app.html

This article is intended for intermediate and advanced ActionScript developers. It does not explain how to create basic streaming applications, but focuses on more advanced topics. For an introduction and API review of RTMFP, please read Cirrus service for developing end-to-end applications using RTMFP in Flash Player 10.

 

Adobe LiveCycle Collaboration Services(LCCS)는  여기서 논의된 모든 주제를 다루는 high-level SDK 입니다. 이 글은 LCCS에서 제공하는 것보다 많은 콘트롤을 얻고 싶은 개발자들을 위한 글입니다.

Adobe LiveCycle Collaboration Services (LCCS) is a high-level SDK that takes care of all the issues discussed here. This article is intended for developers who would like to get more control than that provided by LCCS.

 

Flash Player 10.1 버전, Flash Media Server 4 환경에서  RTMFP 어플리케이션 레벨과 native IP 멀티캐스팅에 대해 더 많은 기능을 제공합니다. RTMFP의 이 기능들은 이 글에서 다루지 않습니다.

With the release of Flash Player 10.1 and Flash Media Server 4, RTMFP further provides application-level and native IP multicast. These capabilities of RTMFP are out of the scope of the article.

 

real-time collaborations 대한 RTMFP의 이점(Advantages of RTMFP for real-time collaborations)

 

RTMP는 Flash Player 6버전에서 소개된 프로토콜 입니다. 주로 오디오와 비디오 콘텐츠 스트리밍에 초점이 맞춰져 있었습니다. RTMP는 HTTP tunneling과 컨텐츠 보호 등 시간이 지남에 따라 RTMP는 발전했습니다. RTMP는 TCP를 기반으로 두고 있습니다.  TCP를 기반으로 한다는 것은 FMS와 Flash Player사이에 신뢰할 수 있는 데이터 전송을 제공합니다. 이는 무한대기가 발생할 수 있습니다. 하지만 broadcast-type media distribution,live, recored 대해서는 문제가 되지 않습니다.  왜냐하면 Flash Player는 버퍼를 이용해 재생하기 때문에입니다.(버퍼링을 사용으로 무한대기가 발생하지 않기때문에 문제가 되지 않는다는 말인듯...) - 일반적으로 몇초의 버퍼링으로 네트워크 인터럽션을 보상 할 수 이죠. 

  미디어 데이터 온전성을 보호하는 것은 시기적절한 미디어 전송보다 중요합니다. (빠른 미디어 전송보다는 손실되지 않은 미디어 전송이 더 중요하다는 말, 그래서 여기서 제공되는 어플리케이션을 미디어 손실을 최소화 시켯다는 말)   미디어 손실은 예측불허의 오디오/비디오 왜곡을 일으킵니다.

RTMP is an open protocol introduced in Flash Player 6 that mainly targets streaming audio and video content. Over time, several flavors of RTMP were developed, including tunneling over HTTP, providing protected content, and more. RTMP is based on Transmission Control Protocol (TCP). As such, it provides reliable data delivery between Flash Media Server and Flash Player, which is achieved at the price of unbounded delay. This is not a problem for broadcast-type media distribution (either live or recorded) because Flash Player maintains a playback buffer—typically several seconds long—that can compensate for network interruptions. In these applications, ensuring media integrity is of higher importance than timely delivery. Losing media data could also introduce undesirable audio/video distortion.

 

Flash Player 10과 Adobe AIR 1.5에서 RTMFP가 소개되었습니다. RTMP와는 다르게 RTMFP는 User Datagram Protocol(UDP) 기반으로 되어 있습니다. UDP는 빠르고, 최소한의 오버헤드가 발생하는 신뢰적이지 않는 data(빠르지만 그만큼 Data손실이 일어나기 때문에 신뢰적이지 않는 Data라고 표현하는가 보네요~)를 전송합니다. 흐름제어(flow control), 정체제어(congestion control), 안전장치(safeguards)가 없습니다. UDP는 종점(endpoints, end유져) 사이에 딜레이를 최소화 하는것이 최고로 중요한 실시간 통신 어플리케이션에 사용됩니다. 덧붙이면, UDP는 endpoints사이의 미디어 교환을 가능하게 합니다. 이는 endpoints사이의 딜레이 감소 뿐만 아니라 미디어 중계서버들의 필요성을 감소 시킵니다.

Flash Player 10 (and Adobe AIR 1.5) introduced RTMFP. Unlike RTMP, RTMFP is based on User Datagram Protocol (UDP). UDP provides fast and unreliable data delivery with minimal overhead; there is no flow control, congestion control, or other safeguards. UDP is popularly used for real-time communications applications where minimizing delay between communicating endpoints is of utmost importance. In addition, UDP also facilitates direct media exchange between communicating endpoints, which not only further reduces delay between endpoints, but also reduces media relay server requirements.

 

실시간 어플리케이션에서는, 딜레이를 최소화 시키는게 가장 중요한 이슈가 될 것 입니다. 수백밀리초의 딜레이는 원활한 대화를 하는데 있어서 중요한 문제입니다. 믿을만한 전송을 얻는다는 것은 네트워크 전송 에러를 다루도록(에러나면 에러를 은폐할 수 있는 기술이 코덱에 있는가 보네요.) 디자인 되어진 일반적인 오디오,비디오 코덱기술이 필요로 하지 않을 지도 모릅니다.(Flash Player에서 사용 할 수 있는 Speex음성 코덱이나 H264비디오코덱과 같은것)

In real-time collaboration applications, minimizing delay is one of the most important goals; a few hundred milliseconds' worth of delay could render a conversation unusable. Achieving reliable transmission may not be needed since modern audio and video coding technologies (such as the Speex voice codec and the H.264 video codec, both available in Flash Player) are designed to deal with network transmission errors and thus provide error concealment techniques.

 

RTMP와 RTMFP를 비교해 볼 때, RTMFP는 실시간 어플리케이션에 다음과 같은 이점을 제공합니다.

When compared to RTMP, RTMFP provides the following advantages for real-time collaborations applications:

 

  • 짧은 대기: 왜냐하면 UDP기반으로 설계되었기 때문입니다.  짧은 대기시간은 실시간 어플에서 가장 중요한 점입니다. 대기시간은 end-to-end 미디어 전송 메커니즘으로 더욱 줄일 수 있습니다.
  • Low latency: Because it is built on top of UDP, RTMFP provides minimal latency, which is of paramount importance for real-time collaboration applications. Latency can be further reduced by using an end-to-end media delivery mechanism.
  •  

  • 부분적 신뢰: 어플리케이션 요구사항에 따라, RTMFP는 신뢰할수 있는전송, 혹은 신뢰할 수 없는 전송을 제공합니다. 물론 신뢰할 수 있는 전송은 무제한 대기상태를 초래합니다.(이는 RTMP와 다를게 없죠)  다시말하면 신뢰할 수 없는 전송을 사용해야 대기를 최소화 시킬 수 있다는 말입니다. RTMFP는 두 endpoints사이의 통신에서 미디어는 unreliably하게, 데이터는 reliably하게 보냅니다.(미디어는 빠르지만 손실이 일어나고, 데이터는 느리지만 손실이 일어나지 않는 전송을 한다는 말인것 같습니다. 어렵네요 ㅜㅜ)  RTMFP는 reliable과 unreliable 전송 모두에 혼잡제어(congestion control)를  수행합니다.
  • Partial reliability: Depending on your application needs, RTMFP can provide reliable or unreliable transmission. Naturally, reliable transmission results in unbounded delay—the same as with RTMP. On the other hand, you can minimize latency by using unreliable transmission. RTMFP allows for sending media unreliably and data reliably over the same connection between two communicating endpoints. RTMFP performs congestion control over UDP for both reliable and unreliable transmissions.
  •  

  • 종단간 미디어 전송: Flash Player endpoints 사이에 중계서버 라우팅없이 직접적으로 미디어를 보낼수 있습니다. 반면 RTMP는 모든 미디어가 FMS로 보냅니다. 이것은 응답시간(latency)뿐만 아니라 서버 요구사항?(server requirements)을 줄일 수 있습니다. RTMFP는 각각의 Flash Player endpoint에게 peer id를 부여합니다. 퍼블리싱하는 Flash Player endpoint의 미디어를 받기위해, 섭스크라이빙 endpoint쪽(받는쪽) 입장에서는 원격 peer ID는 명시되어야 합니다. 퍼블리싱하는 peer는 각각의 직접적으로 받는쪽peer를 명확하게 인지해야합니다. 
  •  

  • End-to-end media delivery: Media can be directly sent between Flash Player endpoints without routing through a central relay server, whereas RTMP requires all media sent through FMS. This not only reduces latency but also reduces server requirements. RTMFP assigns a peer identifier to each Flash Player endpoint. To receive media from a publishing Flash Player endpoint, a subscribing endpoint must specify the remote peer's ID. The publishing peer must explicitly approve each direct subscribing peer.
  •  

  • 데이터 우선순위: 오디오, 비디오, 데이터는 제한된 네트워크 자원을 가지는 환경에서 다른 우선순위를 가지고 전송됩니다. 오디오는 비디오보다 우선순위가 높습니다. 즉, data보다 더 높은 우선순위로 보내어 진다는 말입니다. (단, 그 data는 항상 reliably하게 보내어 진다.)
  • Data prioritization: Audio, video, and data are transmitted with different priority in case of limited network resources. Audio is sent with higher priority than video, which is sent with higher priority than data (note, however, that data is always sent reliably).
  •  

  • 암호화: RTMFP를 이용한 통신은 항상 AES 128-bit long keys를 이용해 암호화 된다. 이는 Diffie-Hellman key exchange 메소드를 사용해서 암호화 된다. 여기서 주의해야 점은 RTMFP는 SSL과 RTMPS와 같이 강력한 endpoint 인증메소드를 제공하지 않는다는 것입니다. 그러나 Flash Player는 어플리케이션개발자에게 secure nonces(?) 
  • 를 보여줍니다. non-forgeable nonces는 모든 endpoints통신, 매치시키기 위해 보증되는데 이용된다. (뭔말이지 ㅜㅜ)   이는 man-in-the-middle공격들로부터 부호할 수 있습니다.

  • Encryption: Communications over RTMFP are always encrypted using AES 128-bit long keys, which are negotiated using the Diffie-Hellman key exchange method. It is important to note that RTMFP does not provide strong endpoint authentication methods such as SSL or RTMPS. However, Flash Player does expose secure nonces to application developers. These non-forgeable nonces are available to all communicating endpoints and are guaranteed to match, which can be used to protect against man-in-the-middle attacks.
  •  

    RTMFP를 사용함에 있어 도전과제 (Challenges of using RTMFP)

     

    RTMFP를 사용하기 위해서는 Flahs Player는 서비스에 연결되어야 합니다.(Cirrus service나 FMS와 같은것)   이것은 so-called peer identifier를 얻는것이 필요합니다. 이 id는 256비트 랜덤한 유니크한 숫자로 peers사이의 통신을 하기위해 사용됩니다.

    To use Real-Time Media Flow Protocol (RTMFP), Flash Player needs to connect to a service (either the hosted Cirrus service or Flash Media Server). This is required to obtain a so-called peer identifier, a unique 256-bit random number that is used in establishing communications between peers.

     

    상업 어플리케이션 개발 시, 개발자들은 다음의 이슈에 알아야 합니다.

    When creating commercial applications, developers must address the following issues:

     

  • UDP 블로킹: 앞서 언급했듯이, RTMFP는 UDP기반입니다. 많은 기업 방화벽들이 전적으로 UDP 트래픽을 차단하고 있습니다. 차선책중 하나로 RTMFP에 대한 proxy우회설정을 하면 되지만, 더 이상적인 해결책은 RTMFP에서 RTMP로, 혹은 RTMFP에서 RTMP Tunneled로 대비(fall back) 하는것 입니다.
  • UDP blocking: As I mentioned before, RTMFP is based on UDP. Many corporate firewalls block UDP traffic altogether. One of the workarounds is to configure a TURN proxy for RTMFP, but a more desirable solution is to fall back from RTMFP to RTMP or RTMP Tunneled (RTMPT).
  •  

  • Convergence of RTMFP and RTMP: RTMFP는 Flash Player 9 버전, 혹은 그 이전 버전, 방화벽이 UDP를 차단하고 있을 경우에서는 사용 할 수 없습니다. Flash Player 클라이언트는 RTMP나 RTMFP를 사용하는것은 서로서로 미디어 교환을 할 수 있게 한다는 것이 중요합니다.
  • Convergence of RTMFP and RTMP: RTMFP cannot be used if Flash Player 9 or earlier is involved in collaboration, or if firewalls block UDP. It is important that Flash Player clients using either RTMP or RTMFP can exchange media with each other.
  •  

  • Failover in case of firewall blocking: 양쪽의 클라이언트가 RTMFP를 이용해서 rendezvous서비스에 성공적으로 연결 되어도, 클라이언트가 서로에게 직접적으로 미디어를 보낸다는 보장이 없습니다.  직접적인 통신이 가능하냐는 것은 클라이언트 단의 방화벽들의 환경상태에 달려 있습니다. 직접적인 연결이 불가능 할 경우, 미디오 중계를 중점적으로 할 수 있는 대안(Failover)이 필요합니다.
  • Failover in case of firewall blocking: Even if both clients can successfully connect to the rendezvous service using RTMFP, there is no guarantee that clients can directly send media to each other. It really depends on the combination of firewalls located at clients to determine whether direct communication is possible. When a direct connection is not possible, failover to centrally relayed media is required.
  •  

  • 다중 통신: 다수통신의 경우, 각 클라이언트는 나머지 모든 클라이언트에 미디어를 보내야 합니다. 그러기 위해서는 대칭되는 업링크와 다운링크가 필요합니다.  ADSL이나 회선연결에서는 좋지 못한 매칭입니다. 3명이상의 커뮤니케팅을 할 경우에는 CS구조가 더 좋을 것입니다.
  • Multiparty communications: In a multiparty scenario, each client must send media to every other client. This requires symmetric uplink and downlink, which is a poor match to consumer ADSL or cable connections. When more than three communicating parties are involved, it is probably more advantageous to use client-server media delivery topology.
  •  

  • User lookup: rendezvous 서비스에 연결됐을때, Flash Player는 유일한 peer ID를 만듭니다. 두 endpoints Flash Player사이에 직접적인 통신을 하기위해서는 필히 다른 endpoints의 peer ID를 알아야 합니다. 이 peer ID를 바꿔주는 것은 어플리케이션딴에서 해야합니다.
  • User lookup: When connected to a rendezvous service, Flash Player creates a unique peer ID. In order to establish direct communications between two Flash Player endpoints, each must know the other's peer ID. It is the application's responsibility to exchange these peer IDs.

     

    다음 세션은 FMS를 사용하면서 이러한 도전과제들을 어떻게 다룰지를 좀 더 상세히 설명합니다.

    The following section reviews in detail how you can address each of these challenges by using Flash Media Server.

     

     

    RTMFP통신을 위한 FMS 사용 (Using Flash Media Server for RTMFP communications)

    FMS4는 RTMFP의 모든 이점들을 사용하면서 어플리케이션을 개발 할 때 사용될 수 있습니다. 추가로, 공유객체(shared obejct)나 원격메소드호출(remote method invocation, RMI)과 같은 모든 형태의 기능들을 사용 할 수 있습니다.

    Flash Media Server (FMS) 4 can be used to build applications using all the advantages of RTMFP. In addition, one can take advantage of all existing features such as shared objects and remote method invocation (RMI).

     

    다음 세부항목은 클라이언트사이드, 서버사이드 양쪽의 ActionScript소스코드 제공하면서, 앞서 언급한 RTMFP의 각각의 과제들을 address하는지 설명하고 있습니다. 

    The following subsections describe how to address each of the challenges of RTMFP described in the previous section, providing ActionScript source code for both client and server where applicable.

     

    UDP차단 (UDP blocking)

    SOHO환경(small office or home office,기업이 아닌 작은회사나 가정집)의 방화벽의 경우가 아니라면, 기업의 방화벽의 경우 전체적으로 UDP 트래픽을 차단하는 것이 일반적입니다. 이것에 대한 한가지 해결책은 프록시 우회(TURN proxy)를 위한 Flash Player를 설정하는 것입니다.(Traversal Using Relays around NAT).  Adobe Flash Player 10.1 Administration Guide에 기술되어 있듯이, Flash Player는 mms.cfg 파일의 다음 옵션을 명시함으로 IETF Internet Draft "draft-ietf-behave-turn-08" 을 지원하기 위해 어떠한 허용 없이도 수정 될 수 있다.

    While rarely the case with small office or home office (SOHO) firewalls, it is quite common for corporate firewalls to block UDP traffic altogether. One solution is to configure Flash Player to use a TURN proxy (Traversal Using Relays around NAT). As documented in the Adobe Flash Player 10.1 Administration Guide, Flash Player can be configured to support IETF Internet Draft "draft-ietf-behave-turn-08" without authentication by specifying the following option in mms.cfg:

     

    RTMFPTURNProxy = ip_address_or_hostname_of_TURN_proxy

     

    이 방법은 개발을 위한 기업의 IT부서와 TURN proxy기반으로 deploy 하는 것이 필요합니다.

    This solution requires your corporate IT department to develop and deploy a conforming TURN proxy.

     

    더 이상적은 방법은 server로의 RTMFP연결이 실패했을 경우, 균일하게 RTMP연결로 대치 하는 것입니다. 불행히도, RTMFP의 서버로의 연결이 성공적일 것인지를 알 수 있는 방법은 없습니다. 한가지 방법으로... 다시 연결을 시도하거나, NetConnection.Connect.Success 혹은 NetConnection.Connect.Failed 의 응답을 기다리는 것이 유일한 방법입니다.

    연결실패했을 때 NetConnection.Connect.Failed 이벤트가 90초 후에 발생됩니다. 한가지 접근방법은 서버로의 RTMP, RTMFP연결 모두 parallel connections을 시도하는 것입니다. RTMFP연결이 성공할 때 마다, RTMP연결을 간단히 닫아줍니다. (RTMFP연결되면 RTMP연결을 닫아주는걸 parallel connections 라고 표현하네요.)

    A more desirable solution is to seamlessly fail over to an RTMP connection when an RTMFP connection to the server cannot be established. Unfortunately, there is no way to probe whether an RTMFP connection to the server will be successful. The only way is to attempt the connection and wait for a NetConnection.Connect.Success or NetConnection.Connect.Failed response. A failed connection will provide a NetConnection.Connect.Failed event after a 90-second timeout. One approach would be to try parallel connections of both RTMP and RTMFP to the server. Whenever RTMFP succeeds, the RTMP connection can simply be closed.

     

    또다른 방법은  타임아웃을 두어 우선순위에 따라 연속적으로 프로토콜 하는 것입니다. 아래 간단한 클라이언트사이드 ActionScript코드는 연속적 연결을 하는 것을 보여줍니다.

    Another strategy is to try protocols sequentially in preference order (for instance, RTMFP, RTMP, RTMPT) with a given timeout. This sample client-side ActionScript code demonstrates sequential connection establishment:

                      private var rtmfpTimer:Timer = null;

                        private var netConnection:NetConnection = null;

                        private const ConnectionTimeout:int = 5000;

                       

                        public function register(rtmp:Boolean):void

                        {

                               netConnection = new NetConnection();

                               netConnection.addEventListener(NetStatusEvent.NET_STATUS, connectionHandler);

                               netConnection.connect(rtmp ? "rtmp:" : "rtmfp:" + "//server.domain/application");

                              

                               if (!rtmp)

                               {

                                     rtmfpTimer = new Timer(ConnectionTimeout, 1);

                                     rtmfpTimer.addEventListener(TimerEvent.TIMER_COMPLETE, rtmfpTimeoutHandler);

                                     rtmfpTimer.start();

                               }

                        }

                       

                        private function rtmfpTimeoutHandler(e:TimerEvent):void

                        {

                               netConnection.close();

                               netConnection = null;

                              

                               register(true);

                        }

                       

                        private function connectionHandler(e:NetStatusEvent):void

                        {

                               if (rtmfpTimer)

                               {

                                     rtmfpTimer.stop();

                                     rtmfpTimer = null;

                               }

                              

                               if ("NetConnection.Connect.Success" == e.info.code)

                               {

                                     // RTMFP or RTMP connection succeeded

                               }

                               else if ("NetConnection.Connect.Failed" == e.info.code)

                               {

                                     // RTMFP or RTMP connection failed

                               }

                        }

     

    Convergence of RTMP and RTMFP

    Flash Player endpoints가 모두 RTMFP를 사용 할 수 있는것은 아닙니다. 예를들면:

    It is quite possible that not all Flash Player endpoints can use RTMFP. For instance:

    • Flash Player 9 버전, 혹은 그 이전버전 (Flash Player 9 or an earlier version is used, and thus RTMFP is not available)
    • 방화벽이 UDP를 막았을 경우 (A firewall blocks UDP, and thus RTMFP is not possible)

    위의 두 경우의 해결책은 FMS를 통해 미디어를 보내는 것입니다. FMS는 RTMPx와 RTMFP 스트림 모두 바인딩 합니다.: 어떤 서버나 클라이언트 동작이 필요치 않습니다.

    In both of these cases, the only solution is to send media through Flash Media Server. FMS will transparently bind RTMPx and RTMFP streams together: no server or client work is needed.

     

    RTMP는 오직 CS 구조에서 동작한 이후, 직접통신과 CS통신 사이에 conference topology를 바꿔주어야 합니다.(무슨말이지...)  가령 A,B 라고 하는 두 클라이언트가 RTMFP를 이용한 직접통신방식의 비디오 미팅에 있다고 해봅시다. 클라이언트 C가 들어왔을 경우, 미팅 토폴로지는 C-S구조로 바뀌어야 합니다. 그것은 모든 미디어는 중앙FMS서버를 거쳐야 한다는 것입니다. 참석자C가 방을 나가면, 미팅은 직접연결방식으로 바뀔 수 있습니다. 클라이언트 A, B는 RTMFP에서 RTMP로 프로토콜을 바꿀 필요가 없다는 것을 주의하십시오; FMS는 두 프로토콜을 유기적인 연결합니다.

    Since RTMP only works in a client-server scenario, your application is responsible for switching its conference topology between direct communications and client-server communications. Assume that there are two participants (say, A and B) in a video meeting using direct communications over RTMFP. When client C (using RTMP) joins, the meeting topology must be converted to client-server; that is, all media must go through the central FMS. When client C leaves, the meeting can be converted back to a direct connection. Note that clients A and B do not need to change protocol from RTMFP to RTMP; FMS will perform seamless bridging of the two protocols.

     

    방화벽차단의 경우 Failover (Failover in case of firewall blocking)

    두개의 Flash Player endpoints가  RTMFP서비에서 성공적으로 연결이 된다 하더라도, 두 클라이언트가 서로서로 직통으로 통신할 수 있다는 보장은 없습니다. 왜냐하면 방화벽과 같은 중간 매개체가 두 클라이언트 사이를 차단 할 수 있기 때문입니다. RFC 3489, NAT를 통하는 UDP의 STUN-SImple Traversal - NAT는 다음의 4가지형태로 분류된다.

    1. Full cone

    2. Restricted cone

    3. Port Restricted cone

    4. Symmetric.

    * Full cone가 가장 관대하고, symmetric가 가장 제한적임.

    다음 예제는 방화명은 위 4가지 형태로 분류될 수 없음을 나타내어 줍니다. 예를들면 방화벽이 있으면 들어오는 트래픽과 나가는 트래픽의 다른 양상을 보입니다.

    Even if both Flash Player endpoints successfully connect to the RTMFP service, there is no guarantee that two clients can communicate directly with each other because intermediaries such as firewalls can block communications between two endpoints. RFC 3489, STUN—Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators—classified network address translators (NATs) into the following four categories: full cone, restricted cone, port restricted cone, and symmetric. (Full cone is the most permissive and symmetric is the most restrictive.) Later experimentation has found that firewalls cannot be clearly classified to the above categories; for instance, certain firewalls exhibit different behavior for incoming and outgoing traffic.

     

    endpoints사이의 직접통신이 방화벽타입을 앎으로 성공적일지 혹은 성공적이지 않을지라도, 어떤 보증도 할 수 없습니다. (방화벽 타입을 안다고 해서, 연결을 확신 할 수 있는게 아니다.)두 endpoints 사이에 직접통신이 가능한지를 확인하는 가장좋은 방법은 간단하게 시도해보는 것입니다. 이 방법은 RFC 5245에 채택된 접근 방법입니다.

    A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols. 첫번째, 다양한 통신주소가 수집됩니다. 이 주소들은 로컬주소(local address), 외부주소(external address), 중계주소(relayed address) 입니다. 통신은 성공확률이 가장높은 주소들을 가지고 연결됩니다.(cheapest solution은 아님) 그리고 그후 cheapest possible solution(local address)으로 바꿉니다.

    Although you can predict whether direct communications between two endpoints will be successful by knowing the firewall types, no guarantees can be given. The best way to see whether direct communication between two endpoints is possible is simply to try. This is the approach adopted by RFC 5245, Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols. First, a series of communication addresses are collected. These addresses include local addresses, external addresses, or relayed addresses. Communications starts with the address with the highest probability of success (which may not be the cheapest solution) and later changing to the cheapest possible solution (local address).

     

     

    이 예제에서 비슷한 솔루션을 사용하였습니다. 먼저 미디어를 서버를 통해 보내는 방법과 peers들에게 직접 보내는 방법 두가지 모두 사용합니다. FMS를 거쳐 보내는 것은 항상 성공적입니다.  두 클라이언트가 직접통신이 가능한지를 보기위해서는 data messages 사용하면  간단히 알 수 있습니다. 이 방법에는 두가지가 있습니다.

    In this example, I've adopted a similar solution. To start, the application sends media both through the server and directly to peers. Sending media through FMS always succeeds. An alternative approach would be to simply probe using data messages to see whether direct connection between two clients is available. There are two ways to detect whether a direct connection was successful:

     

    • 직접적으로 연결된 스트림이 들어오는 것에 대한 NetStream.Play.Start의 수신 (Reception of NetStream.Play.Start on an incoming directly connected stream)
    • 직접적으로 연결된  스트림이 나오는 것에 대한 NetStream 클라이언트 객체에 대한 onPeerConnect() callback메소드의 수신 (Reception of an onPeerConnect() callback on the NetStream client object on an outgoing directly connected stream)

     

    이 예제는 위의 것들을 보여줍니다. 클라이언트를 퍼블리싱하는 코드입니다.

    This following sample code demonstrates the idea. Here's the code for the publishing client:

     

                     private var outgoingStreamDirect:NetStream = null;

                        private var outgoingStreamFms:NetStream = null;

                       

                        private function multiPublish():void

                        {

                               outgoingStreamDirect = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);

                               outgoingStreamFms = new NetStream(netConnection);

                              

                               outgoingStreamDirect.publish("streamDirect");

                              

                               var c:Object = new Object();

                               c.onPeerConnect = function(peer:NetStream):Boolean

                               {

                                     // if we receive onPeerConnect, it means that direct connection succeeded

                                     if (outgoingStreamFms)

                                     {

                                            outgoingStreamFms.close();

                                            outgoingStreamFms = null;

                                     }

                                     return true;

                               }

                               outgoingStreamDirect.client = c;

                              

                               outgoingStreamFms.publish("streamFms")

                        }

     

    클라이언트를 수집하면서, 퍼블리싱하는 peer ID는 이미 알 수 있다고 생각합니다.

    In the subscribing client, it is assumed that the publishing peer ID is already known:

     

                       private var incomingStreamDirect:NetStream = null;

                        private var incomingStreamFms:NetStream = null;

                       

                        private function multiSubscribe():void

                        {

                               incomingStreamFms = new NetStream(netConnection);

                               incomingStreamDirect = new NetStream(netConnection, id_of_publishing_client);

                               incomingStreamDirect.addEventListener(NetStatusEvent.NET_STATUS, streamHandler);

                              

                               incomingStreamFms.play("streamFms");

                               incomingStreamDirect.play("streamDirect");

                        }

                       

                        private function streamHandler(e:NetStatusEvent):void

                        {

                               // if Play.Start event received on direct connection, it means that direct communications is possible

                               if ("NetStream.Play.Start" == e.info.code)

                               {

                                     if (incomingStreamFms)

                                     {

                                            incomingStreamFms.close();

                                            incomingStreamFms = null;

                                     }

                               }

                        }

     

    미디어를 보내고 받기를 시작할 때, 여러가지 방법을 선택 할 수 있습니다. C-S 스트림을 사용하면서 미디어를 즉시 보내고/받기를 원할 것 입니다. 이경우 모든 케이스가 가능합니다. 하지만 C-S 에서 직접연결로 바꾸때 아주 작은 문제가 있습니다.  그 대신, 직접연결로, 타임아웃 이후 C-S 시작하기를 원할지도 모릅니다.

    You have several strategies to choose from for when to start sending and receiving media. You may want to start sending and receiving media right away using the client-server stream, since that will succeed in every case. There may be a small glitch, however, when switching over from client-server to direct connections. Alternatively, you may want to wait to start with a direct connection and failover to client-server after a given timeout.

     

     

    Multiparty communications

    직접통신은 응답대기를 최소화 시키기 위해 클라이언트와 통신하는 것과, 서버비용을 줄이는 것이기 때문에 선호되는 방법입니다. multiparty session에서  참석한 클라이언트는 각각은 다른 모든 참석한 클라이언트에게 미디어를 보내야 합니다. 따라서  각 클라이언트는 똑같은 uplink, downlink 대역폭을 사용합니다. 각 미디어 스트림은 b bandwidth가 필요하다고 하면, 접속된 클라이언트 수를 n 이라 할때 uplink, downlink 비트율은 b (n–1) 이 됩니다. 이것은 ADSL모뎀 케이블을 쓰는 유저에게는 좋지 않습니다.  500 Kbps 비디오 스트림을 상상해 보십시오. 몇 참석자가 uplink를 쉽게 다 써버릴 것입니다. 그것은 성능저하를 일으킵니다. 반면에 C-S 토폴로지는 비대칭 네트워크 연결에 완벽히 매칭됩니다. b uplink 대역폭과 b (n–1) downlink대역폭이 필요합니다.

    Direct connections are preferred between communicating clients to minimize latency and reduce server costs. In a multiparty session, each participating client must send media to all participating clients (see Figure 1). Thus, each client uses the same uplink and downlink bandwidth. Assuming each media stream requires b bandwidth, the required uplink or downlink bitrate is b (n–1), where n is the number of participating clients. This is a poor match for home users' cable or ADSL modems. Imagine a 500 Kbps video stream, even a few participants may easily overwhelm one's uplink, causing performance degradation. On the other hand, client-server topology is a perfect match for asymmetric network connections. It requires b uplink bandwidth and b (n–1) downlink.

     

     

    Figure 1. Media transmission in direct connection (left) and client-server (right) topologies. Thin lines denote control connection and thick lines denote media data

     

    User lookup

    RTMFP는 각 참석자에게 peer ID를 배정합니다. peer ID는 256bits로 되어있고, 강제로 만들 수가 없습니다.  직접적으로 스트림을 보내고 싶을 때, 발신자의 peer ID를 명시해야 합니다.

    RTMFP assigns a peer ID to each participant. These peer IDs are 256 bits long and are non-forgeable. When you want to subscribe to a directly published stream, you must specify the publisher's peer ID:

           var receiveStream:NetStream = new NetStream(netConnection, id_of_publishing_client);

           receiveStream.play("media");

     

    그러므로 peer ID를 교환하는 일종의 서비스 제공이 필요합니다. XMPP를 이용하거나, peer ID를 교환하는 웹서비스를 이용할 수 도 있습니다. 이 작업을 하기위해 FMS는 원격함수호출(Remote Procedure Call, RPC)와  원격공유객체(Remote Shared Object)를 제공합니다. 다음 예제는 원격함수호출을 이용해 peer ID를 교환하는 방법을 보여줍니다.

    Therefore, your application needs to provide some kind of service to exchange peer IDs. You can use XMPP or a web service to exchange peer IDs. FMS offers remote procedure calls or remote shared objects to perform this task. The following example demonstrates how to exchange peer IDs using remote method invocation.

     

    Here is the FMS Server-Side ActionScript (SSAS):

     

    application.onConnect = function(client, userName)

    {

      client.userName = userName;

     

      // server-side functions

      client.getRemoteId = getRemoteId;

     

      application.acceptConnection(client);

     

      return true;

    }

     

    function findUser(userName)

    {

      for (var i = 0; i <= application.clients.length; i++)

      {

        if (application.clients[i].userName == userName)

        {

          return i;

        }

      }

      return -1;

    }

     

    function getRemoteId(userName)

    {

      var result = new Object;

      result.userName = userName;

      result.id = "";

      result.protocol = "";

     

      var index = findUser(userName);

      if (-1 != index)

      {

        result.id = application.clients[index].farID;

        result.protocol = application.clients[index].protocol;

      }

      return result;

    }

     

    Here is the Flash Player code to register and look up the peer ID:

     

                        private var netConnection:NetConection = null;

                       

                        private function connect():void

                        {

                               netConnection = new NetConnection();

                               netConnection.connect("rtmfp://example.com/app", "user");

                        }

                       

                        private function lookup(remoteUser:String):void

                        {

                               var responder:Responder = new Responder(userResult);

                               netConnection.call("getRemoteId", responder, remoteUser);

                        }

                       

                        private function userResult(result:Object):void

                        {

                               // process respons

                               // result.id;

                               // result.userName;

                               // result.protocol;

                        } 

     

     

     

    Sample video meeting application

    rtmfp_app_assets.zip

     

    이 글에 논의된 사항들을 나타낸 샘플App을 개발했습니다.

    I have developed a sample application demonstrating the following items discussed in this article:

     

    • 서버로의 최선의 연결사용. RTMFP가 선호됐습니다.(RTMFP 접속불가시 RTMP 사용) (Use the best connection method to the server. RTMFP is preferred, with fall-back to RTMP if RTMFP is not possible)
    • 서버에 유저 등록, 유져 lookup에 대한 원격메소드호출 사용 (Register users at the server, using remote method invocation for user lookup)
    • 3명 혹은 더 적은 참석인원일때 직접연결을 시도함. 직접연결 실패시 C-S구조로 Data를 보냄. (Try to establish direct communications when there are three or fewer participants. If direct connection fails, use client-server data delivery)
    • 참석자가 3명이상일 경우, C-S구조로 토폴로지를 바꿈. 참석자가 나가면 다시 직접통신으로 바꿈. (If there are more than three participants, switch topology to client-server. When a participant leaves, switch back to direct media delivery)
    • 예를들어 UDP가 차단되어 RTMP만 사용가능 할 때 C-S 토폴로지를 사용 (If a communicating endpoint can only use RTMP for example, when UDP is blocked, use client-server conferencing topology)

     

    이 어플리케이션은 Flash Builder 4로 개발되엇습니다. 최소한 Flash Player 10버전이 필요합니다. Flash Player9버전에는 완벽하게 동작하지 않습니다. FMS4버진이 필요합니다. 응답시간을 최소화 하기 위해서는, Aggregate Messages and Queuing (by disabling AggregateMessages in Vhost.xml, Queue and AggregateMessages in Application.xml); see also Send aggregate messages in the Flash Media Server online documentation.

    The application was developed using Flash Builder 4. The minimum requirement is Flash Player 10; it does not handle Flash Player 9 gracefully (an update is required using Express Install). The application requires Flash Media Server 4. In order to minimize latency for real-time collaboration applications, disable Aggregate Messages and Queuing (by disabling AggregateMessages in Vhost.xml, Queue and AggregateMessages in Application.xml); see also Send aggregate messages in the Flash Media Server online documentation.

     

    예제파일은 다음 파일들을 포함합니다.

    The following files are included:

     

    • main.asc: Server-side code to manage meetings and send notifications and participant list when a user joins or leaves a meeting.
    • VideoMeeting.mxml: Main application component, including user interface.
    • ConnectionManager.as: Component handling the connection to FMS, with failover.
    • SessionManager.as: Component handling participants and media; uses direct connection when possible with failover to client-server topology. Also includes outgoing NetStream object.
    • LoginWindow.mxml: Login window component to provide FMS service information.
    • Participant.as: Participant properties, including incoming NetStream object and corresponding Video display object.
    • ParticipantListRenderer.mxml: Rendition of each participant in the main window user list.
    • ParticipantEvent.as: Notification event when a participant joins or leaves the meeting.
    • MessageEvent.as: Notification of incoming text messages.
    • Settings.as: Application configuration properties (such as selected devices).
    • Logger.as: Miscellaneous logging component.

     

    *source : http://www.adobe.com/devnet/adobe-media-server/articles/real-time-collaboration.html

    *참고가 되는 글 :  Adobe Labs - http://labs.adobe.com/technologies/cirrus/

                             포풍초보님의 글 (서버없는 통신 Cirrus) - http://cafe.naver.com/shiftouch/464052

     

    'Media > WOWZA' 카테고리의 다른 글

    [FMS] 비디오 파일 스트리밍 대략적인 흐름  (0) 2012.10.26
    [FMS] Responder, NetConnection.call()  (0) 2012.10.04
    [FMS] RTMP, RTMFP  (0) 2012.09.13
    [FMS] SSAS application.onConnect()  (0) 2012.08.23
    [FMS] Buying guide  (0) 2012.08.23
    AND

     

    SharedObject 클래스는 사용자의 컴퓨터 또는 서버에서 제한된 양의 데이터를 읽고 저장하는 데 사용됩니다. 공유 객체는 로컬 컴퓨터 또는 원격 서버에 영구적으로 저장되는 여러 클라이언트 SWF 파일과 객체 사이의 실시간 데이터 공유를 제공합니다. 로컬 공유 객체는 브라우저 쿠키와 비슷하며, 원격 공유 객체는 실시간 데이터 전송 장치와 비슷합니다. 원격 공유 객체를 사용하려면 Adobe Flash Media Server가 필요합니다.

    The SharedObject class is used to read and store limited amounts of data on a user's computer or on a server. Shared objects offer real-time data sharing between multiple client SWF files and objects that are persistent on the local computer or remote server. Local shared objects are similar to browser cookies and remote shared objects are similar to real-time data transfer devices. To use remote shared objects, you need Adobe Flash Media Server.

     

    다음과 같은 경우 공유 객체를 사용하십시오.

    Use shared objects to do the following:

     

  • 로컬 지속성을 유지합니다. 이것은 공유 객체를 사용하는 가장 간단한 방법이며 Flash Media Server가 필요하지 않습니다. 예를 들어 SharedObject.getLocal()을 호출하여 응용 프로그램에서 공유 객체(예: 메모리 있는 계산기)를 만들 수 있습니다. 사용자가 계산기를 닫으면 Flash Player는 마지막 값을 사용자 컴퓨터의 공유 객체에 저장합니다. 다음에 계산기가 실행되면 이전의 값을 포함하고 있습니다. 또는 계산기 응용 프로그램을 닫기 전에 공유 객체의 속성을 null로 설정했다면, 다음에 이 응용 프로그램을 실행할 때 값을 지니지 않은 상태로 열립니다. 로컬 지속성을 유지하는 또 다른 예는 복잡한 웹 사이트에서 사용자 환경 설정이나 기타 데이터(예: 사용자가 뉴스 사이트에서 읽은 기사 레코드)를 추적하는 것입니다. 이 정보를 추적하면 이미 읽은 기사를 읽지 않은 새 기사와 다르게 표시할 수 있습니다. 사용자의 컴퓨터에 이 정보를 저장하면 서버 로드가 줄어듭니다.
  • Maintain local persistence. This is the simplest way to use a shared object, and does not require Flash Media Server. For example, you can call SharedObject.getLocal() to create a shared object in an application, such as a calculator with memory. When the user closes the calculator, Flash Player saves the last value in a shared object on the user's computer. The next time the calculator is run, it contains the values it had previously. Alternatively, if you set the shared object's properties to null before the calculator application is closed, the next time the application runs, it opens without any values. Another example of maintaining local persistence is tracking user preferences or other data for a complex website, such as a record of which articles a user read on a news site. Tracking this information allows you to display articles that have already been read differently from new, unread articles. Storing this information on the user's computer reduces server load.
  •  

  • Flash Media Server에 데이터를 저장 및 공유합니다. 공유 객체는 다른 클라이언트가 검색할 수 있도록 서버에 데이터를 저장할 수 있습니다. 예를 들어 SharedObject.getRemote()를 호출해서 전화번호부처럼 서버에 지속적으로 남아 있는 원격 공유 객체를 생성합니다. 클라이언트가 공유 객체를 변경할 때마다 현재 객체에 연결되어 있거나 나중에 이 객체에 연결하는 모든 클라이언트가 변경된 데이터를 사용할 수 있습니다. 객체가 로컬에서도 영구적이며 클라이언트가 서버에 연결되어 있지 않은 동안 데이터를 변경할 경우, 데이터는 클라이언트가 다음 번에 객체에 연결할 때 원격 공유 객체로 복사됩니다.
  • Store and share data on Flash Media Server. A shared object can store data on the server for other clients to retrieve. For example, call SharedObject.getRemote() to create a remote shared object, such as a phone list, that is persistent on the server. Whenever a client makes changes to the shared object, the revised data is available to all clients currently connected to the object or who later connect to it. If the object is also persistent locally, and a client changes data while not connected to the server, the data is copied to the remote shared object the next time the client connects to the object.
  •  

  • 실시간으로 데이터를 공유합니다. 공유 객체는 여러 클라이언트 간에 실시간으로 데이터를 공유할 수 있습니다. 예를 들어 채팅룸에 연결된 사용자 목록을 저장하고 있는 원격 공유 객체를 열 수 있으며 이 객체에 연결된 모든 클라이언트는 그 목록을 볼 수 있게 됩니다. 어떤 사용자가 채팅룸에 입장하거나 떠나면 그 객체는 업데이트되며 객체에 연결된 모든 클라이언트에 수정된 채팅룸 사용자 목록이 표시됩니다.
  • Share data in real time. A shared object can share data among multiple clients in real time. For example, you can open a remote shared object that stores a list of users connected to a chat room that is visible to all clients connected to the object. When a user enters or leaves the chat room, the object is updated and all clients that are connected to the object see the revised list of chat room users.
  •  

    로컬 공유 객체를 생성하려면 SharedObject.getLocal()를 호출합니다. 원격 공유 객체를 생성하려면 SharedObject.getRemote()를 호출합니다.

    To create a local shared object, call SharedObject.getLocal(). To create a remote shared object, call SharedObject.getRemote().

     

    응용 프로그램을 종료하면 공유 객체는 플러시, 즉 디스크에 쓰여집니다. 또한 flush() 메서드를 호출하여 데이터를 명시적으로 디스크에 쓸 수 있습니다.

    When an application closes, shared objects are flushed, or written to a disk. You can also call the flush() method to explicitly write data to a disk.

     

    로컬 디스크 공간을 고려해야 합니다. 로컬 공유 객체는 응용 프로그램을 설계할 때 중요하게 고려해야 할 몇 가지 한계가 있습니다. 간혹 SWF 파일에서 로컬 공유 객체에 쓸 수 없거나, 사용자가 모르는 상태에서 로컬 공유 객체에 저장된 데이터가 삭제될 수 있습니다. Flash Player 사용자는 개별 도메인 또는 모든 도메인에 대해 사용 가능한 디스크 공간을 관리할 수 있습니다. 사용자가 사용 가능한 디스크 공간을 줄이면 일부 로컬 공유 객체가 삭제될 수 있습니다. 또한 Flash Player 사용자에게는 제3의 도메인(현재 브라우저 주소 막대에 있는 도메인 이외의 도메인)이 로컬 공유 객체를 읽거나 쓰는 것을 방지하는 개인 정보 제어 기능이 제공됩니다. Mac OS에서는 AIR 3.3부터 로컬 공유 객체의 위치가 변경되었으므로 3.3 네임스페이스로 업그레이드할 경우 객체가 손실된 것처럼 나타날 수 있습니다.

    Local disk space considerations. Local shared objects have some limitations that are important to consider as you design your application. Sometimes SWF files may not be allowed to write local shared objects, and sometimes the data stored in local shared objects can be deleted without your knowledge. Flash Player users can manage the disk space that is available to individual domains or to all domains. When users decrease the amount of disk space available, some local shared objects may be deleted. Flash Player users also have privacy controls that can prevent third-party domains (domains other than the domain in the current browser address bar) from reading or writing local shared objects. Also note that on Mac OS, starting with AIR 3.3, the location for local shared objects changed, so if you upgrade to the 3.3 namespace, it may appear as if the objects were lost.

     

    참고: 원격 서버가 아니라 로컬 컴퓨터에 저장되어 실행되는 SWF 파일은 항상 타사 공유 객체를 디스크에 쓸 수 있습니다. 타사 공유 객체에 대한 자세한 내용은 Flash Player 도움말에서 전역 저장 설정 패널을 참조하십시오.

    Note: SWF files that are stored and run on a local computer, not from a remote server, can always write third-party shared objects to disk. For more information about third-party shared objects, see the Global Storage Settings panel in Flash Player Help.

     

    사용할 수 있는 디스크 공간의 양 및 사용자 개인정보보호를 위한 통제와 관련된 실패가 없는지 확인하는 것이 좋습니다. getLocal()flush()를 호출할 때 이러한 사항을 확인합니다.

    Note: SWF files that are stored and run on a local computer, not from a remote server, can always write third-party shared objects to disk. For more information about third-party shared objects, see the Global Storage Settings panel in Flash Player Help.

     

  • SharedObject.getLocal() - 사용자가 타사 공유 객체를 비활성화하고 SWF 파일의 도메인이 브라우저 주소 표시줄의 도메인과 일치하지 않는 경우처럼 이 메서드 호출에 실패하면 Flash Player에서는 예외가 발생합니다.
  • SharedObject.getLocal() — Flash Player throws an exception when a call to this method fails, such as when the user has disabled third-party shared objects and the domain of your SWF file does not match the domain in the browser address bar.
  • SharedObject.flush() - 이 메서드 호출에 실패하면 Flash Player에서는 예외가 발생합니다. 성공하면 SharedObjectFlushStatus.FLUSHED를 반환합니다. 추가 저장 공간이 필요하면 SharedObjectFlushStatus.PENDING을 반환합니다. Flash Player는 로컬에 저장된 정보를 위한 저장 공간 증가를 허용할 것인지 사용자에게 묻습니다. 그런 다음 플러시 실패 또는 성공을 나타내는 정보 객체와 함께 netStatus 이벤트가 전달됩니다.
  • SharedObject.flush() — Flash Player throws an exception when a call to this method fails. It returns SharedObjectFlushStatus.FLUSHED when it succeeds. It returns SharedObjectFlushStatus.PENDING when additional storage space is needed. Flash Player prompts the user to allow an increase in storage space for locally saved information. Thereafter, the netStatus event is dispatched with an information object indicating whether the flush failed or succeeded.
  •  

    SWF 파일이 로컬 공유 객체를 만들거나 수정하려 할 경우, SWF 파일의 크기는 사용자의 로컬 공유 객체 저장 제한을 늘리라는 메시지가 포함된 대화 상자를 표시하는 최소 크기인 폭 215픽셀, 높이 138픽셀 이상이어야 합니다. SWF 파일이 이 크기보다 작고 저장 제한을 늘려야 하는 경우, SharedObject.flush()가 실패하며 SharedObjectFlushedStatus.PENDING을 반환하고 netStatus 이벤트를 전달합니다.

    If your SWF file attempts to create or modify local shared objects, make sure that your SWF file is at least 215 pixels wide and at least 138 pixels high (the minimum dimensions for displaying the dialog box that prompts users to increase their local shared object storage limit). If your SWF file is smaller than these dimensions and an increase in the storage limit is required, SharedObject.flush() fails, returning SharedObjectFlushedStatus.PENDING and dispatching the netStatus event.

     

    원격 공유 객체 Flash Media Server가 있으면 원격 공유 객체를 생성 및 사용할 수 있으며 이러한 객체는 응용 프로그램에 연결된 모든 클라이언트와 실시간으로 공유됩니다. 한 클라이언트가 원격 공유 객체의 속성을 변경하면 그 내역이 연결된 모든 클라이언트에 적용됩니다. 예를 들어 원격 공유 객체를 사용하면 멀티 플레이 게임의 사용자와 같은 클라이언트들을 동기화할 수 있습니다.

    Remote shared objects. With Flash Media Server, you can create and use remote shared objects, that are shared in real-time by all clients connected to your application. When one client changes a property of a remote shared object, the property is changed for all connected clients. You can use remote shared objects to synchronize clients, for example, users in a multi-player game.

     

    각 원격 공유 객체는 data 속성을 지니며, 이것은 데이터를 저장하는 속성을 지닌 Object입니다. 이 데이터 객체의 속성을 변경하려면 setProperty()를 호출합니다. 서버에서는 속성을 업데이트하고 sync 이벤트를 전달하며 다시 연결된 클라이언트에게 속성을 전송합니다.

    Each remote shared object has a data property which is an Object with properties that store data. Call setProperty() to change an property of the data object. The server updates the properties, dispatches a sync event, and sends the properties back to the connected clients.

     

    클라이언트, 서버 또는 양쪽 모두를 선택해서 영구적인 원격 공유 객체를 만들 수도 있습니다. 기본적으로 Flash Player는 로컬에 영구적인 원격 공유 객체를 최대 100K까지 저장합니다. 더 큰 객체를 저장하고자 할 경우 Flash Player는 로컬 저장 대화 상자를 표시하고 이 대화 상자를 사용해 사용자가 공유 객체의 로컬 저장을 허용 또는 거부할 수 있습니다. 스테이지 크기가 215 x 138 픽셀 이상이 되도록 하십시오. 이것은 Flash가 대화 상자를 표시하는 데 필요한 최소 크기입니다.

    You can choose to make remote shared objects persistent on the client, the server, or both. By default, Flash Player saves locally persistent remote shared objects up to 100K in size. When you try to save a larger object, Flash Player displays the Local Storage dialog box, which lets the user allow or deny local storage for the shared object. Make sure your Stage size is at least 215 by 138 pixels; this is the minimum size Flash requires to display the dialog box.

     

    사용자가 [허용]을 선택하면 서버가 해당 공유 객체를 저장해서 netStatus 이벤트를 SharedObject.Flush.Successcode 속성과 함께 전달합니다. 사용자가 [거부]를 선택하면 서버는 해당 공유 객체를 저장하지 않고 netStatus 이벤트를 SharedObject.Flush.Failedcode 속성과 함께 전달합니다.

    If the user selects Allow, the server saves the shared object and dispatches a netStatus event with a code property of SharedObject.Flush.Success. If the user select Deny, the server does not save the shared object and dispatches a netStatus event with a code property of SharedObject.Flush.Failed.

     

    *source : http://help.adobe.com/ko_KR/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html (Korean)

                  http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html (English)

     

     

     

     

    'Adobe Platform > Flex' 카테고리의 다른 글

    History of ActionScript OOP support  (0) 2012.10.04
    mms.cfg(Macromedia Security Configuration)  (0) 2012.09.28
    DispatchEvent Example  (0) 2012.09.25
    NetStreamInfo Class  (0) 2012.09.17
    Capabilities Class  (0) 2012.09.17
    AND

    다음예제는 EventDispatcher클래스를 상속받은 클래스객체를 하나 생성하고 그 객체에 이벤트에 대한 리스너를 달고, 그 이벤트를 디스패치 시키면 리스너가 동작 하는가를 테스트 하는 예제입니다. 먼저 Listen Event버튼을 클릭 후, Dispach Event를 클릭하시면, success 메소드가 실행될 것 입니다. 리스닝을 하기전에 디스패치를 해버리면 아무 반응이 없습니다. 당연히 듣는이가 아무도 없으니, 불러봐야 응답이 없는 것은 당연할지도~

     

    *source :EventDispatcherTest.fxp

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx"

                           backgroundColor="#aaaaaa">

           <fx:Script>

                 <![CDATA[

                        import mx.controls.Alert;

                        private var testEvent:EventDispatcherChild = new EventDispatcherChild();

                       

                        private function listenMyEvent():void

                        {

                               testEvent.addEventListener("Kevin", success);

                        }

                       

                        private function dispatchMyEvent():void

                        {

                               testEvent.dispatchMyEvent();                        

                        }

                       

                       

                        private function success(e:Event):void

                        {

                               Alert.show(e.type);

                        }

                 ]]>

           </fx:Script>

          

           <s:HGroup>

                 <s:Button label="Listen Event" click="listenMyEvent();" />

                 <s:Button label="Dispath Event" click="dispatchMyEvent();" />

           </s:HGroup>

    </s:Application>

     

     

    package

    {

           import flash.events.Event;

           import flash.events.EventDispatcher;

          

           public class EventDispatcherChild extends EventDispatcher

           {

                 public function dispatchMyEvent():void

                 {

                        dispatchEvent(new Event("Kevin"));

                 }

           }

    }

    'Adobe Platform > Flex' 카테고리의 다른 글

    mms.cfg(Macromedia Security Configuration)  (0) 2012.09.28
    SharedObject Reference  (0) 2012.09.25
    NetStreamInfo Class  (0) 2012.09.17
    Capabilities Class  (0) 2012.09.17
    ActionScript Reference  (0) 2012.09.17
    AND

     

    NetStreamInfo 클래스는 NetStream 객체와 관련된 여러 서비스 품질(QOS) 통계 및 기타 정보와 오디오, 비디오 및 데이터에 대한 기본 스트리밍 버퍼를 지정합니다. 현재 QOS 상태의 스냅샷을 취하고 NetStreamInfo 속성을 통해 QOS 통계를 제공하는 NetStream.info 호출에 응답하여 NetStreamInfo 객체가 반환됩니다.

    The NetStreamInfo class specifies the various Quality of Service (QOS) statistics and other information related to a NetStream object and the underlying streaming buffer for audio, video, and data. A NetStreamInfo object is returned in response to the NetStream.info call, which takes a snapshot of the current QOS state and provides the QOS statistics through the NetStreamInfo properties.

     

     audioBufferByteLength

     NetStream 오디오 버퍼 크기(바이트)를 제공합니다.

     Provides the NetStream audio buffer size in bytes.

     audioBufferLength

     NetStream 오디오 버퍼 크기(초)를 제공합니다. 

     Provides NetStream audio buffer size in seconds.

     audioByteCount

     재생 또는 플러시된 바이트 수에 관계없이 대기열에 도달한 총 음성 바이트 수를 지정합니다. 

     Specifies the total number of audio bytes that have arrived in the queue, regardless of how many have been played or flushed.

     audioBytesPerSecond

     NetStream 오디오 버퍼가 채워지는 속도를 초당 바이트 수로 지정합니다. 

     Specifies the rate at which the NetStream audio buffer is filled in bytes per second.

     audioLossRate

     NetStream 세션의 오디오 손실을 지정합니다. 

     Specifies the audio loss for the NetStream session.

     byteCount

     재생 또는 플러시된 바이트 수에 관계없이 대기열에 도달한 총 바이트 수를 지정합니다. 

     Specifies the total number of bytes that have arrived into the queue, regardless of how many have been played or flushed.

     currentBytesPerSecond

     NetStream 버퍼가 채워지는 속도를 초당 바이트 수로 지정합니다. 

     Specifies the rate at which the NetStream buffer is filled in bytes per second.

     dataBufferByteLength

     NetStream 데이터 버퍼 크기(바이트)를 제공합니다. 

     Provides the NetStream data buffer size in bytes.

     dataBufferLength

     NetStream 데이터 버퍼 크기(초)를 제공합니다.

     Provides NetStream data buffer size in seconds.

     dataByteCount

     재생 또는 플러시된 바이트 수에 관계없이 대기열에 도달한 데이터 메시지의 총 바이트 수를 지정합니다. 

     Specifies the total number of bytes of data messages that have arrived in the queue, regardless of how many have been played or flushed.

     dataBytesPerSecond

     NetStream 데이터 버퍼가 채워지는 속도를 초당 바이트 수로 지정합니다. 

     Specifies the rate at which the NetStream data buffer is filled in bytes per second.

     droppedFrames

     현재 NetStream 재생 세션에서 삭제된 비디오 프레임 수를 반환합니다. 

     Returns the number of video frames dropped in the current NetStream playback session.

     maxBytesPerSecond

     NetStream 버퍼가 채워지는 최대 속도를 초당 바이트 수로 지정합니다. 

     Specifies the maximum rate at which the NetStream buffer is filled in bytes per second.

     playbackBytesPerSecond

     스트림 재생 속도(초당 바이트)를 반환합니다. 

     Returns the stream playback rate in bytes per second.

     SRTT(Smoothed Round Trip Time)

     NetStream 세션에 대한 매끄러운 라운드 트립 시간(SRTT)(밀리초 단위)입니다. 

     The smoothed round trip time (SRTT) for the NetStream session, in milliseconds.

     videoBufferByteLength

     NetStream 비디오 버퍼 크기(바이트)를 제공합니다. 

     Provides the NetStream video buffer size in bytes.

     videoBufferLength

     NetStream 비디오 버퍼 크기(초)를 제공합니다. 

     Provides NetStream video buffer size in seconds.

     videoByteCount

     재생 또는 플러시된 바이트 수에 관계없이 대기열에 도달한 총 비디오 바이트 수를 지정합니다. 

     Specifies the total number of video bytes that have arrived in the queue, regardless of how many have been played or flushed.

     videoBytesPerSecond

     NetStream 비디오 버퍼가 채워지는 속도를 초당 바이트 수로 지정합니다. 

     Specifies the rate at which the NetStream video buffer is filled in bytes per second.

     videoLossRate

     NetStream 비디오 손실률(전체 메시지에 대한 손실 메시지 비율)을 제공합니다. 

     Provides the NetStream video loss rate (ratio of lost messages to total messages).

    *source : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStreamInfo.html

    'Adobe Platform > Flex' 카테고리의 다른 글

    SharedObject Reference  (0) 2012.09.25
    DispatchEvent Example  (0) 2012.09.25
    Capabilities Class  (0) 2012.09.17
    ActionScript Reference  (0) 2012.09.17
    Custom Event Dispatch  (0) 2012.09.14
    AND

     

     avHardwareDisable

      사용자의 카메라와 마이크에 대한 액세스가 금지되었는지(true) 또는 허용되었는지(false)를 지정합니다. 서버 문자열은 AVD입니다.

      Adobe AIR™에 있는 내용의 경우 이 속성은 응용 프로그램 보안 샌드박스가 아닌 보안 샌드박스의 내용에만 적용됩니다. 응용 프로그램 보안 샌드박스의 내용은 항상 사용자의 카메라 및 마이크에 액세스할 수 있습니다.

     Specifies whether access to the user's camera and microphone has been administratively prohibited (true) or allowed (false).

     cpuArchitecture

     현재 CPU 아키텍처를 지정합니다. cpuArchitecture 속성은 "PowerPC", "x86", "SPARC" 및 "ARM" 문자열을 반환할 수 있습니다. 서버 문자열은 ARCH입니다. 
     Specifies the current CPU architecture.

     hasAccessibility

     시스템에서 액세스 가능성 도구와의 통신을 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 ACC입니다.

     Specifies whether the system supports (true) or does not support (false) communication with accessibility aids.

     hasAudio

     시스템에 오디오 기능이 있는지 여부를 지정합니다. 이 속성은 항상 true입니다. 서버 문자열은 A입니다.

     Specifies whether the system has audio capabilities.

     hasAudioEncoder

     시스템에서 마이크 입력 등의 오디오 스트림을 인코딩할 수 있는지(true) 또는 인코딩할 수 없는지(false) 여부를 지정합니다. 서버 문자열은 AE입니다. 

     Specifies whether the system can (true) or cannot (false) encode an audio stream, such as that coming from a microphone.

     hasEmbeddedVideo

     시스템에서 포함된 비디오를 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 EV입니다.

     Specifies whether the system supports (true) or does not support (false) embedded video.

     hasIME

     시스템에 IME가 설치되어 있는지(true) 또는 설치되어 있지 않은지(false) 여부를 지정합니다. 서버 문자열은 IME입니다.

     Specifies whether the system does (true) or does not (false) have an input method editor (IME) installed.

     hasMP3

     시스템에 MP3 디코더가 있는지(true) 또는 없는지(false) 여부를 지정합니다. 서버 문자열은 MP3입니다.

     Specifies whether the system does (true) or does not (false) have an MP3 decoder.

     hasPrinting

     시스템에서 인쇄를 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 PR입니다.

     Specifies whether the system does (true) or does not (false) support printing.

     hasScreenBroadcast

     시스템에서 Flash Media Server를 통해 실행되는 스크린 브로드캐스트 응용 프로그램 개발을 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 SB입니다. 
     Specifies whether the system does (true) or does not (false) support the development of screen broadcast applications to be run through Flash Media Server.

     hasScreenPlayback

      시스템에서 Flash Media Server를 통해 실행되는 스크린 브로드캐스트 응용 프로그램의 재생을 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 SP입니다.

     Specifies whether the system does (true) or does not (false) support the playback of screen broadcast applications that are being run through Flash Media Server.

     hasStreamingAudio

     시스템에서 스트리밍 오디오를 재생할 수 있는지(true) 또는 재생할 수 없는지(false) 여부를 지정합니다. 서버 문자열은 SA입니다.

     Specifies whether the system can (true) or cannot (false) play streaming audio.

     hasStreamingVideo

     시스템에서 스트리밍 비디오를 재생할 수 있는지(true) 또는 재생할 수 없는지(false) 여부를 지정합니다. 서버 문자열은 SV입니다.

     Specifies whether the system can (true) or cannot (false) play streaming video.

     hasTLS

     시스템에서 NetConnection을 통한 기본 SSL 소켓을 지원하는지(true) 또는 지원하지 않는지(false) 여부를 지정합니다. 서버 문자열은 TLS입니다. 
     Specifies whether the system supports native SSL sockets through NetConnection (true) or does not (false).

     hasVideoEncoder

     시스템에서 웹 카메라 입력 등의 비디오 스트림을 인코딩할 수 있는지(true) 또는 인코딩할 수 없는지(false) 여부를 지정합니다. 서버 문자열은 VE입니다. 
     Specifies whether the system can (true) or cannot (false) encode a video stream, such as that coming from a web camera.

     isDebugger

     시스템이 특수 디버깅 버전인지(true) 또는 정식으로 출시된 버전인지(false) 여부를 지정합니다. 서버 문자열은 DEB입니다. Flash Player의 디버그 버전 또는 ADL(AIR Debug Launcher)에서 실행할 경우 이 속성은 true로 설정됩니다. 
     Specifies whether the system is a special debugging version (true) or an officially released version (false).

     isEmbeddedInAcrobat

     Flash 런타임이 Acrobat 9.0 이상에서 열리는 PDF 파일에 포함되어 있는지(true) 아니면 포함되어 있지 않은지(false)를 지정합니다.

     Specifies whether the Flash runtime is embedded in a PDF file that is open in Acrobat 9.0 or higher (true) or not (false).

     language

     내용이 실행되는 시스템의 언어 코드를 지정합니다. 언어는 ISO 639-1에 소문자로 지정된 두 글자 언어 코드로 지정됩니다. 중국어의 경우 ISO 3166의 대문자로 된 두 글자 국가 코드가 추가되어 중국어 간체와 번체가 구별됩니다. 언어 코드는 해당 언어의 영어 이름에 기초합니다. 예를 들어 헝가리어는 hu로 지정됩니다.

    영어 시스템에서 이 속성은 국가 코드가 아닌 언어 코드(en)만 반환합니다. Microsoft Windows 시스템에서 이 속성은 모든 메뉴, 대화 상자, 오류 메시지 및 도움말 파일에 사용되는 언어를 참조하는 UI(사용자 인터페이스) 언어를 반환합니다. 다음 표에는 가능한 값이 나열되어 있습니다.

        참고: Capabilities.language 속성에는 이 목록의 값만 사용할 수 있습니다. 이러한 제한 사항으로 인해 Adobe AIR 응용 프로그램에서는 Capabilities.languages 배열의 첫 번째 요소를 사용하여 시스템의 기본 사용자 인터페이스 언어를 확인해야 합니다.

    서버 문자열은 L입니다. 

     Specifies the language code of the system on which the content is running.

     localFileReadDisable

     사용자의 하드 디스크에 대한 읽기 액세스를 금지되었는지(true) 또는 허용되었는지(false)를 지정합니다. Adobe AIR에 있는 내용의 경우 이 속성은 응용 프로그램 보안 샌드박스가 아닌 보안 샌드박스의 내용에만 적용됩니다. 응용 프로그램 보안 샌드박스의 내용은 항상 파일 시스템에서 읽습니다. 이 속성이 true이면 Flash Player에서 Flash Player가 시작된 첫 번째 파일을 포함하여 사용자 하드 디스크의 파일을 읽을 수 없습니다. 이 속성이 true이면 응용 프로그램 보안 샌드박스 외부의 AIR 내용은 사용자 하드 디스크의 파일을 읽을 수 없습니다. 예를 들어 이 속성이 true로 설정되어 있으면 load 메서드를 통해 사용자의 하드 디스크에 있는 파일을 읽으려는 시도가 실패합니다.

     이 속성이 true로 설정되면 런타임 공유 라이브러리 읽기도 차단되지만 로컬 공유 객체는 이 속성 값에 관계없이 읽을 수 있습니다.

    서버 문자열은 LFD입니다.

     Specifies whether read access to the user's hard disk has been administratively prohibited (true) or allowed (false).

     manufacturer

     실행 중인 버전의 Flash Player 또는 AIR 런타임 제조업체를 "Adobe OSName" 형식으로 지정합니다. OSName 값은 "Windows", "Macintosh", "Linux" 또는 기타 운영 체제 이름이 될 수 있습니다. 서버 문자열은 M입니다.

    보다 구체적인 capability 속성이 존재하는 경우 운영 체제에 기반한 기능을 확인하기 위해 Capabilities.manufacturer를 사용하지 마십시오. 기능이 운영 체제에 기반하도록 하면 응용 프로그램이 모든 잠재적 대상 운영 체제를 고려하지 않는 경우 문제가 발생할 수 있으므로 좋지 않습니다. 대신, 테스트하는 기능에 해당하는 속성을 사용하십시오. 자세한 내용은 Capabilities 클래스 설명을 참조하십시오.

     Specifies the manufacturer of the running version of Flash Player or the AIR runtime, in the format "Adobe OSName".

     maxLevelIDC

     클라이언트 하드웨어가 지원하는 최상의 H.264 수준 IDC를 검색합니다. 이 수준에서 미디어를 실행하면 항상 실행되지만 최상의 수준에서 미디어를 실행하면 최상의 품질로 실행되지 않을 수도 있습니다. 이 속성은 클라이언트의 기능을 대상으로 지정하는 서버에 유용합니다. 이 속성을 사용하면 서버에서 클라이언트에 보낼 비디오의 수준을 결정할 수 있습니다.

    서버 문자열은 ML입니다. 

     Retrieves the highest H.264 Level IDC that the client hardware supports.

     os

     현재 운영 체제를 지정합니다.

     Specifies the current operating system.

     pixelAspectRatio

     스크린의 픽셀 종횡비를 지정합니다. 서버 문자열은 AR입니다.

     Specifies the pixel aspect ratio of the screen.

     playerType

     런타임 환경의 유형을 지정합니다. 이 속성은 다음 값 중 하나를 가질 수 있습니다. "ActiveX": Microsoft Internet Explorer에서 사용하는 Flash Player ActiveX 컨트롤의 경우

    • "Desktop": Adobe AIR 런타임의 경우(Capabilities.playerType"PlugIn"으로 설정된 HTML 페이지에서 로드한 SWF 내용 제외)
    • "External": 외부 Flash Player용 또는 테스트 모드의 경우
    • "PlugIn": Flash Player 브라우저 플러그인 및 AIR 응용 프로그램의 HTML 페이지에서 로드한 SWF 내용의 경우
    • "StandAlone": 독립 실행형 Flash Player의 경우

    서버 문자열은 PT입니다.

     Specifies the type of runtime environment.

     screenColor

     스크린 색상을 지정합니다. 이 속성의 값은 "color", "gray"(회색조) 또는 "bw"(흑백)일 수 있습니다. 서버 문자열은 COL입니다.

     Specifies the screen color.

     screenDPI

     스크린의 dpi(인치당 도트 수) 해상도를 픽셀 단위로 지정합니다. 서버 문자열은 DP입니다.

     Specifies the dots-per-inch (dpi) resolution of the screen, in pixels.

     screenResolutionX

     스크린의 최대 수평 해상도를 지정합니다. 서버 문자열은 화면의 폭과 높이를 모두 반환하는 R입니다. 이 속성은 사용자의 화면 해상도로 업데이트되지 않고 대신 Flash Player 또는 Adobe AIR 응용 프로그램이 시작했을 때의 해상도만 표시합니다. 또한 이 값은 기본 스크린만 지정합니다. 
     Specifies the maximum horizontal resolution of the screen.

     screenResolutionY

      스크린의 최대 수직 해상도를 지정합니다. 서버 문자열은 화면의 폭과 높이를 모두 반환하는 R입니다. 이 속성은 사용자의 화면 해상도로 업데이트되지 않고 대신 Flash Player 또는 Adobe AIR 응용 프로그램이 시작했을 때의 해상도만 표시합니다. 또한 이 값은 기본 스크린만 지정합니다.

     Specifies the maximum vertical resolution of the screen.

     serverString

     각 Capabilities 속성의 값을 지정하는 URL 인코딩 문자열입니다.

     A URL-encoded string that specifies values for each Capabilities property.

     supports32BitProcesses

     시스템이 32비트 프로세스 실행을 지원하는지 여부를 지정합니다. 서버 문자열은 PR32입니다.

     Specifies whether the system supports running 32-bit processes.

     supports64BitProcesses

     시스템이 64비트 프로세스 실행을 지원하는지 여부를 지정합니다. 서버 문자열은 PR64입니다.

     Specifies whether the system supports running 64-bit processes.

     touchscreenType

     지원되는 터치 스크린이 있는 경우 터치 스크린의 유형을 지정합니다. 값이 flash.system.TouchscreenType 클래스에 정의됩니다.

     Specifies the type of touchscreen supported, if any.

     version

     Flash Player 또는 Adobe® AIR® 플랫폼 및 버전 정보를 지정합니다. 버전 번호의 형식은

     platform  majorVersion,minorVersion,buildNumber,internalBuildNumber입니다. platform에 사용할 수 있는 값은 "WIN", ` "MAC", "LNX"   "AND"입니다.

     Specifies the Flash Player or Adobe® AIR® platform and version information.

    *source : http://help.adobe.com/ko_KR/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html

     

     

    *source code : CapabilitiesExample.fxp

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx"

                           minWidth="955"

                           minHeight="600"

                           backgroundColor="#aaaaaa"

                           >

           <fx:Script>

                 <![CDATA[

                       /*  http://storyjava.tistory.com

                        *  code5381@hotmail.com

                        *  KevinKim

                        */

                        import mx.controls.Alert;

                        private function show():void

                        {

                               Alert.show("Capabilities.avHardwareDisable : " + Capabilities.avHardwareDisable.toString()

                                             + "\n cpuArchitecture : " + Capabilities.cpuArchitecture

                                             + "\n hasAccessibility: " + Capabilities.hasAccessibility.toString()

                                             + "\n hasAudio: " + Capabilities.hasAudio.toString()

                                             + "\n hasAudioEncoder: " + Capabilities.hasAudioEncoder.toString()

                                             + "\n hasEmbeddedVideo: " + Capabilities.hasEmbeddedVideo.toString()

                                             + "\n hasIME: " + Capabilities.hasIME.toString()

                                             + "\n hasMP3: " + Capabilities.hasMP3.toString()

                                             + "\n hasPrinting: " + Capabilities.hasPrinting.toString()

                                             + "\n hasScreenBroadcast: " + Capabilities.hasScreenBroadcast.toString

                                             + "\n hasScreenPlayback: " + Capabilities.hasScreenPlayback.toString()

                                             + "\n hasStreamingAudio: " + Capabilities.hasStreamingAudio.toString()

                                             + "\n hasStreamingVideo: " + Capabilities.hasStreamingVideo.toString()

                                             + "\n hasTLS: " + Capabilities.hasTLS.toString()

                                             + "\n hasVideoEncoder: " + Capabilities.hasVideoEncoder.toString()

                                             + "\n isDebugger: " + Capabilities.isDebugger.toString()

                                             + "\n isEmbeddedInAcrobat: " + Capabilities.isEmbeddedInAcrobat.toString()

                                             + "\n language: " + Capabilities.language

                                             + "\n localFileReadDisable: " + Capabilities.localFileReadDisable.toString()

                                             + "\n manufacturer: " + Capabilities.manufacturer

                                             + "\n maxLevelIDC: " + Capabilities.maxLevelIDC

                                             + "\n os: " + Capabilities.os

                                             + "\n pixelAspectRatio: " + Capabilities.pixelAspectRatio.toString()

                                             + "\n playerType: " + Capabilities.playerType

                                             + "\n playerType: " + Capabilities.screenColor

                                             + "\n screenDPI: " + Capabilities.screenDPI.toString()

                                             + "\n screenDPI: " + Capabilities.screenResolutionX.toString()

                                             + "\n screenResolutionY: " + Capabilities.screenResolutionY.toString()

                                             + "\n serverString: " + Capabilities.serverString

                                             + "\n supports32BitProcesses: " + Capabilities.supports32BitProcesses.toString()

                                             + "\n supports64BitProcesses: " + Capabilities.supports64BitProcesses.toString()

                                             + "\n touchscreenType: " + Capabilities.touchscreenType

                                             + "\n version: " + Capabilities.version

                                            );

                        }

                 ]]>

           </fx:Script>

           <s:Button label="Show System Info" click="show();"/>

    </s:Application>

    'Adobe Platform > Flex' 카테고리의 다른 글

    DispatchEvent Example  (0) 2012.09.25
    NetStreamInfo Class  (0) 2012.09.17
    ActionScript Reference  (0) 2012.09.17
    Custom Event Dispatch  (0) 2012.09.14
    PopUpManager Examples (Simple PopUpManager Example)  (0) 2012.09.14
    AND

    한글 Reference :ACTIONSCRIPT 3.0 프로그래밍.pdf

     

    영문 Reference :ADOBE FLEX3 PROGRAMMING ACTIONSCRIPT3.pdf

    AND

    이 포스팅은 이벤트 디스패처와 커스텀 이벤트에 관한 내용입니다.
    아래 예제는 okgosu의 플렉스4.5 & 플래시빌더 정석의 예제를 참조 하였습니다.

    *source code : CustomEventDispatchExample.fxp

     

    AND

    1. Simple PopUpManager Example1

    *source code : PopUpManagerExample1.fxp

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application name="Spark_TitleWindow_test"

                           xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/halo"

                           creationComplete="init();"

                           backgroundColor="#aaaaaa"

                           width="800"

                           height="800">

           <fx:Script>

                 <![CDATA[

                       /*  http://storyjava.tistory.com

                        *  code5381@hotmail.com

                        *  KevinKim

                        */

                        import mx.managers.PopUpManager;

                        private var tt:TitleWindowEx = null;

                        private function init():void

                        {

                               tt = TitleWindowEx(PopUpManager.createPopUp(this, TitleWindowEx, true));

                        }

                 ]]>

           </fx:Script>

    </s:Application>

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"

                           title="Test1">

           <s:Label text="Test Page"/>

    </s:TitleWindow>

       

     

    2. Simple PopUpManager Example2

     

    *source code : PopUpManagerExample2.fxp

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx"

                           width="500"

                           height="500"

                           backgroundColor="#aaaaaa">

          

           <fx:Script>

                 <![CDATA[

                        /*  http://storyjava.tistory.com

                        *  code5381@hotmail.com

                        *  KevinKim

                        */

                        import mx.managers.PopUpManager;

                        public var userInfo:Object = {userID:"", userPWD:""};

                       

                        private function login():void

                        {

                               var userInfoPopUP:ShowIDPWD = ShowIDPWD(PopUpManager.createPopUp(this, ShowIDPWD, true));

                              

                               userInfo.userID = txt_ID.text;

                               userInfo.userPWD = txt_PASSWORD.text;

                              

                               userInfoPopUP.userInfo = this.userInfo;

                        }

                 ]]>

           </fx:Script>

           <mx:Panel verticalAlign="middle" horizontalAlign="center" layout="absolute">

                 <mx:Form width="100%" height="100%">

                        <mx:FormItem label="ID">

                               <mx:TextInput id="txt_ID" />

                        </mx:FormItem>

                        <mx:FormItem label="PASSWORD">

                               <mx:TextInput id="txt_PASSWORD" />

                        </mx:FormItem>

                 </mx:Form>

                 <mx:ControlBar horizontalAlign="center">

                        <mx:Button label="로그인" click="login()"/>

                 </mx:ControlBar>

           </mx:Panel>

    </s:Application>

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx"

                           width="200"

                           height="200"

                           horizontalCenter="true"

                           verticalCenter="true">

           <fx:Script>

                 <![CDATA[

                        import mx.managers.PopUpManager;

                        [Bindable]public var userInfo:Object;

                       

                        private function close():void

                        {

                               PopUpManager.removePopUp(this);

                        }

                 ]]>

           </fx:Script>

           <s:VGroup>

                 <s:Form>

                        <s:FormItem label="ID">

                               <s:Label id="txt_ID" text="{userInfo.userID}"/>

                        </s:FormItem>

                        <s:FormItem label="PASSWORD">

                               <s:Label id="txt_PWD" text="{userInfo.userPWD}"/>

                        </s:FormItem>

                 </s:Form>

                 <mx:ControlBar>

                        <s:Button click="close()" label="CLOSE" />

                 </mx:ControlBar>

           </s:VGroup>

    </s:TitleWindow>

     

    'Adobe Platform > Flex' 카테고리의 다른 글

    ActionScript Reference  (0) 2012.09.17
    Custom Event Dispatch  (0) 2012.09.14
    Flex의 ItemRenderer (Setting the itemRenderer or itemEditor property in ActionScript )  (0) 2012.09.13
    Repeater Class  (0) 2012.09.10
    Speex vs Nellymoser  (0) 2012.09.04
    AND

    itemRender 사용에 대한 명확한 이해를 하고자 이 포스팅을 합니다.

     

    1. ItemRenderer Example1 (DataGrid에 dataProvider 사용하기)

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx"

                           minWidth="955"

                           minHeight="600">

          

           <fx:Script>

                 <![CDATA[

                       /*  http://storyjava.tistory.com

                        *  code5381@hotmail.com

                        *  KevinKim

                        */

                        import mx.collections.ArrayCollection;

                        [Bindable]private var arr:ArrayCollection = new ArrayCollection([

                               {num:1, data:"홍길동"},

                               {num:2, data:"유관순"},

                               {num:3, data:"이순신"}

                        ]);

                       

                 ]]>

           </fx:Script>

          

           <mx:DataGrid width="300"

                                height="300"

                                dataProvider="{arr}">

                 <mx:columns>

                        <mx:DataGridColumn dataField="num" />

                        <mx:DataGridColumn dataField="data"/>

                 </mx:columns>

           </mx:DataGrid>

    </s:Application>

    *source code : ItemRendererExample1.fxp

     

    2. List에 dataProvider랑 itemRenderer 사용하기

     

    *source code :ItemRendererExample2.fxp

     

    *도움됐던 글 : 야훔님의 블로그 1. http://igna84.blogspot.kr/2010/03/flex-datagrid-itemrenderer-1-%EC%A0%84%EC%B4%88%EC%A0%84.html

                       야훔님의 블로그 2. http://igna84.blogspot.kr/2010/03/flex-datagrid-itemrenderer-2-%EC%A0%84%EB%A9%B4%EC%A0%84.html

                       야훔님의 블로그 3. http://igna84.blogspot.kr/2010/03/flex-datagrid-itemrenderer-3-%EB%98%90%EB%8B%A4%EB%A5%B8-%EC%A0%84%EC%9F%81%EC%9D%98-%EC%84%9C%EB%A7%89.html

    Flex Reference : http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_4.html

     

     

    AND

    [FMS] RTMP, RTMFP

    Media/WOWZA 2012. 9. 13. 10:43

    RTMFP(Real Time Meida Flow Protocol)은 Adobe에서 Adobe Flash Players와 LCCS나 Adobe AIR framework로 만들어진 어플리케이션 사이에 end user가 end user에게 peering통신을 가능하게 하는 새로운 프로토콜입니다. RTMFP는 소셜네트워크나, 고품질 솔루션을 전송하는 멀티유져 게임과 같은 실시간 커뮤니케이션을 가능하게 합니다. RTMFP는 end user사이에 마이크와 웹캠을 사용하면서 직접적으로 통신이 가능하게 한다.

    Real Time Media Flow Protocol (RTMFP) is a new protocol from Adobe that enables direct end user to end user peering communication between multiple Adobe Flash Players and applications built on LCCS or the Adobe AIR framework. RTMFP enables real time communication applications such as social networks and multi-user games to deliver high quality solutions. RTMFP enables end users to connect and communicate directly with each other using their computer's microphone and webcam.

     

    RTMFP는 UDP(User Datagram Protocaol) 기반으로 되어있는 반면, RTMP는 TCP(Transmission Control Protocaol)기반으로 되어있습다.  UDP기반의 프로토콜은 TCP를 기반으로하는 프로토콜 보다 더 많은 이점을 가질 수 있습니다.   latency와 overhead의 감소뿐만 아니라, 더 뛰어난 missing packets에 대한 tolerance를 가지는 라이브 스트리밍 미디어를 전송할 수 있습니다.  serverside 커넥션은 end user사이에서 항상 connection초기화를 해야 합니다. 그리고 serverside 데이터,혹은 다른 시스템으로의 게이트웨이들을 제공할때 사용할 수 있습니다.

    RTMFP is based on the User Datagram Protocol (UDP), whereas RTMP is based on the Transmission Control Protocol (TCP). UDP-based protocols have many advantages over TCP-based protocols when delivering live streaming media, including decreased latency and overhead as well as greater tolerance for missing packets.

    A server side connection is always required to establish the initial connection between the end users and can be used to provide server side data execution or gateways into other systems.

     

     

    RTMP(TCP기반)은 라이브스트리밍에 대해 좀 더 작은 허브와 spoke model(?)을 사용한다. RTMFP는 전송실패시 재전송되어진 오디오와 비디오 패킷을 강제하지 않는다.(?)

    RTMFP는 Data Gap이 있음에도 계속해서 전송된다. 이것은 저손실 패킷전송에 좀 더 부드러운 재생이 가능하게 한다. 또한 clinet와 client 사이에서의 스트리밍도 지원한다.

    client와 client는 free(?)가 아니다. 또한 더 빠르다. 이것은 LCCS service 통해 routed되지 않기 때문입니다. 많은 사용자나 방화벽, 다른 네트워크 상태에 따라 RTMFP 사용은 제한적일 것입니다. LCCS는 상황에 따라 자동적으로 바뀌도록 설계되었습니다. 만약 RTMFP가 사용가능하면 RTMFP를 사용하고, 그렇지 않으면 RTMP를 사용합니다.

    RTMP (TCP) uses a hub and spoke model which is less than ideal for live streaming. RTMFP doesn't force audio and video packets to be retransmitted in the case of failure. It continues playing despite gaps in the data - this means that the stream plays more smoothly in the case of small-scale packet loss. It also supports client to client streaming.

    Client to client streaming is not only free; it's also faster, because it isn't routed through the LCCS service. However, since a high number of users, a firewall, or other network conditions may prohibit the use of RTMFP, LCCS has been designed to automatically switch based on conditions: if RTMFP is enabled it uses it; if not, it uses RTMP.

     

      RTMFP는 우선적인 프로토콜이고, Flash player 10 SWC가 허영되는 한에 항상 더 나은 선택을 합니다. 왜냐하면 LCCS는 두 프로토콜들 사이에서 자동적으로 바꿀 수 있을 만큼 똑똑합니다. 그리고 you can always leverage RTMFP's capabilities whenever it's possible to do so and use RTMP as a fallback.

      RTMFP is the preferred protocol and always a better choice if using the required Flash player 10 SWC is acceptable. Because LCCS is smart enough to automatically switch between the two protocols as needed, you can always leverage RTMFP's capabilities whenever it's possible to do so and use RTMP as a fallback.

    To use RTMFP, set your project to use the Flash Player 10 or 10.1 SWC files.

    RTMFP pros

    • Client to client streaming: C2C reduces latency, since there are fewer hops from source to destination. The advantages for the LCCS service as well as you, is that the service can operate with less infrastructure to allow you to stream, thereby increasing reliability.
    • Speex access through Flash Player 10: Speex is a better codec than the NellyMoser codec in older Flash Players because it encodes voice with higher quality and at a lower bitrate. It's also more compatible with UDP so that it handles lossiness relatively gracefully.
    • Reduced bandwidth costs: RTMFP reduces the bandwidth costs for direct real time communication solutions such as audio and video chat and multiplayer games. Because RTMFP flows data between end user clients rather than the server, server bandwidth is reduced, thereby making solutions are less expensive to scale.
    • Increased speed of delivery: RTMFP also increases the speed of delivery through the use of UDP. UDP is a more efficient (but less reliable) way to send video and audio data over the Internet because it reduces the penalties associated with missing, dropped, or out of order packets.
    • Superior connection error recovery: RTMFP has two features that may help to mitigate the effects of connection errors:
      • Rapid Connection Restore: Connections are reestablished quickly after brief outages such as when a wireless network connection experiences a dropout. After re-connection, the connection has full capabilities instantly.
      • IP Mobility: Active network peer sessions are maintained even if a client changes to a new IP address. For example, when a laptop on a wireless network is plugged into a wired connection and receives a new network address.

    RTMFP cons

    Requires Flash player 10. This is usually a good thing.

     

    *source : http://learn.adobe.com/wiki/display/lccs/8.4+RTMFP+vs+RTMP

    AND

    Repeater Class

    Adobe Platform/Flex 2012. 9. 10. 17:20

     

    Repeater클래스는 <mx:Repeater>태그에 반응하는 runtime클래스입니다. Repeater클래스는 dataProvider기반의 하위컴포넌트를 가지는 다수의 인스턴스를 생성합니다.

    The Repeater class is the runtime object that corresponds to the <mx:Repeater> tag. It creates multiple instances of its subcomponents based on its dataProvider. The repeated components can be any standard or custom controls or containers.

    <mx:Application>컨테이너 태그를 제외한, 컨트롤태그나 컨테이너태그 어디서든 <mx:Repeater>태그를 사용할 수 있습니다. 사용자인터페이스 컴포넌트를 반복시키려면, <mx:Repeater>태그안에 위치시켜야 합니다. MXML문서안에서는 <mx:Repeater>태그를 여러번 쓸 수 있습니다. 또한 nest태그(<mx:Repeater></mx:Repeater>)로도 쓸 수 있습니다.

    UIComponent클래스를 확장하지 않은 객체에서는 <mx:Repeater>태그를 사용할 수 없습니다.

    You can use the <mx:Repeater> tag anywhere a control or container tag is allowed, with the exception of the <mx:Application> container tag. To repeat a user interface component, you place its tag in the <mx:Repeater> tag. You can use more than one <mx:Repeater> tag in an MXML document. You can also nest <mx:Repeater> tags.

    You cannot use the <mx:Repeater> tag for objects that do not extend the UIComponent class.

     

       <mx:Repeater
        Properties
        id="No default"
        childDescriptors="No default"
        count="No default"
        dataProvider="No default"
        recycleChildren="false|true"
        startingIndex="0"

        Events
        repeat="No default"
        repeatEnd="No default"
        repeatStart="No default"
      >

     

    <?xml version="1.0"?>

    <!-- Simple example to demonstrate the Repeater class. -->

    <s:Application name="RepeaterExample"

                           xmlns:fx="http://ns.adobe.com/mxml/2009"

                           xmlns:s="library://ns.adobe.com/flex/spark"

                           xmlns:mx="library://ns.adobe.com/flex/mx">

          

           <fx:Script>

                 <![CDATA[

                        import mx.controls.Alert;

                       

                        [Bindable]

                        private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9];   

                       

                        private function showAlert(evt:MouseEvent):void {

                               Alert.show(String(evt.currentTarget.getRepeaterItem()) + " pressed");

                        }

                 ]]>

           </fx:Script>

          

           <s:Panel title="Repeater Example"

                         width="75%" height="75%"

                         horizontalCenter="0" verticalCenter="0">

                 <s:VGroup left="10" right="10" top="10" bottom="10">

                        <s:Label width="100%" color="blue"

                                      text="Use the Repeater class to create 9 Button controls in a 3 by 3 Tile container."/>

                        <mx:Tile direction="horizontal" borderStyle="inset"

                                      horizontalGap="10" verticalGap="15"

                                      paddingLeft="10" paddingTop="10" paddingBottom="10" paddingRight="10">

                              

                               <mx:Repeater id="rp" dataProvider="{dp}">

                                     <s:Button height="49" width="50"

                                                    label="{String(rp.currentItem)}"

                                                    click="showAlert(event);"/>

                               </mx:Repeater>

                        </mx:Tile>

                 </s:VGroup>

           </s:Panel>

          

    </s:Application>

     

    *source code :RepeaterExample.fxp

    *source : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/Repeater.html#includeExamplesSummary

    AND

     

     

    1. Draggable, Movable, Resizable, Minimizable Panel

     

    *source code : PanelExample1.fxp

    *souce : http://blogs.adobe.com/flexdoc/2007/03/creating_resizable_and_draggab.html

     

    2. Implementing and skinning ResizeableTitleWindow

     

    *source code : PanelExample2.zip

    *source : http://blog.creacog.co.uk/2010/03/20/my-first-flex-4-spark-component-skin-resizeabletitlewindow/

     

    3. Removable Panel

     

    *source code :PanelExample3.fxp

    *source : http://blog.ninjacaptain.com/2008/06/draggable-panel-with-close-button/

     

    AND

    This example shows how to get the current mouse x,y coordinate.

     

     

     

    *source code :MouseLocation.fxp

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                         xmlns:s="library://ns.adobe.com/flex/spark"

                         xmlns:mx="library://ns.adobe.com/flex/mx"

                         width="500" height="600" backgroundColor="#BEEFFF" mouseMove="onMouseMove(event);">

           <fx:Script>

                 <![CDATA[

                        /*  http://storyjava.tistory.com

                         *  code5381@hotmail.com

                         *  KevinKim

                         */           

                        private function onMouseMove(mouseEvent:Object):void

                        {

                               mouseXPoint.text = this.mouseX.toString();

                               mouseYPoint.text = this.mouseY.toString();

                        }

                 ]]>

           </fx:Script>

           <s:HGroup width="100%" height="100%">

                 <s:Label text="X : " />

                 <s:Label id="mouseXPoint"/>

                 <s:Label text="Y : " />

                 <s:Label id="mouseYPoint"/>

           </s:HGroup>

    </s:Application> 

     

    AND

    Speex vs Nellymoser 비교

     

     라이센스 타입  Nellymoser는 정형화되어있는 코덱입니다. 거기에 반해 Speex는 오픈소스 입니다. 그 말인 즉, Speex는 라이센스 제약없이 인코딩, 디코딩 할 수가 있습니다.

     Nellymoser is closed format codec whereas Speex is opensource which means that files created using speex can be decoded or encoded without any licence requirement.

     Flash Player 요구사항  Nellymoser는 Flash player 6이상 지원하지만, Speex는 Flash Player 10버전을 필요로 합니다. 10버전에서는 Speex 지원은 하지만 잡음이 발생하는 버그가 있었지만, 버전 10.0.22.87 에서 버그 수정되었습니다.

    Nellymoser works from Flash player 6 onwards whereas Speex requires atleast Flash Player 10. Although speex works with flash player 10 but there is a audio disturbance bug on listener end which was fixed in version 10,0,22,87.So player 10,0,22,87 and above is recommended.

     음질

     Speex는 음성에 최적화 되어있습니다. Nellymoser과 비교했을 시 좀 더 좋은 음질을 기대할 수 있습니다.

    Speex is optimised for speech so better quality is expected from speex as compared to our old Nellymoser codec.

     대역폭 요구사항

     Speex는 Nellymoser보다 좀 더 작은 대역폭으로 좀 더 나은 음질을 제공합니다

    Speex delivers better quality than Nellymoser using less bandwidth as compared to speex.our tests revealed that the quality with nellymoser becomes usable at 8(16kbps) where as in case of speex it is 3 (9.80 kbps).The highest quality in Speex uses 42.2 kbps thats half of the bandwidth being used by nellymoser which is 88.2

     인코딩 음질  Speex는 11 Level의 quality를 제공해주고 있습니다.(0~10).  0이 최저음질이고 10이 최고음질입니다. Nellymoser는 5가지 종류로 음질을 Setting 할 수 있습니다. (5, 8, 11, 22, 44).  5가 최저음질이고 44가 최고음질입니다. 

    * 좀 더 나은 음질에는 더 많은 대역폭을 필요로 합니다. 이는 대역폭이 충분하지 않을 때 소리울렁임(choppy sound)을 야기합니다.

     Speex provides more flexibilityby giving 11 levels of quality to choose from (0-10).0 is lowest and 10 is highest audio quality. Nellymoser gives 5 settings(5,8,11,22,44) ,5 is lowest and 44 is highest quality.Remember more is the quality higher is the bandwidth requirement which may lead to choppy sound when sufficient bandwidth is not available

     

     

    Speex Nellymoser
    Quality (encodeQuality) Required bandwidth in kbps Quality(mic.rate) Required bandwidth in kbps
    0 3.95 5 11.025
    1 5.75 8 16
    2 7.75 11 22.05
    3 9.80 22 44.1
    4 12.8 44 88.2
    5 16.8    
    6 20.6    
    7 23.8    
    8 27.8    
    9 34.2    
    10 42.2    

     

     

    Speex Quality , Bandwidth and filesize table
    Quality (encodeQuality) Required bandwidth in kbps Per minute file size in KB
    0 3.95 28.9
    1 5.75 42.1
    2 7.75 56.7
    3 9.80 71.7
    4 12.8 93.7
    5 16.8 123.0
    6 20.6 150.8
    7 23.8 174.3
    8 27.8 203.6
    9 34.2 250.4
    10 42.2 309.0

    Test and Results: The encodeQuality for speex codec becomes quite usable from 4 (12.8kbps) although 3 can also be used for very low bandwidth requirements.It was also noticed that almost no processor overhead was there.So this codec will not add any load to applications requiring heavy processor.

     

    *source : http://askmeflash.com/article/2/speex-vs-nellymoser

    AND

    진폭(Amplitude)

       사운드 파형의 한 점과 0 또는 기준선 사이의 거리입니다.

       The distance of a point on the sound waveform from the zero or equilibrium line.

    비트율(Bit rate)

       사운드 파일의 초당 인코딩 또는 스트리밍된 데이터의 양입니다. mp3파일의 경우 비트율은 보통 kbps(초당 킬로비트) 단위로 표현됩니다. 비트율이 높을수록 일반적으로 음질이 좋습니다.

       The amount of data that is encoded or streamed for each second of a sound file. For mp3 files, the bit rate is usually stated in terms of thousands of bits per second (kbps).  A higher bit rate generally means a higher quality sound wave.

    버퍼링(Buffering)

       사운드 재생 전에 사운드 데이터를 수신하여 저장하는 과정입니다.

       The receiving and storing of sound data before it is played back.

    mp3

        MPEG-1 Audio Layer 3, 즉 mp3는 널리 사용되는 사운드 압축 형식입니다.

        MPEG-1 Audio Layer 3, or mp3, is a popular sound compression format.

    패닝(Panning)

       스테레오 사운드 펄드의 왼쪽과 오른쪽 채널 간에 오디오 신호를 지정하는 과정입니다.

       The positioning of an audio signal between the left and right channels in a stereo soundfield.

     피크(Peak)

        파형에서 가장 높은 위치입니다.

        The highest point in a waveform.

    샘플링 속도(Sampling rate)

       디지털 신호를 만들기 위해 아날로그 오디오 신호로부터 추출한 초당 샘플링 수를 정의합니다. 표준 콤팩트 디스크 오디오의 샘플링 속도는 44.1kHz, 즉 44,100샘플링/초 입니다.

       Defines the number of samples per second taken from an analog audio signal to make a digital signal. The sampling rate of standard compact disc audio is 44.1kHz or 44,100 samples per second.

     스트리밍(Streaming)

       사운드 파일 또는 비디오 파일의 뒷 부분을 서버에서 로드하는 동안, 이미 로드된 앞 부분을 재생하는 프로세스입니다.

       The process of playing the early portions of a sound file or video file while later portions of that file are still being loaded from a server.

     볼륨(Volume)

       사운드의 크기입니다.

       The loudness of a sound.

     파형(Waveform)

       시간에 따른 사운드 신호의 진폭 변화를 나타내는 그래프 모양입니다.

       The shape of a graph of the varying amplitudes of a sound signal over time.

    *source : Actionscript 3.0 Reference

    AND

     

    application.onConnect()

    application.onConnect = function (clientObj [, p1, ..., pN]){}

     

    Invoked when NetConnection.connect() is called from the client. This handler is passed a Client object representing the connecting client. Use the Client object to perform actions on the client in the handler. For example, use this function to accept, reject, or redirect a client connection, perform authentication, define methods on the Client object to be called remotely from NetConnection.call(), and set the Client.readAccess and Client.writeAccess properties to determine client access rights to server-side objects.

    When performing authentication, all of the information required for authentication should be sent from the NetConnection.connect() method to the onConnect() handler as parameters (p1..., pN).

    If you don't define an onConnect() handler, connections are accepted by default.

    If there are several simultaneous connection requests for an application, the server serializes the requests so that only one application.onConnect() handler is executed at a time. It's a good idea to write code for the application.onConnect() function that is executed quickly to prevent a long connection time for clients.

    Note: When you are using the version 2 component framework (that is, when you are loading the components.asc file in your server-side script file), you must use the application.onConnectAccept() method to accept client connections.

    Availability

    Flash Communication Server 1

    Parameters

    clientObj A Client object. This object contains information about the client that is connecting to the application.

    p1 ..., pN Optional parameters passed to the application.onConnect() handler from the client-side NetConnection.connect() method when a client connects to the application.

    Returns

    A boolean value; true causes the server to accept the connection; false causes the server to reject the connection.

    When true is returned, NetConnection.onStatus() is invoked on the client with info.code set to "NetConnection.Connect.Success". When false is returned, NetConnection.onStatus() is invoked on the client with info.code set to "NetConnection.Connect.Rejected".

    If null or no value is returned, the server puts the client in a pending state and the client can't receive or send messages. If the client is put in a pending state, you must call application.acceptConnection() or application.rejectConnection() at a later time to accept or reject the connection. For example, you can perform external authentication by making a NetConnection call in your application.onConnect() event handler to an application server and having the reply handler call application.acceptConnection() or application.rejectConnection(), depending on the information received by the reply handler.

    You can also call application.acceptConnection() or application.rejectConnection() in the application.onConnect() event handler. If you do, any value returned by the function is ignored.

    Note: Returning 1 or 0 is not the same as returning true or false. The values 1 and 0 are treated the same as any other integers and do not accept or reject a connection.

    How to use application.onConnect() to accept, reject, or put a client in a pending state.
    A. Client-side ActionScript B. Server-Side ActionScript

    Example

    The following examples show three ways to accept or reject a connection in the onConnect() handler:

    (Usage 1)
    application.onConnect = function (clientObj [, p1, ..., pN]){
        // Insert code here to call methods that do authentication.
        // Returning null puts the client in a pending state.
        return null;
    };
    (Usage 2)
    application.onConnect = function (clientObj [, p1, ..., pN]){
        // Insert code here to call methods that do authentication.
        // The following code accepts the connection:
        application.acceptConnection(clientObj);
    };
    (Usage 3)
    application.onConnect = function (clientObj [, p1, ..., pN])
    {
        // Insert code here to call methods that do authentication.
        // The following code accepts the connection by returning true:
        return true;
    };

    The following example verifies that the user has sent the password "XXXX". If the password is sent, the user's access rights are modified and the user can complete the connection. In this case, the user can create or write to streams and shared objects in the user's own directory and can read or view any shared object or stream in this application instance.

    // This code should be placed in the global scope.

    application.onConnect = function (newClient, userName, password){
        // Do all the application-specific connect logic.
        if (password == "XXXX"){
            newClient.writeAccess = "/" + userName;
            this.acceptConnection(newClient);
        } else {
            var err = new Object();
            err.message = "Invalid password";
            this.rejectConnection(newClient, err);
        }
    };

    If the password is incorrect, the user is rejected and an information object with a message property set to "Invalid password" is returned to the client side. The object is assigned to infoObject.application. To access the message property, use the following code on the client side:

    ClientCom.onStatus = function (info.application.message){
        trace(info.application.message);
        // Prints "Invalid password"
        // in the Output panel on the client side.
    };

    출처: http://livedocs.adobe.com/flashmediaserver/3.0/hpdocs/help.html?content=00000244.html

    AND

    [FMS] Buying guide

    Media/WOWZA 2012. 8. 23. 15:06
    AND

    Briefing:Today I was evaluating the difference between Wowza , Flash Media server and Red5. So decided to write this comparison matrix . This comparison versus all of these three flash servers contain the main features that are uncommon with each other . I have not mentioned the features that are common to all of them . I have tried my best to put correct info but still if you find some thing missing or incorrect then just feel free to send me message using this form . I will keep on adding new points ... 

    출처: http://askmeflash.com/article/10/comparison-wowza-vs-fms-vs-red5

    AND