0

I know there are ways to invoke javascript inside the html wrapper template for the flex application using ExternalInterface, but is it possible to reference an external html page?

3 Answers 3

2

JavaScript, generally, operates on the page that is loaded/renderered in a browser. It sounds like you want to run a JavaScript function on a page that isn't currently loaded/renderered in the browser. This would not be possible.

You might be able to do something with an embedded/hidden iframe in the html wrapper that loads your external page hidden from view. Then ExternalInterface should be able to access the HTML Wrapper which can access the iFrame.

Sign up to request clarification or add additional context in comments.

Comments

1

If you know the name of the other page/tab, use ExternalInterface to call a function on your current page which then calls a function on a "sister" page/tab. If the other page is not yours, or is on a different domain, you may be out of luck :(

How to call a function in separate named window:

new_window = window.open("page2.php", "window2", "height=120");
new_window.test();

Sample taken from: http://www.ozzu.com/programming-forum/call-javascript-function-from-another-window-t54343.html

Comments

0

i think its not possible to reference an external html page. you call function in AS3

ExternalInterface.call("MyFun"); 

in html wrapper file of flex within javascript you have to define function MyFun

 function MyFun()
    {
    ............
    ..........
    }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.