Return to Snippet

Revision: 28286
at July 6, 2010 12:21 by goatboy91587

Initial Code
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="" 
			   width="436" height="248" creationComplete="mainFunction()">
			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
			{'Hello World!', 'Message 2');

	<!--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="'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"/>

Initial URL

Initial Description

Initial Title
Hello World Flash Builder

Initial Tags
flash, Flex

Initial Language