I want to use jquery functions into flash for html5 game I am building. What I tried to do is add the following lines, and then use simple jquery function, but it seems not loaded, because I get the error: $ is not defined
My code, which is in the first frame of the main timeline, is:
var head = document.getElementsByTagName('head')[0]; var file = "http://code.jquery.com/jquery-1.11.0.min.js"; var ref = document.getElementsByTagName('script')[0]; var js = document.createElement('script'); js.src = file; ref.parentNode.insertBefore(js, ref); console.log(head.outerHTML); console.log($(document).height()); console.log($(document).height());
The result I see in the console log, is the following:
What is wrong with that? and what I have to do so I can use jquery?
TIA