How to Communicate with JavaScript?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how can i get two different fonts in a single line

1561


how do invoke OS task through ANT?

2112


why script is client dependant.

1979


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

982


Would you tell me that what is test script? and how to write it? are there some templates?

1852






Why we use Action Script(Multimedia Flash) rather than using other scripting languages (JAVA,VB...etc) ?

2366


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?

1778


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

1623


How do you insert record into scripting using siebel crm

5066


Hi Guys, I am very new to QTP tool , In real time environment how to test the application with this tool, 1. How to load application in QTP tool 2. How to write test script in QTP. 3. In manual testing we test login box (user id , password) how can we test this kind of testing with QTP tool with examples . Please guys put some focus on my questions , real time ecperienced answers would be appreciate, advance thanks ,please guys i am expecting ur answers as soon as posible

1850


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

1767


Difference between the SAP MDM vs IBM MDM in approach, the tools used , ease in handling/implementing.

6259


how can i type the text message in compose box in yahoo mail using descriptive programming in QTP?

1735


How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.

2397


what is the Structure of an ANT file?

1751