Okay, I've always just developed my projects in as3 instead of mxml and I usually just setup my application to run a main actionscript file as my main doc root, sort of like how you do it in flash but in flash builder I do something like this:
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
.....etcetc
>
<com:MyAS3DocClass>
</com>
<fx:Script>
<![CDATA[
public function call_from_outside():void
{
//Some code stuff here...
}
]]>
</fx:Script>
</s:Application>
Now say MyAS3DocClass has a public function within it:
public function hitme():void
{
trace('ouch');
}
My question is, how can I call place a call to that function hitme()
within the call_from_outside()
function between the <fx:Script>
tags?
The reason why I'm doing this is because I have some flash swfs that I load into another swf file and I can access the top level public functions of those flash swfs, however the top level of the flash builder/flex swfs is the main mxml file not my fake as3 class root. Of course I should think there is a way for me to access the as3 class methods of the mxml component but for keeping things with the same structure, I can bypass having to modify my loader scripts. Anyone have an ideas?