Image.Source + Permission Denied?

Hello, I am currently working with the December CTP of WPF/E and I am attempting to dynamically set an Image source via some JavaScript.

Within my .xaml I have the following snippet:

<Imagex:Name="Image1"Source="Images/Test.png"Canvas.Left="5"Canvas.Top="10" />

Within my JavaScript, I have:

var image1 = activeXControl.findName("Image1");

if (image1 !=null)

{

alert(image1.source);

image1.source = "Images/Test2.png";

}

When I run the code, I receive a JavaScript error that says "Permission Denied" however, the SDK document states I should be able to set the Source property. Is this just a CTP bug or am I doing something wrong? I placed the "alert(image1.source);" line in to verify that I was accessing the correct object and I am in fact am.

Thank you for your help,

Alan

[2299 byte] By [AlanZ] at [2008-2-23]
# 1

I'm not aware of any problems in this area. Source property/attribute is settable. We don't raise any exceptions such as "permission denied" so something is occurring with the actual browser/javascript when attempting to access the image source.
Are you running this from a web server over http or directly from disk?

-mark
Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-4 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...
# 2

I am running this directly from the disk.

I have other JavaScript after the line that is causing the problem and that code runs fine as long as I comment out the the offending line.

AlanZ at 2007-9-4 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...
# 3

Hi Mark,

Thank you for your efforts. However, I get the code to work. I'm not entirely sure what it was. I'll continue to look at it and if I figure out why, i will share my discovery.

Thanks,

Alan

AlanZ at 2007-9-4 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Developer Issues...