Getting PHP Variable into Animate HTML5
Hello, I am trying to figure out how to get the value of a PHP variable into an Animate HTML5 app to run an if/else statement. I have a PHP document that holds the Canvas and Javascripts to run the application. In the PHP file I define a variable before loading any of the Javascript or Canvas files:
<? $watch = "Yes" ?> //Which is really a result from a DB query.In my ActionsScript within Animate I have the following code. This code is supposed to show a button if the PHP variable is equal to Yes, else hide it if not.
var watch = <?php echo json_encode($watch); ?>;
if (watch=="Yes"){
this.next_btn.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler(){
this.parent.parent.gotoAndPlay(2);
}
}else{
this.next_btn.visible = !this.next_btn.visible;
}When I run it on my webserver it hangs. So I am not sure if I have the right code here for getting the PHP variable. Any help would greatly be appreciated.
