Below I am creating a toolbar using some buttons I created in the Flash IDE. Now I am adding them to a panel depending on which tools they wanted loaded in. That information is stored in an xml file. The Error I get now is that the class bPrint is not defined. Basically I need help with the sytax.
Some other side questions I had was about using ButtonAsset. I can use SpriteAsset and MovieClipAsset with no problems but if I try using ButtonAsset on buttons that I am pulling in from flash I get errors. Can someone provide me with an example of how to use the ButtonAsset object?
Lastly, what is the best way to handle the events on my buttons that I created in flash? I was just going to add an event listener called clickHandler and using a case statement on the target.name value, I would handle the event accordingly. Sound good?
Thanks in advance to all who contribute.
<?xml version="1.0" encoding="utf-8"?>
paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5">
[Bindable] public var PropList:XMLList;
[Embed("Images/tool_24.png")] private const PanelTitleIcon:Class;
[Embed("SWFs/buttons.swf", symbol="bPrint")] private var bPrint:Class;
public function init():void
this.title = PropList.@t;
if(PropList.@si == "t") this.titleIcon = PanelTitleIcon;
var tool:Array = new Array();
toollist = PropList.tools;
tool[i] = new Image();
tool[i].source = getDefinitionByName(String(toollist.t[i].@n)) as Class;
bPrint should be a class with some obscurated name. To create a new instance you would just do:
so instead of using getDefinitionByName you can look up the class on the document
tool.source = document[(String(toollist.t.@n))] as Class;
Flex SDK Developer
Adobe Systems Inc.