Hey.
You can pass values pretty easy with the ExternalInterface.call() function.
for example:
Flex Code:
public function callJSFunction():void
{
var value1:String = "This is a test.";
var value2:String = "22";
var jsFunctionName:String = "TestJSFunction";
ExternalInterface.call(jsFunctionName,value1,value2);
//Here you just do the JS function name followed by however many variables
you want to pass
}
JS Code:
function TestJSFunction(val1, val2)
{
alert(val1 + " " + val2);
}
On Wed, Sep 2, 2009 at 5:17 PM, <[email protected]> wrote:
> Anyone have an example of pulling variable values out of a flex script
> through the ExternalInterface API
>
> I've seen examples of calling javascript from flex
> I've seen examples of triggering flex functions from javascript.
> But not an example of running a flex function from javascript and getting
> its return value.
>
>
>
>
> -------------------------------------------------------------
>
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
>
>
> For more info, see http://www.affug.com
>
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
>
> List hosted by http://www.fusionlink.com
>
> -------------------------------------------------------------
>
>