header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Mac
Points:0
Posts:0

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



1
Trillian
Points: 0
Posts:0
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'".

2
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);


3
Sylvian Bob
Points: 0
Posts:0
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.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 0+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions