http://blog.flexexamples.com/2008/02/25/creating-a-controlbar-container-in-flex-using-actionscript/#more-529
http://onflash.org/ted/2005/06/property-binding-in-flex.php
출처
http://adobe.bloter.net/tt/adobe/23
http://www.adobe.com/kr/devnet/flash/articles/flex_flasher_05.html
준비물
ant 1.7 (apache-ant-1.7.0-bin.zip)
: http://ant.apache.org/bindownload.cgi
Flex Ant Task (flex_ant_tasks_022607.zip)
: http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks
1. ant 설치
apache-ant-1.7.0-bin.zip 파일을 압축을 출고
apache-ant-1.7.0\bin 폴더를 path에 추가 해줍니다.
2. F;ex Ant Tash 설치
flex_ant_tasks_022607.zip 특정 폴더에 압축을 풀고
build.xml 파일에 taskdef 태그에 jar 경로를 지정해준다.
예) <taskdef resource="flexTasks.tasks" classpath="D:/dev.flex/lib/flexTasks.jar" />
3. build.xml 파일 작성
<project name="Flex Ant Tasks" default="compile" basedir=".">
<property name="FLEX_HOME" value="C:/Program Files/Adobe/Flex Builder 2/Flex SDK 2" />
<property name="swfFile" value="${basedir}/HelloWorld.swf" />
<property name="main_appliation" value="${basedir}/HelloWorld.mxml" />
<taskdef resource="flexTasks.tasks" classpath="D:/dev.flex/lib/flexTasks.jar" />
<target name="compile">
<echo>Building ${swfFile}</echo>
<mxmlc
file="${main_appliation}"
output="${swfFile}"
actionscript-file-encoding="UTF-8"
keep-generated-actionscript="true"
incremental="true"
>
</mxmlc>
</target>
</project>
참조
http://flexdocs.kr/docs/flex2/langref/mx/events/DataGridEvent.html
DataGird에서 Item 선택시 호출되는 이벤트 처리 입니다.
DataGird 속성은 반듯이 editable="true" 되어 있어야 해당 이벤트가 호출 됩니다.
DataGridEvent 객체
Property | Value |
---|---|
bubbles |
false |
cancelable |
false |
columnIndex |
0부터 시작 / DataGrid의 열의 인덱스 |
currentTarget |
이벤트를 처리하는 event listener를 정의하는 object |
dataField |
null |
itemRenderer |
편집중의 아이템에 대응하는 아이템 에디터 인스턴스 |
localX |
NaN |
reason |
null |
rowIndex |
0부터 시작 / DataGrid의 행의 인덱스 |
target |
이벤트를 dispatch한 object |
Type |
DataGridEvent.ITEM_FOCUS_IN |
출처
http://www.ibm.com/developerworks/webservices/library/ws-macroflex/
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=1821&productId=2
http://livedocs.adobe.com/labs/flex/3/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=data_access_048_3.html
http://flexdocs.kr/docs/flex2/langref/mx/rpc/soap/WebService.html
http://www.mail-archive.com/flexcoders@yahoogroups.com/msg64743.html
▶ SOAP
SOAP(Simple Object Access Protocol)에 대한 설명은 다른 사이트에 잘 나와 있으니 찾아 보세요.
여기에서는 Java로 SOAP 서버를 만들고, Tomcat으로 Web 서비스 하여, 클라이언트는 Delphi로 만들어 보겠습니다.
이와 같은 예가 외국 사이트를 찾아 보아도 별로 없더군요. 그래서 허접한 설명이지만 도움이 될까 해서 올립니다.
(기회가 되면 배열이나, Dataset도 구현 하고 싶지만 시간이 없어서...)
일부 소스와 내용은 에어콘 출판사의 차세대 자바 SOAP AXUS을 참조 했습니다.
▶ 준비물
JDK 1.4.x 이상 (http://java.sun.com)
Tomcat 4.1.36 (http://tomcat.apache.org/)
AXIS 1.4 (http://ws.apache.org/axis/)
▶ SOAP Web 서비스 설치
여기에서 JDK, Tomcat의 설치는 따로 하지 않겠습니다. 이것도 다른 사이트를 참조하세요.
1. axis-bin-1_4.zip 압축 풀기
Apache에서 받은 axis-bin-1_4.zip을 압축을 특정 폴더에 풀어 주세요. 저는 C:\SOAP\axis-1_4 에 풀었습니다.
앞으로 설명은 C:\SOAP\axis-1_4 으로 하겠습니다.
2. %tomcat_home%\conf\server.xml
아래 내용을 추가해서 AXIS 가상 경로를 추가 Tomcat을 다시 실행 시켜주세요.
▶ Java로 SOAP 서버 만들기
아래와 내용과 같이 HelloWorld.java을 만들고, 이 파일을 C:\SOAP\axis-1_4\webapps\axis 디렉토리에 확장자가 .jws로 수정 HelloWorld.jws을 C:\SOAP\axis-1_4\webapps\axis 복사해주세요.
HelloWorld.java 파일
확인하기
지금까지 잘 하셨다면 브라우저에서 http://localhost:8080/axis/HelloWorld.jws 주소로 보시면 아래와 같이 나올 것입니다.
<mx:Button x="178" y="13" label="Call SOAP" click="on_ButtonClick(event)" id="Button1" />
<mx:TextArea x="10" y="10" id="Text1" fontSize="14" text="AXIS" height="25"/>
<mx:TextArea x="56" y="43" id="Text2" height="21" width="204"/>
<mx:Label x="10" y="44" text="Result :"/>
</mx:Application>
▶ 실행 결과
출처
http://airdocs.kr/docs/flex2/langref/mx/effects/package-detail.html
http://blog.keutgens.de/download/flexEffectExplorer/current/swf/TransitionsAndEffects.html
Class | 설명 |
---|---|
Blur | 컴퍼넌트에 애매하게 해 효과를 적용할 수 있습니다. |
Dissolve | 컴퍼넌트가 투명으로부터 불투명하게, 또는 불투명으로부터 투명하게 추이하는 것 같은 애니메이션 효과를 설정합니다. |
Fade | 투명으로부터 불투명하게, 또는 불투명으로부터 투명하게 변화시킵니다. |
Glow | 컴퍼넌트에 발광 효과를 적용할 수 있습니다. |
Move | 지정된 시간 간격으로 컴퍼넌트의 위치를 변경합니다. |
Resize | 지정된 시간 간격으로 컴퍼넌트의 폭, 높이, 혹은 그 양쪽 모두의 값수를 변경합니다. |
Rotate | 특정의 점을 중심으로서 컴퍼넌트를 회전시킵니다. |
Zoom | 중심점을 기준에 object를 확대 또는 축소합니다. |
<!-- http://airdocs.kr/docs/flex2/langref/mx/effects/Fade.html -->
<!-- Simple example to demonstrate the Fade effect. -->
<!-- 0.0 = 투명 / 1.0 = 불투명 -->
<mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
<mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>
<mx:Panel x="10" y="10" width="122" height="177" borderStyle="none">
<mx:Label text="Fade effect." fontSize="14" visible="{cb1.selected}" hideEffect="{fadeOut}" showEffect="{fadeIn}"/>
<mx:Image source="fx.gif" visible="{cb1.selected}" hideEffect="{fadeOut}" showEffect="{fadeIn}"/>
<mx:CheckBox id="cb1" label="visible" selected="true"/>
</mx:Panel>
<!-- http://airdocs.kr/docs/flex2/langref/mx/effects/Blur.html -->
<!-- Simple example to demonstrate the Blur effect. -->
<!-- blurXFrom, blurXTo, blurYFrom, blurYTo 값의 범위 0.0 ~ 255.0 -->
<mx:Blur id="blurImage" duration="1000" blurXFrom="0.0" blurXTo="10.0" blurYFrom="0.0" blurYTo="10.0"/>
<mx:Blur id="unblurImage" duration="1000" blurXFrom="10.0" blurXTo="0.0" blurYFrom="10.0" blurYTo="0.0"/>
<mx:Panel x="140" y="10" width="122" height="177" borderStyle="none">
<mx:Label text="Blur effect." fontSize="14" visible="{cb2.selected}" hideEffect="{blurImage}" showEffect="{unblurImage}"/>
<mx:Image source="fx.gif" mouseDownEffect="{blurImage}" mouseUpEffect="{unblurImage}"/>
<mx:CheckBox id="cb2" label="visible" selected="true"/>
</mx:Panel>
</mx:Application>
- Click Event
<mx:Script>
<![CDATA[
private function on_ButtonClick(event:Event):void {
mx.controls.Alert.show(
event.type // click
+ "\n" + event.currentTarget.name // Button1
+ "\n" + Button(event.currentTarget).label // ButtonLabel
+ "\n" + event.toString() // [MouseEvent type="click" bubbles=true cancelable=false eventPhase=2 localX=63 localY=12 stageX=73 stageY=22 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0]
);
}
]]>
</mx:Script>
<mx:Button x="10" y="10" label="ButtonLabel" click="on_ButtonClick(event)" id="Button1"/>
</mx:Application>
- Create Button
<mx:Script>
<![CDATA[
private function on_ButtonClick(event:Event):void {
var array_num:Array = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"];
var base_x:int = 10;
var base_y:int = 90;
var button_width:int = 30;
var button_height:int = 45;
for (var i:int = 0; i<4; i++) {
for (var j:int = 0; j<3; j++) {
var button:Button = new Button();
button.label = array_num[ (i * 3) + j ];
button.x = base_x + (j * button_width);
button.y = base_y + (i * button_height);
button.width = button_width;
button.height = button_height;
button.setStyle("fontSize", 14);
this.addChild(button);
button.addEventListener(MouseEvent.CLICK, clickHandler);
}
}
}
private function clickHandler(event:MouseEvent):void{
Text1.text = Text1.text + Button(event.currentTarget).label;
}
]]>
</mx:Script>
<mx:Button x="10" y="10" label="Create Button" click="on_ButtonClick(event)" id="Button1" />
<mx:TextArea x="10" y="40" id="Text1" fontSize="14"/>
</mx:Application>
츨처
http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001823.html
단순 데이타 타입
int, uint, Number, Boolean, String, void, Null
var value:int = 123; // int.MAX_VALUE = 2,147,483,647 , int.MIN_VALUE = -2,147,483,648
var value:unit = 4000000;
var value:uint = 0x336699FF;
var value:uint = new uint( 0x336699FF );
var value:Number = 123.45; // MAX_VALUE = 1.79769313486231e+308 , Number.MIN_VALUE = 4.940656458412467e-324
var value:Boolean = true;
var value:String = "Hello World!";
복합 데이타 타입
Arrays
<mx:Script>
<![CDATA[
public function test():void
{
var value1:String = "a";
var value2:String = "b";
var value3:String = "c";
var values1:Array = new Array( value1, value2, value3);
var values2:Array = [value1, value2, value3];
var values3:Array = new Array();
values3[ 0 ] = value1;
values3[ 1 ] = value2;
values3[ 2 ] = value3;
var values4:Array = new Array();
values4.push( value1);
values4.push( value2);
values4.push( value3);
trace("0 values4.length = " + values4.length);
var value1_1:String = values4.pop();
var value2_1:String = values4.pop();
var value3_1:String = values4.pop();
trace("1 values4.length = " + values4.length);
trace("value3_1 = " + value3_1);
trace("value2_1 = " + value2_1);
trace("value3_1 = " + value3_1);
}
]]>
</mx:Script>
<mx:Button x="33" y="172" label="Button" click="test()"/>
</mx:Application>
출처
http://livedocs.adobe.com/flex/1/asdocs/mx/servicetags/HTTPService.html
[Bindable]
public var xlcData:XMLListCollection;
public function init():void
{
var params:Object = new Object();
params.keyname = "freeboard";
params.qryname = "list";
httpData = new HTTPService();
httpData.url = "http://localhost:8080/examples/xmldata.jsp";
httpData.method = "POST";
httpData.resultFormat="e4x";
httpData.addEventListener("result", resultHandler);
httpData.addEventListener("fault", faultHandler);
httpData.send(params);
}
public function resultHandler(e:ResultEvent):void
{
var xlData:XMLList = new XMLList(e.result);
// mx.controls.Alert.show(xlData.data.row.toXMLString());
grid1.dataProvider = xlData.data.row;
}
public function faultHandler(e:FaultEvent):void
{
mx.controls.Alert.show("데이타를 읽는 중 에러\n"+e.fault.faultString);
}
]]>
</mx:Script>
<mx:DataGrid id="grid1" x="233" y="177" width="457">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="c1"/>
<mx:DataGridColumn headerText="Column 2" dataField="c2"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
xmldata.jsp
String xmldata = MetaBoard.getInstance().getQueryRun(keyname, qryname);
%>
<root>
<%=xmldata%>
</root>
댓글을 달아 주세요