File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Flex and the fly likes calling javascript  function  from ActionScript Method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Flex
Reply Bookmark "calling javascript  function  from ActionScript Method" Watch "calling javascript  function  from ActionScript Method" New topic
Author

calling javascript function from ActionScript Method

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2231

Hi ,
I am calling javascript function "isReady()" from ActionScript as shown using ExternalInterface call method

code inside Test.html


code inside MXML File :



I am calling this javascript function "isReady()" from ActionScript as shown .

Please tell me is

1. ExternalInterface.call("isReady"); // I am calling this on a button click of MXML , Is this correct parameter inside the call ??
2. Please tell me what other configuration do i need to do to access the HTML ??


Thanks .



Save India From Corruption - Anna Hazare.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


1. ExternalInterface.call("isReady"); // I am calling this on a button click of MXML , Is this correct parameter inside the call ??

If this is the name of your function then yes.


2. Please tell me what other configuration do i need to do to access the HTML ??

Just what comes out the box.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
jp roberts
Greenhorn

Joined: Feb 19, 2009
Posts: 14
Is it also possible to call an function within a swf file (mxml application) from javascript embedded in a html page?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes. ExternalInterface will do this too.
 
 
subject: calling javascript function from ActionScript Method
 
Threads others viewed
Stack overflow error in Javascript
Flex 3 : Action script related code inside the Flex Application
Using Flex Performance Profiler for Profiling Flex with Java Applications
Problem in passing a String with '&' to URL
jvascript String object-replace
MyEclipse, The Clear Choice