Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 87055

HTML5 Canvas: Calling a parent function

$
0
0

Hey guys

 

I'm currently banging my head against a brick wall trying to call a parent function with the HTML5 Canvas.

 

I have the following code on the stage:

 

function fromStage()

{

  console.log("This is on the stage");

}

fromStage();

 

This correctly outputs that message to the console in the browser.

 

However, I have a button within a movie clip that I want to call this function from, my code in that movie clip is as follows:

 

this.theButton.addEventListener("click", fl_MouseClickHandler.bind(this));

this.theButton.name = "theButton";

 

function fl_MouseClickHandler(e)

{

  this.parent.fromStage();

}

 

However, this doesn't appear to be working, any ideas?

 

Thanks


Viewing all articles
Browse latest Browse all 87055

Trending Articles



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