1. Flex관련 잡글
- xml 캐스팅을 이케도 한다는 거
public function resultHandler(event:ResultEvent):void {
myResult = XML( event.result );
}
Is "XML( event.result );" short for "(new XML()).loadXml(event.result);"? Have you got other examples of RAD type
conversions? Think about $() in JS prototype...
- swf파일에서 html파일의 js함수 호출이 되고 데이터 교환이 가능하다는 거
[ swf 파일 ]
var htmlReturnValue:String;
htmlReturnValue = String(ExternalInterface.call("showStatus", " A message can be sent to the HTML page
Javascript showStatus() function from the application (swf --> HTML)"));
Alert.show(htmlReturnValue);
html 파일엔 showStatus라는 함수가 있고 뭔가 문자열을 리턴하고 Alert.show로 찍는 예제야.
- Local Connections : 한개 이상의 swf파일 내에서 다른 local connection 안의 메소드를 호출 할 때 쓴대.
a call to the send() method passing the connectionName, methodName and arguments
샘플 튜토리얼 url :
http://learn.adobe.com/wiki/display/Flex/Local+Connections- 결과값(xml) 그리드에 바인딩
<mx:HTTPService id="areacodeService" ............../>
...
...
<mx:DataGrid dataProvider="{areacodeService.lastResult.Table}">
areacodeService.lastResult 는 xml형태의 문자열이 담겨있는데.. 저걸 .Table 로 그리드에
바인딩을 시키네. 플렉스 아직 어렵진 않은 것 같은데 참 생소하다.
- 이벤트 전파(?? Event Propagation)
예전에 어디서 이거 관련된 글을 읽었더라.. 누구 블로그였는데..?
버튼의 클릭 이벤트가 발생할 때 그 버튼하고 감싸고 있는 다른 객체에서 Capturing, Bubbling단계가 있고
브라우저마다 처리하는게 좀씩 다르다고 했던 거 같은데, 대충 그거랑 관련된 예제네.
http://learn.adobe.com/wiki/display/Flex/Event+Demo
1. Capturing phase: Flex checks to see which ancestors are
registered as listener's for the event starting from the
root application object to the direct ancestor of the target
(root노드부터 target노드까지 훑으면서 이벤트리스너 존재여부
를 확인하는데, 기본적으로 컨테이너들은 useCapture=false
이기 때문에 Capturing단계를 거치지 않는다.)
2. Targeting phase: Flex invokes the target's event listeners
(Target노드의 Event를 동작(trigging)한다.)
3. Bubbling phase: Each registered listener is given a chance
to handle the event starting from the direct ancestor of
the target to the root application object.
(target노드부터 root노드까지 Event Listener를 동작한다.)
2. Flex UI
- vertical - lays out each child component vertically from the top of the application to the bottom in the specified order.
- horizontal - lays out each child component horizontally from the left of the application to the right in the specified order.
- absolute - Absolute positioning does no automatic layout and requires you to
explicitly define the location of each child component.
- 태그샘플
<mx:HDividedBox width="100%" height="300">
<mx:Canvas ........>...</mx:Canvas>
<mx:Canvas ........>...</mx:Canvas>
</mx:HDividedBox>
이건 뭐 대충 레이아웃 잡는 태그중 하난데 상하위 관계로 배치하는 그저 단순히 샘플..
상대적인 위치로 컴포넌트들 배치를 할때 사용하는 등~
- mxml 내에서의 스타일 정의
<mx:Style>
.header {
color: #ffffff;
fontSize: 15;
fontWeight: "bold";
}
</mx:Style>
이런식으로 하는구나...
- MXML과 Action Script 3.0
플렉스컴포넌트는 위의 둘을 사용하여 애플리케이션을 추가한대.
MXML로 작성된 코드는 Action Script 3.0으로 컴파일이 된다네.
그리고 MXML 내에서 <mx:Script>태그를 통해 Action Script 3.0이 작성되기도 해.
- 로드시 실행되는 함수지정?
Application 태그에 지정하는 속성 중에 creationComplete 랑 initialize. 두가지를 사용하는 예를 봤는데
차이점이 뭐지? 알아봐야겠다.
--> http://xprogrammer.tistory.com/318 이런 차이점이 있구나.. 링크에 자세히 설명됨.
컨테이너나 컨트롤에 initialize 이벤트가 발생할 때, width, height, position은 계산되지 않는다.
initialize 이벤트는 컨테이너의 자식 컨트롤에 대한 환경설정을 할 때 유용하다. 컨테이너의
initialize이벤트를 통해서 자식을 추가하거나 컨테이너의 스크롤바 스타일을 설정할 수 있습니다.
initialize이벤트는 컨트롤이 사용하는 data provider를 초기화할 수 있습니다.
creationComplete 이벤트는 컨테이너에 포함된 자식 컨트롤이 화면에 표시되면 발생합니다.
물론 화면에 표시되기 전에 initialize이벤트에 대한 처리는 끝난 상태입니다. 자식 컨트롤의 width, height,
position과 관련된 일을 할 때만 사용하고, layout과 관련된 일을 하는 것은 부하를 주므로 피해야 합니다.
.
3. Flex Form
쿼리전송을 위한 Form사용 튜토리얼. (근데 메뉴쪽 에러나있네 ㅡㅡ?)
4. Displaying lists of items.
이런 특징들..
- Resizeable columns - 컬럼 사이즈 조절
- Customizable columns and row headers - 행, 열 헤더 사용자 정의
- Editable - 수정가능
- Multiple modes of selection - 여러 항목 선택가능
- Use of custom item renderer - 이건 좀 더 보자
- Paging of data - 페이징
- Drag and drop capability - 드래그 앤 드랍.. 오 편하네..
<mx:DataGrid id="datagrid_id" .........>........</mx:DataGrid> 태그로 정의하고
datagrid_id.dataProvider = photoFeed; // 이런식으로 바인딩
<mx:Label text="{data.title.getItemAt(0)}" .......> 받아온 xml데이터는 저런식으로 사용하네.
- XML파싱해서 쓸 때
태그 : <yweather:location city="Schenectady" region="NY" country="US"/>
값추출,할당 : weatherObject.city = myResult.channel.yweather::location.@city;
- 데이터 배열에 담은 것을 DataGrid에 바인딩 할 때
var a:Array = new Array(weatherObject); // 객체를 배열에 담아가가..
listContents = new ArrayCollection(a); // 배열을 배열모음에 담아가가..
test1.dataProvider = listContents; // DataGrid에 바인딩한다.
- 태그 안에 있는 값 정규식으로 뽑아오기
var pattern:RegExp = /img src="(.+?)"/;
var results:Array = pattern.exec(fromHtml);
var imageURL:String = results[1].toString(); // backreference 1 from pattern
imageURL안에 <img src="AAA"> 태그의 AAA값이 담기는데.. 후.. 정규식은 맨날 봐도 까먹드라. 쓸일이 잘 없어.
5. Flex에서 제공하는 유용한 UI 태그들
댓글을 달아 주세요
댓글 RSS 주소 : http://kk67547.cafe24.com/blog/rss/comment/133