你好世界Flash Builder
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了你好世界Flash Builder相关的知识,希望对你有一定的参考价值。
<?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="436" height="248" creationComplete="mainFunction()"> <fx:Script> <![CDATA[ import mx.controls.Alert; // main function that fires when creation is complete /* adds event listener to the button with the id "hello2" * that listens for a mouseclick event and designates * a function to be called when the mouse is clicked. */ private function mainFunction():void { this.hello2.addEventListener(MouseEvent.CLICK, helloFunction); } //function that is fired on click private function helloFunction():void { Alert.show('Hello World!', 'Message 2'); } ]]> </fx:Script> <!--Hello World Example 1 using inline MXML click events --> <s:Label y="30" text="Hello World Example 1" color="#000000" fontWeight="bold" horizontalCenter="2"/> <s:Button y="50" label="Hello World 1" click="Alert.show('Hello World!', 'Message')" id="hello1" color="#000000" horizontalCenter="1"/> <!-- Hello World Example 2 using event handlers in AS3 --> <s:Label y="96" text="Hello World Example 2" color="#000000" fontWeight="bold" horizontalCenter="2"/> <s:Button y="125" label="Hello World 2" id="hello2" color="#000000" horizontalCenter="1"/> </s:Application>
以上是关于你好世界Flash Builder的主要内容,如果未能解决你的问题,请参考以下文章