AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
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.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > VB.NET/flash

Topic: VB.NET



Expert: Brandon Drake
Date: 5/5/2006
Subject: VB.NET/flash

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.

http://forums.devshed.com/flash-help-38/how-do-i-combine-flash-with-visual-basic...

http://www.actionscripts.org/forums/showthread.php3?t=2007



I hope this is helpful,

Brandon Drake

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.