article

embeding a flash movie in vb.net and using the equilivant of app.path in vb.net

Email
Submitted on: 1/1/2015 12:42:00 PM
By: Sammy Ageil (from psc cd)  
Level: Beginner
User Rating: By 5 Users
Compatibility: VB.NET
Views: 1693
 
     To show how to embed any flash (.swf) movie into any VB.Net application and how to use the equilivant of app.path in VB.Net

 
				
'To add a flash movie to any vb.net app first you need to add the shockwave flash object most likely if your system is updated it will be called flash ocx. once its added create a sub to play the movie
mine is as follow:
Private Sub playflash()

With AxShockwaveFlash1
'my control name
.Stop() 'make sure you control the running of the movie
..Movie = "C:\Documents and Settings\MySide _
\My Documents\Visual Studio _ Projects\WindowsApplication8\rose.swf"
'now there are three ways to locate the movie
'(1)
'The file HAS TO BE IN THE BIN DIRECTORY
'or this code with result in an EXCEPTION!
.Movie = String.Concat _(Application.StartupPath, _ "\rose.swf")
'(2) is like using the App.path in VB6, The file HAS TO BE IN THE BIN DIRECTORY as well
.Movie =System.Windows.Forms.Application. _ _StartupPath & "\rose.swf"
'(3) my fav of all
.playing = True
End With
End Sub
'now we get it to play.
you can download this code from http://ecreationscanada.com/downloads.asp?vb read the .txt file and you will have it working! Good luck


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.