I made a new as3 file from flash builder added this code :
import flash.external.ExternalInterface;
public function alfa() : void{
var someVarInAS : String = 'foo';
var someOtherVarInAS : int = 10;
var jsXML : XML =
<script type="text/javascript">
var someVarInJS = '{someVarInAS}';
var someOtherVarInJS = {someOtherVarInAS};
<![CDATA[
//here be code
alert( 'this comes from flash: ' + someVarInJS + ', ' + someOtherVarInJS );
]]>
</script>;
ExternalInterface.call( "function js_getData(){ " + jsXML + " }" );
}
And in the mxml this code in fxscript tag :
<fx:Script>
<![CDATA[
include "web.as";
alfa();
]]>
</fx:Script>
Now it gives me this error : Description Resource Path Location Type 1180: Call to a possibly undefined method alfa. omega.mxml /live_broadcast/src line 29 Flex Problem
They are both in the same "default_package" and if i don't put a function and let the code by itself it works wonderfull but i would like a function.
I am new to this flash thing so if anyone can make me understand why it says that? Thank you.