scripter73
04-22-2009, 06:15 PM
Hi,
I hope I'm posting this in the right location. I'm a newbie to Flex, MXML and ActionScript.
I'm walking a book now on the Flex Builder framework. As I go through examples, I run the examples which are comprised of MXML and ActionScript.
I'm sort of very methodical (ColdFusion background), and as I'm looking through one example in particular, I'd like to know what comes first, etc.
I understand that when I compile my MXML code, everything is converted to ActionScript, but I'm having a hard time walking through this code. (Hopefully, when I get to the debugging portion of my book, this will be easier.)
I've posted the latest example I'm working on here. If it wouldn't be too much trouble, could someone please step through it and tell me the "order" of the process? For example, are the imports done first, or is the Panel and PopUpButton processed first.
--------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.*;
import mx.controls.Menu;
public var menuItems:Object=
[
{label:'One'},
{label:'Two'},
{label:'Three'}
];
public var thisMenu:Menu = Menu.createMenu(null, menuItems, false);
public function handleItemClick(event:MenuEvent):void{
menuBtn.label = event.label; //all this does is move the
//mx.controls.Alert.show("Value picked was: " + event.label);
}
]]>
</mx:Script>
<mx:Panel width="100" height="100">
<mx:PopUpButton id="menuBtn" creationComplete="thisMenu.addEventListener('itemClick', handleItemClick)" popUp="{thisMenu}" />
</mx:Panel>
</mx:Application>
--------------------
Thanks in advance!
scripter73
I hope I'm posting this in the right location. I'm a newbie to Flex, MXML and ActionScript.
I'm walking a book now on the Flex Builder framework. As I go through examples, I run the examples which are comprised of MXML and ActionScript.
I'm sort of very methodical (ColdFusion background), and as I'm looking through one example in particular, I'd like to know what comes first, etc.
I understand that when I compile my MXML code, everything is converted to ActionScript, but I'm having a hard time walking through this code. (Hopefully, when I get to the debugging portion of my book, this will be easier.)
I've posted the latest example I'm working on here. If it wouldn't be too much trouble, could someone please step through it and tell me the "order" of the process? For example, are the imports done first, or is the Panel and PopUpButton processed first.
--------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.*;
import mx.controls.Menu;
public var menuItems:Object=
[
{label:'One'},
{label:'Two'},
{label:'Three'}
];
public var thisMenu:Menu = Menu.createMenu(null, menuItems, false);
public function handleItemClick(event:MenuEvent):void{
menuBtn.label = event.label; //all this does is move the
//mx.controls.Alert.show("Value picked was: " + event.label);
}
]]>
</mx:Script>
<mx:Panel width="100" height="100">
<mx:PopUpButton id="menuBtn" creationComplete="thisMenu.addEventListener('itemClick', handleItemClick)" popUp="{thisMenu}" />
</mx:Panel>
</mx:Application>
--------------------
Thanks in advance!
scripter73