To call a function in flex app from java script or html wrapper we need to use a function of ExternalIntrface API the function name is addCallback()
the syntax of the function is given below
here myFunction is the function which is called when an instance is returned from the JS i’e “getarg”
this statement should be in public function of flex app
and the function we call myFunction should also be public.
public funciton init():void
public function myFunction(s1:String):void
var s:String=new String();
The above lines of code are for flex app, Now to raise the function myFunction from wrapper page we have to include the following lines of statements
here the mymxml is the “name” and “id” of the <Object> and tags by default they are created but we have to change to give them periods as they don’t have periods.now when the body loads the function callEx() is called and title of the page is passed to the flex page there we are getting it in a string and Alert it.
thats it calling a function from the JS.