Canvas[] cI = new Canvas[9];
MediaElement[] me = new MediaElement[9];
int blockSizeW = 97;
int blockSizeH = 97;
void InitBoard()
{
int nx = 0;
for (int ix = 0; ix < 3; ix++)
for (int iy = 0; iy < 3; iy++)
{
nx = (ix * 3) + iy;
me[nx] = new MediaElement();
me[nx].Height = 300;
me[nx].Width = 300;
me[nx].Stretch = Stretch.UniformToFill;
RectangleGeometry r = new RectangleGeometry();
r.Rect = new Rect((ix * blockSizeW), (iy * blockSizeH), blockSizeW, blockSizeH);
me[nx].Clip = r;
me[nx].Source = new Uri("Wildlife.wmv", UriKind.Relative);
me[nx].SetValue(Canvas.TopProperty, Convert.ToDouble(iy * blockSizeH * -1));
me[nx].SetValue(Canvas.LeftProperty, Convert.ToDouble(ix * blockSizeW * -1));
cI[nx] = new Canvas();
cI[nx].Width = blockSizeW;
cI[nx].Height = blockSizeH;
cI[nx].Children.Add(me[nx]);
cI[nx].SetValue(Canvas.NameProperty, "C" + nx.ToString());
cI[nx].MouseLeftButtonDown += new MouseButtonEventHandler(Page_MouseLeftButtonDown);
if (nx < 8)
GameContainer.Children.Add(cI[nx]);
}
}
and it gives me this error:
Line: 53
Error: Unhandled Error in Silverlight 2 Application SlidingBlocks.xap
Code: 4001
Category: MediaError
Message: AG_E_NETWORK_ERROR
I already tested the video and it is Silverlight compatible