programming/flex2.0
Flex 2 mxml에 actionScript 정의하는 방법
happy4u
2006. 11. 8. 11:09
MXML에 ActionScript를 정의하는 방법은 두 가지가 있다.
1. MXML안에 직접 정의하는 방법
in test.mxml
<mx:Script>
<![CDATA[
import mx.controls.Alert;
function sayHello(){
Alert.show("hi")
}
]]>
</mx:Script>
2. 외부 파일에 정의하고 그 파일을 지정하는 방법
in test.mxml
<mx:Script source="as3/test.as">
</mx:Script>
in as3/test.as (
import mx.controls.Alert;
function sayHello(){
Alert.show("hi")
}