2 Replies Latest reply on May 20, 2009 3:42 PM by voomstudio.com

    placeLoadStringContentInApplicationSandbox & ReferenceError: Can't find variable:


      Going a little nuts now so all help welcome. Adobe Air 1.5 Ajax/Html Application


      I have an html file with the following


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <title>Choose My Day</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <script type="text/javascript" src="js/AIRAliases.js"></script>

      <script type="text/javascript" src="js/AIRIntrospector.js"></script>

      <script type="text/javascript" src="js/intentControl.js"></script>

      function calledFromAS() {
                  alert('Hello from ActionScript');



      Inside one of my intentControl javascript file I have create a new htmlLoader


      var showExericeLink = new air.HTMLLoader();

      showExerciseLink.x         = 200;
      showExerciseLink.y         = 60;
      showExerciseLink.width      = 60;
      showExerciseLink.height     = 80;
      showExerciseLink.placeLoadStringContentInApplicationSandbox = true;
      showExerciseLink.paintsDefaultBackground = false;


      var htmlString = '<div style="background: red; width: 100%;" onClick="calledFromAS()"; return false;"> </div>';


      As I now have access to the applications sandbox, can someone please tell me how I can call the functioncalledFromAS() method from the onClick method in my htmlString? Better still, being able to call methods already instantiated in the included intentControl.js file.


      Is this possible? - must be! But I'm just not sure how to piece together the calls from the newly created htmlLoader object to reference the javascript methods of the app location through the app's sandbox.


      Please help...really starting to get over this...