About Brandon Drake Expertise I can answer questions regarding the Graphics object, file access, general optimization, printing (on paper), user controls, program mathematics, the registry, creating macros, processes, and fundamental or basic questions. I have made a few asp.net pages but I do not know the language extensively. I have not done much work with databases but I have created my own database systems.
Experience I have been programming with visual basic for 6 years. In all I have written programs in about 8 programming languages, although, I only know about 3 well. I have written a few applications but mainly I like to write programs for fun.
Question Hello !
(my english is not very fluent but i will try to be clear)
software : microsoft visual basic 2005 express edition.
My problem is that i want to recover a flash object"SWFlash1" which
refers to a flash movie created in the class form1 in another class.In
this new class i want to affect the attribute of the flash object
(SWFlash1) and the value that it contains (the flash movie) to a new
object or variable ("swf" for exemple) which can refer to the flash
movie.
i tried functions and delegates to send SWFlash1 to the another class i
don't have errors and no warnings but my flash movie doesn't works.
this the program/code include in class (form1):
Friend WithEvents SWFlash1 As AxShockwaveFlashObjects.AxShockwaveFlash
<CLSCompliant(False)> Public swf_test As
AxShockwaveFlashObjects.AxShockwaveFlash
<System.Diagnostics.DebuggerStepThrough()> Public Sub
InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager =
New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.SWFlash1 = New AxShockwaveFlashObjects.AxShockwaveFlash
CType(Me.SWFlash1,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'SWFlash1
'
Me.SWFlash1.Enabled = True
Me.SWFlash1.Location = New System.Drawing.Point(0, 0)
Me.SWFlash1.Name = "SWFlash1"
Me.SWFlash1.OcxState =
CType(resources.GetObject("SWFlash1.OcxState"),
System.Windows.Forms.AxHost.State)
Me.SWFlash1.Size = New System.Drawing.Size(192, 192)
Me.SWFlash1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.Window
Me.ClientSize = New System.Drawing.Size(800, 600)
Me.Controls.Add(Me.SWFlash1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Form1"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "SCAR"
CType(Me.SWFlash1,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
swf_test = SWFlash1
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
SWFlash1.Width = 800
SWFlash1.Height = 600
SWFlash1.Movie = Application.StartupPath & "\scar.swf"
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Exclamation, "Chargement")
End Try
End Sub
this the program/code included in the new class "decod":
Public swf As AxShockwaveFlashObjects.AxShockwaveFlash
PublicSubNew(ByVal SWFlash1 As AxShockwaveFlashObjects.AxShockwaveFlash)
Me.swf = New AxShockwaveFlashObjects.AxShockwaveFlash
Me.swf = SWFlash1
EndSub
and if i write that code in the new class for example:
swf.SetVariable("speed", speed)
i wish to recover the speed on the flash movie but it doesn't works.
its urgent !
i waits your answer and thank you in advance.
Answer Zouh,
I have never used flash in VB. I searched the internet though and found some documents that you may want to look at.