Thanks again h_classen, here is a similar example you may be able to help me with:
What if I have a function, playVid() that does something like:
- Sets SRC attribute of HTML5 video
- Checks if video has cached enough to play
- Sets playhead to 0:0:10
- Plays video
Then I want to call it on multiple scene loads, or from button clicks, like so:
playVid(big_buck_bunny); //plays bunny movie
playVid(elephants_dream); //plays elephant movie
In the case of button clicks, it seems you are saying I give the button a class of “big_buck_bunny” or “elephants_dream” and fetch the class as part of my function, is that correct?
But what if I want to attach the function to a scene load?