목록딸기 공부방/flex (33)
특별한딸기이야기
MyButton.as package Mycontrols { import mx.controls.Button; import mx.controls.Alert; public class MyButton extends Button { private var m_str : String; public function MyButton() { super(); m_str = ""; } public function setM_str(str : String) : void { m_str = str; } public function getM_str() : String { return m_str; } public function showStr() : void { Alert.show(m_str); } } } Study.mxml
MultiButton.mxml [Event(name="btn1Clicked", type="flash.events.Event")] [Event(name="btn2Clicked", type="flash.events.Event")] [Event(name="btn3Clicked", type="flash.events.Event")] [Event(name="btn4Clicked", type="flash.events.Event")] Study.mxml
MyTextInput.mxml Study.mxml
player.mxml Study.mxml
MyButton.mxml Study.mxml
flex Bard jsp
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; private function onClick() : void { getXml.send(); } private function onResult(event : ResultEvent) : void { txtResult.text = event.result.toString(); } private function onFault(event : FaultEvent) : void { txtResult.text = event.fault.toS..
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; private function onClick() : void { getData.send(); } private function onResult(event : ResultEvent) : void { txtResult.text = event.result.toString(); } private function onFault(event : FaultEvent) : void { txtResult.text = event.fault.to..
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function draw() : void { var g : Graphics = imgDraw.graphics; g.beginFill(0xff00ff); g.lineStyle(5, 0x00ff00); g.drawCircle(20, 20, 20); g.moveTo(10, 10); g.lineTo(40, 60); g.endFill(); g.beginFill(0x0000ff); g.drawRect(30, 40, 20, 20); g.endFill(); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function onChange() : void { var msg : String; msg = "selectedIndex - " + String(tlistFruits.selectedIndex) + "\n"; msg += "selectedItem.code - " + String(tlistFruits.selectedItem.code) + "\n"; msg += "selectedItem.label - " + String(tlistFruits.selectedItem.label) + "\n"; Alert.sh..
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function onChange() : void { var msg : String; msg = "selectedIndex - " + String(grdFruits.selectedIndex) + "\n"; msg += "selectedItem.data - " + String(grdFruits.selectedItem.data) + "\n"; msg += "selectedItem.label - " + String(grdFruits.selectedItem.label) + "\n"; Alert.show..
treFruits.selectedItem.@data) + "\n"; msg += "selectedItem.label - " + String(treFruits.selectedItem.@label) + "\n"; Alert.show(msg); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function onMouseDown(event : MouseEvent) : void { txtDrag.startDrag(); } private function onMouseUp(event : MouseEvent) : void { txtDrag.stopDrag(); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function onChange() : void { var msg : String; msg = "selectedIndex - " + String(tlistFruits.selectedIndex) + "\n"; msg += "selectedItem.code - " + String(tlistFruits.selectedItem.code) + "\n"; msg += "selectedItem.label - " + String(tlistFruits.selectedItem.label) + "\n"; Alert.sh..
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function onChange() : void { var msg : String; msg = "selectedIndex - " + String(cmbFruits.selectedIndex) + "\n"; msg += "selectedItem.code - " + String(cmbFruits.selectedItem.code) + "\n"; msg += "selectedItem.label - " + String(cmbFruits.selectedItem.label) + "\n"; Alert.show(msg)..
http://www.adobe.com/2006/mxml" layout="absolute"> import mx.controls.Alert; private function onChange() : void { var msg : String; msg = "selectedIndex - " + String(lstFruits.selectedIndex) + "\n"; msg += "selectedItem.Code - " + String(lstFruits.selectedItem.code) + "\n"; msg += "selectedItem.Label - " + String(lstFruits.selectedItem.label); Alert.show(msg); ..
http://www.adobe.com/2006/mxml" layout="absolute"> 바인딩 전 private function onChange() : void { lblMsg.text = txtInput.text; } ]]> -->
http://www.adobe.com/2006/mxml" layout="absolute"> private function onChange() : void { lblChoose.text = String(nsFigure.value); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function onChange() : void { lblColor.setStyle("color", cpkColor.selectedColor); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function onChange() : void { txtDate.text = String(dcDate.selectedDate.fullYear) + "/" + String(dcDate.selectedDate.month + 1) + "/" + String(dcDate.selectedDate.date); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function onChnage() : void { //txtDate.text = dcDate.selectedDate.toString(); txtDate.text = String(dcDate.selectedDate.fullYear) + "/" + String(dcDate.selectedDate.month + 1) + "/" + String(dcDate.selectedDate.date); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function keyboardEvent(event : KeyboardEvent) : void { lblMsg.text = event.type + " code = " + String(event.keyCode); } ]]>
100) { i = 0; } prgClick.setProgress(i, 100); txtValue.text = String(i); } ]]>
http://www.adobe.com/2006/mxml" layout="absolute"> private function resize() : void { button.width = sliderH.value; button.height = sliderV.value; } ]]>
실수에서는 반올림 오류가 발생할 가능성이 있다. 그 가능성을 제거하기 위해서는 자신이 필요한 부분의 소수점만 가지고 있는 것이 좋다. Math.round()는 반올림 함수이다. 반올림 함수전에 자신이 필요한 자리수 만큼 소수점을 옮겨준다. 반올림을 한다. 다시 소수점을 원래 상태로 옮겨준다. 3.141592 314.1592 3.14
http://www.adobe.com/2006/mxml" layout="absolute">
http://www.adobe.com/2006/mxml" layout="absolute">
구글]]>
@Embed('/Image/download[4].jpg')