Quantcast
Channel: Adobe Community : Popular Discussions - Archived Discussions
Viewing all articles
Browse latest Browse all 21156

placeLoadStringContentInApplicationSandbox & ReferenceError: Can't find variable:

$
0
0

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">
<head>
<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>


<script>
function calledFromAS() {
            alert('Hello from ActionScript');
}
</script>

etc...

 

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>';
showExerciseLink.loadString(htmlString);

 

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...

Thanks

Kyle


Viewing all articles
Browse latest Browse all 21156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>