470,848 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Embedding flash

Hi there.

I'm trying to embed a flash movie in my .NET 2.0 form. However, all I
see is a white square, no movie is playing. I have done the following:

* added a reference to the ShockwaveFlash COM object
(c:\windows\system32\macromed\flash\swflash.ocx),
* dragged it onto my form
* set the Movie property (the movie plays correctly if a double click it
from explorer)
* called the Play() method

but the movie does not show. It says "Movie not loaded..." if I right
click on the flash area on the running form.

Can anyone help? Code follows:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TestApp
{
public partial class Form1 : Form
{
AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1;

private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typ eof(Form1));
this.axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash();
((System.ComponentModel.ISupportInitialize)
(this.axShockwaveFlash1)).BeginInit();
this.SuspendLayout();
//
// axShockwaveFlash1
//
this.axShockwaveFlash1.Enabled = true;
this.axShockwaveFlash1.Location = new System.Drawing.Point(75, 153);
this.axShockwaveFlash1.Name = "axShockwaveFlash1";
this.axShockwaveFlash1.OcxState =
((System.Windows.Forms.AxHost.State)
(resources.GetObject("axShockwaveFlash1.OcxState") ));
this.axShockwaveFlash1.Size = new System.Drawing.Size(192, 192);
this.axShockwaveFlash1.TabIndex = 0;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 357);
this.Controls.Add(this.axShockwaveFlash1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)
(this.axShockwaveFlash1)).EndInit();
this.ResumeLayout(false);

}
public Form1()
{
InitializeComponent();

System.ComponentModel.ComponentResourceManager resources =
new System.ComponentModel.ComponentResourceManager(typ eof(Form1));
this.axShockwaveFlash1.Enabled = true;
this.axShockwaveFlash1.Location = new System.Drawing.Point(37, 126);
this.axShockwaveFlash1.Name = "axShockwaveFlash1";
this.axShockwaveFlash1.OcxState =
((System.Windows.Forms.AxHost.State)
(resources.GetObject("axShockwaveFlash1.OcxState") ));
this.axShockwaveFlash1.Size = new System.Drawing.Size(192, 192);
this.axShockwaveFlash1.TabIndex = 1;
this.axShockwaveFlash1.Movie = "d:\\temp\\mov.swf";
this.axShockwaveFlash1.Play();
}

}
}

Cheers,

Mike
May 30 '06 #1
0 2893

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Darren | last post: by
3 posts views Thread by b_naick | last post: by
3 posts views Thread by Buggyman | last post: by
3 posts views Thread by Ollie Riches | last post: by
3 posts views Thread by fnustle | last post: by
1 post views Thread by Chris72205 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.