• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Any comments on MS Silverlight?

xoggoth

More fingers than teeth
Joined
Jul 8, 2005
Messages
17,132
Likes received
4,950
Thanks received
1,184
Location
xoggoth towers
Planning a new educational CD, mostly interactives of habitats, conservation etc.

Interactives (similar to these) have been a minor part of our previous programs but I want to do summit a bit more sophisticated this time. I would like to stick to approach of DHTML running in IE browser inside a VB.net program, nice and easy to provide updates, but have some more complex effects in mind, like an ability to zoom in realistically on part of a picture.

Could use Flash but never found it very suited to complex images. Silverlight has an image zoom facility and other features. Wondering if anyone has any general comments on it, any major problems etc. Cheers.
 
Dp will be along in the morning to tell you how fantastic it all is.
 
Go for Flash, it's much better supported and with upcoming "buy in" from mobile phone manufacturers it will become THE standard.
 
It's all fantastic.

HTH

Actually, I've never used it.
 
I'd be tempted to do the whole thing in Flash(Flex) with no HTML at all.
 
Flash is good for cartoon like animations but I always found that with complex paintings or photos, even after tracing, I was sitting there twiddling my thumbs for half a minute every time I wanted to test a change. Dunno what it was doing.
 
Actually no probs just zooming in Flash. Div moves on background image, pass zoom and coords to same image in Flash movie inside the div, does what I want I think.
 
PS IE only at mo.

Works for me on Chrome... well, it does something, which I assume means it's working :)

Not sure why though :confused:

Anyway, one thing you'll need to fix is at line 56 of zoom.html:

Code:
function mouseDown(e) {
    //get mouse x, y
    e = window.event; [B][COLOR="Red"]// this will fail[/COLOR][/B]

You need to change that to

Code:
e = e || window.event;

On browsers that implement events correctly (everything but IE) the event object is passed as an argument to the event handler; in this case you have it as the (e) on the mouseDown function, which is fine. IE, however, makes the event object a property of the window object; as this doesn't exist elsewhere, you are overwriting the event object with the value undefined. The above change is a quick way of saying "use the value of e that was passed in, or if there isn't one, use window.event" and will leave e with the correct object in a cross-browser way.

(You'll need to make the same change in a few other places too.)

Ah: it looks like Chrome shadows the true event object (passed as an argument) in the window.event property, which is why it's working there. I didn't realise they did that... learn something new every day :)
 

Advertisers

Back
Top