views:

17

answers:

1

Hi, I need help writing actionScript code. I'm not an actionScript developer and have been trying to get this to work for hours. The requirement is a script that receives a parameter via javascript. The parameter is a url for a remote html web page. The script needs to load the contents of that html page into a string variable and then call a javascript function passing it the html as parameter. Any help will be appreciated.

+1  A: 

Are you using Flash as an HTML-loading mediator? You could use better AJAX techniques like the available JavaScript libraries out there: jQuery, Dojo, PrototypeJS, Mootools.

But if you need Flash to process something on the HTML first, you can use a simple URLLoader or URLStream. You will need to attach the appropriate events to respond to the COMPLETE event of the content load, and possible IOErrors handlers would be recommended to add as well.

After that, to pass it out to JavaScript you can use the ExternalInterface.

bigp