I have just made my first Hello World application. I am using example 7 and I have made a small Flex 3 program instead of the flash .swf file. The program looks like this:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<mx:Application initialize="init();" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button id="mine" x="10" y="10" label="Button"/>
<mx:Script>
<![CDATA[
import flash.external.*;
private function init() : void {
ExternalInterface.addCallback("CallMeFromApplication", InternalFunction);
}
public function InternalFunction(str: String): String {
mine.label = "Hey";
return ":random" + Math.random();
}
]]>
</mx:Script>
</mx:Application>
I correctly get a new random number back to the c# application but the label on the button will not change. It seems like I have two instances. One visible - and one invisible which recieves the calls
Does anybody know how to fix this?
Ben