Skip to main content

Microsoft Silverlight

Answered Question where to put javascript code in silverlight and how to incorporate itRSS Feed

(0)

TheRekz
TheRekz

Member

Member

4 points

40 Posts

where to put javascript code in silverlight and how to incorporate it

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(); } }

davidezordan
davidezo...

Contributor

Contributor

5682 points

871 Posts

Silverlight MVP
Answered Question

Re: where to put javascript code in silverlight and how to incorporate it

Hi,

read this article about Silverlight and JavaScript Interop Basics.

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities