How to Communicate with JavaScript?



How to Communicate with JavaScript?..

Answer / dindayal dhakar

1. In previous versions of Flash, JavaScript communication
was done via fscommand. This was a buggy and complex
technology. In fact, it was so bad that most developers
actually preferred to put their JavaScript function calls
inside the getURL function. This got the job done, but was
far from ideal.
2. Flash 8 introduces a ground-breaking new way to
integrate Flash with its host called the External
Interface. This allows Flash/JavaScript integration to be
more powerful and stable. It is also very easy to use.
External Interface offers Flash 8 Developers the following
advantages: it's easier to implement, it allows for
synchronous communication, and it supports sending a wider
selection of data types, including objects.
3. Fscommand didn't allow for synchronous communication.

4. The External Interface allows you to call a JavaScript
function and receive a return value.
5. Fscommand allowed you to send primitive data types as
arguments in the function calls. Now, with External
Interface, you can send complex objects as arguments. In
example 2 below, we are passing the entire
system.capabilities object back to JavaScript.

<script language="JavaScript">
function getLocation() {
return window.location.toString();
}
</script>

import flash.external.ExternalInterface;
function displayPageLocation():Void {
locationDisplay.text = ExternalInterface.call
("getLocation");
}
locationButton.addEventListener("click",
mx.utils.Delegate.create(this,
displayPageLocation));

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Scripts AllOther Interview Questions

a="10.20.30.1" replace 1 with 45 in python using reg ex

0 Answers   HCL,


What are the advantages and disadvantages of Descriptive programing and Object repository in QTP??

1 Answers   Impetus,


how do u define in ur build.xml If I need to execute a task before executing my task?

0 Answers  


I have installed QTP version 9.0. I have installed Mozilla firefox version 2.0. But QTP "Record and Run settings" in WEB tab shows FIREFOX 1.5 in drop down to run session begins. So QTP does not record anything which I type in firefox. How can i recognise firefox 2.0 and how can i update browser version in QTP?

0 Answers  


In sap script, created 1 form but when its went to production system , client want some changes in 1 (ex - addrss) window, what we will do?

0 Answers  


What is URL Loader.?

1 Answers  


If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?

0 Answers  


please send the scrpit driver program

1 Answers  


What is a Scripting Language?

2 Answers  


what we will test in functionality testing

1 Answers  


why script is client dependant.

0 Answers  


'IMP' is not recognized as an internal or external command, operable program or batch file. this is the error message i am getting when i importing dmp for the backup. where is the problem?

3 Answers   Mobilink,


Categories