6/19/2010 9:46:21 PM
Title:
Call Actionscript from javascript
I have an HTML control with id as "html" and an HTML page is loaded inside it.
I want to invoke an ActioScript function inside my AIR application from the javascript inside
that HTML page.PLease anyone Help
6/19/2010 10:25:22 PM
There is not HTML control in flex. It must be your customized control which is loading htmlText in a textbox. Javascript does not execute from textBox. You can call the asfunction using "a href='asfunction:myfunction'".
Tyson
Points: 680
Posts:0
6/19/2010 10:34:06 PM
check this code to execute the JavaScript function from html within flex application.
// this will create a textArea in your flex application with HTMLText inside and on click it will show you javascript alert
var callText:TextArea= new TextArea();
callText.htmlText = "<a href=\"javascript:void(alert('Javascript Alert from flex TExtbox'));\">click to show javascript alert</a>";
addChild(callText);
6/19/2010 10:52:43 PM
in the above code by Tyson you can call any JavaScript function , just replace alert by you javascript function name.