How to Communicate with JavaScript?
Answers were Sorted based on User's Feedback
Answer / murali
yes, it's possible to communicate with java script.
how,
there three methods
using getURL("javascript:name of th url,width, hight");
fscommand
ExternelInterface
| Is This Answer Correct ? | 16 Yes | 3 No |
Answer / satyendra dewangan
Using getURL method in AS 2.0..we can possibly call
javascript function..
Syntax:-
getURL("javascript:weightMIN('"+argument+"');");
If you want to call javascript function:-
function weightMIN(val){
alert(val);
}
OR
You can use also ExternalInterface class in flash AS 2.0..
import flash.external.*;
var methodName:String = "goHome";
var instance:Object = null;
var method:Function = goToAdobe;
var wasSuccessful:Boolean =
ExternalInterface.addCallback(methodName, instance, method);
var txtField:TextField = this.createTextField("txtField",
this.getNextHighestDepth(), 0, 0, 200, 50);
txtField.border = true;
txtField.text = wasSuccessful.toString();
function goToAdobe() {
txtField.text = "http://www.adobe.com";
getURL("http://www.adobe.com", "_self");
}
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / madhusudhan
To call javascript using flash
getURL("javascript:name of the function");
but better to call with ExternalInterface it supports all is
6 firefox also ...
import flash.external.ExternalInterface;
ExternalInterface.call("name of the function with out round
brackets")
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sankar farshore
var retval:int =
ExternalInterface.call("some_js_function()", "the-argument");
if u want to pass the arguement and if function return
anything u capture using above method
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / satyendra dewangan
Using getURL method in AS 2.0..we can possibly call
javascript function..
Syntax:-
getURL("javascript:weightMIN('"+argument+"');");
If you want to call javascript function:-
function weightMIN(val){
alert(val);
}
OR
You can use also ExternalInterface class in flash AS 2.0..
import flash.external.*;
var methodName:String = "goHome";
var instance:Object = null;
var method:Function = goToAdobe;
var wasSuccessful:Boolean =
ExternalInterface.addCallback(methodName, instance, method);
var txtField:TextField = this.createTextField("txtField",
this.getNextHighestDepth(), 0, 0, 200, 50);
txtField.border = true;
txtField.text = wasSuccessful.toString();
function goToAdobe() {
txtField.text = "http://www.adobe.com";
getURL("http://www.adobe.com", "_self");
}
| Is This Answer Correct ? | 1 Yes | 1 No |
What are the features involved in updating a language?
which is not a benefit when adding a title in the document properties? : Adobe flash
which of the assumptions cannot be made when developing an application for intranet deployment? : Adobe flash
Hi All, I am new in flash so please help me, When I make a website on Flash & when we wright code on buttons in AS2[CODE: on(release) gotoAndStop ()], we found when we click twice on a button the page automatically switch. (means, code do not work properly). Thanks,
explain the correct way to create an alert box using geturl and javascript? : Adobe flash
I shoot underwater with a ttl strobe that does not allow you to set flash exposure compensation. How do I set fill flash with this set up? : Adobe flash
what is needed when using static text to have font outline embedded in swf file? : Adobe flash
you want to create a rectangle shape with a defined corner radius. Which tool should you use? : Adobe flash
Can you organize layers as in photoshop?
Differentiate between as2 and as3.
which two panels can be used to change the label text of a button component? : Adobe flash
Name the as3 components?