Skip to main content
Home Forums Silverlight Programming Programming with JavaScript where to put javascript code in silverlight and how to incorporate it
1 replies. Latest Post by davidezordan on June 8, 2009.
(0)
TheRekz
Member
4 points
40 Posts
06-08-2009 12:54 PM |
I have the following javascript code in my silverlight project, which is located inside a .js called Video.js. My question is that what should I do in my other files so that this java script code is used along with the application. More importantly I want the document.onmousemove to work. My goal here is so that I can open a popup window when the mouse is at a certain coordinate.. is the code correct? Please correct it if it's wrong. var xCoor; var yCoor; document.onmousemove = manageVideo; function manageVideo() { alert("Hello World"); xCoor = window.event.clientX; yCoor = window.event.clienty; var elm = document.getElementById("media"); var pop = document.getElementById("popup"); if (xCoor == 100 && yCoor == 100) { pop.isOpen = "true" document.body.style.cursor = 'wait' elm.Visibility = "Visible"; elm.Play(); } else{ pop.isOpen = "false" document.body.style.cursor = 'cursor' elm.Visibility = "Collapsed"; elm.Stop(); } }
davidezo...
Contributor
5682 points
871 Posts
06-08-2009 1:27 PM |
Hi,
read this article about Silverlight and JavaScript Interop Basics.