How to Communicate with JavaScript?

Answers were Sorted based on User's Feedback



How to Communicate with JavaScript?..

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

How to Communicate with JavaScript?..

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

How to Communicate with JavaScript?..

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

How to Communicate with JavaScript?..

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

How to Communicate with JavaScript?..

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

Post New Answer

More Flash Action Scripting Interview Questions

which is an advantage of selecting a flash player version in publish settings before beginning a project? : Adobe flash

0 Answers  


Is it possible to create document or folder from flash? if yes then how?

6 Answers  


How do you start a graphic animation at a specific frame?

3 Answers  


what is needed when using static text to have font outline embedded in swf file? : Adobe flash

0 Answers  


How to write a program to show the external actionscript?

0 Answers  






where is the data pulled by a load variables function stored? : Adobe flash

0 Answers  


which keyword is used to attach methods and properties to a class? : Adobe flash

0 Answers  


can flash .swf movies be very time consuming to edit? : Adobe flash

0 Answers  


when does the accessibility . Isactive () method return true? : Adobe flash

0 Answers  


what is the effect on the instances of a symbol if the symbol itself is changed? : Adobe flash

0 Answers  


Do you know what does reference means in actionscript?

0 Answers  


What does reference means in actionscript?

0 Answers  


Categories