关于在vb.net里调用flash mx的shockwaveflash
我总是无法像调用flash5的控件一样调用flash mx的。
我的程序如下:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意:以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents f1 As AxShockwaveFlashObjects.AxShockwaveFlash
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.f1 = New AxShockwaveFlashObjects.AxShockwaveFlash()
CType(Me.f1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'f1
'
Me.f1.Enabled = True
Me.f1.Location = New System.Drawing.Point(208, 64)
Me.f1.Name = "f1"
Me.f1.OcxState = CType(resources.GetObject("f1.OcxState"), System.Windows.Forms.AxHost.State)
Me.f1.Size = New System.Drawing.Size(192, 192)
Me.f1.TabIndex = 8
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.ActiveCaption
Me.ClientSize = New System.Drawing.Size(696, 389)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.f1})
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.f1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
f1.Movie = "F:\work\005\source\gyro\bin\flash\1_1_1.swf"
End Sub
End Class
--------------
运行后出现
-------------------
未处理的“System.NullReferenceException”类型的异常出现在 axinterop.shockwaveflashobjects.dll 中
其他信息:Object reference not set to an instance of an object.
----------------------
请高手们赐教。