473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FlashVars won't work in VB

I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim axShockwaveFlash As New AxShockwaveFlash

axShockwaveFlash.Location = New System.Drawing.Point(10, 10)

Me.Controls.Add(axShockwaveFlash)

axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"

axShockwaveFlash.Size = New System.Drawing.Size(400, 400)

Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"

Try

axShockwaveFlash.FlashVars = "flvurl=" & flvFileName

'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")

' The above generates an error

Catch ex As Exception

End Try

axShockwaveFlash.Play()

End Sub

When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement immediately
below that generates and error:

{"Error HRESULT E_FAIL has been returned from a call to a COM component."}
System.Exception

How do I get it to work?

Thanx in advance,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
Aug 4 '08 #1
7 5235

Try dropping the control on a form, from the toolbox, instead of creating it
in the form load event.

Dick
--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Aug 4 '08 #2
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim axShockwaveFlash As New AxShockwaveFlash

axShockwaveFlash.Location = New System.Drawing.Point(10, 10)

Me.Controls.Add(axShockwaveFlash)

axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"

axShockwaveFlash.Size = New System.Drawing.Size(400, 400)

Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"

Try

axShockwaveFlash.FlashVars = "flvurl=" & flvFileName

'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")

' The above generates an error

Catch ex As Exception

End Try

axShockwaveFlash.Play()

End Sub

When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement immediately
below that generates and error:

{"Error HRESULT E_FAIL has been returned from a call to a COM component."}
System.Exception

How do I get it to work?

Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv
Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.

Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.

Hope this helps,

Onur Güzel
Aug 4 '08 #3
Yes, that is why I did not insert the control from the Toolbox (as Dick
suggested in the previous message) - it gives all kinds of errors. What
exactly do you mean by "reference OLE Automation in COM tab to solve
error."?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:ef**********************************@34g2000h sh.googlegroups.com...
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim axShockwaveFlash As New AxShockwaveFlash

axShockwaveFlash.Location = New System.Drawing.Point(10, 10)

Me.Controls.Add(axShockwaveFlash)

axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"

axShockwaveFlash.Size = New System.Drawing.Size(400, 400)

Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"

Try

axShockwaveFlash.FlashVars = "flvurl=" & flvFileName

'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")

' The above generates an error

Catch ex As Exception

End Try

axShockwaveFlash.Play()

End Sub

When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement immediately
below that generates and error:

{"Error HRESULT E_FAIL has been returned from a call to a COM component."}
System.Exception

How do I get it to work?

Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv
Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.

Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.

Hope this helps,

Onur Güzel
Aug 4 '08 #4
On Aug 4, 7:54 pm, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
Yes, that is why I did not insert the control from the Toolbox (as Dick
suggested in the previous message) - it gives all kinds of errors. What
exactly do you mean by "reference OLE Automation in COM tab to solve
error."?

Thanx,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv"kim iraikkonen" <kimiraikkone...@gmail.comwrote in message

news:ef**********************************@34g2000h sh.googlegroups.com...
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim axShockwaveFlash As New AxShockwaveFlash
axShockwaveFlash.Location = New System.Drawing.Point(10, 10)
Me.Controls.Add(axShockwaveFlash)
axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"
axShockwaveFlash.Size = New System.Drawing.Size(400, 400)
Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"
Try
axShockwaveFlash.FlashVars = "flvurl=" & flvFileName
'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")
' The above generates an error
Catch ex As Exception
End Try
axShockwaveFlash.Play()
End Sub
When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement immediately
below that generates and error:
{"Error HRESULT E_FAIL has been returned from a call to a COM component.."}
System.Exception
How do I get it to work?
Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv

Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.

Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.

Hope this helps,

Onur Güzel
After you added "Shockwave Flash Object" in your toolbox by right-
clicking -"Choose Items" in Toolbox, also right-click your project
in Solution Explorer -"add reference", look at "COM" tab, select
"OLE Automation" to add reference, then re-try placing the flash
control.

I don't know why, after updating flash to Flash9f.ocx, rebuilding does
not work anylonger but it seems OLE Automation does.

Thanks,

Onur Güzel
Aug 4 '08 #5
That worked! At least in part. Now the line:
AxShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" & flvFileName &
"</string></arguments></invoke>"

does not give an error message, Now I have to figure out how to write a
function in Flash (don't know much about Flash). But the FlashVars still
remain blank. Strange...

--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:f9**********************************@y21g2000 hsf.googlegroups.com...
On Aug 4, 7:54 pm, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
Yes, that is why I did not insert the control from the Toolbox (as Dick
suggested in the previous message) - it gives all kinds of errors. What
exactly do you mean by "reference OLE Automation in COM tab to solve
error."?

Thanx,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv"kim iraikkonen"
<kimiraikkone...@gmail.comwrote in message

news:ef**********************************@34g2000h sh.googlegroups.com...
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim axShockwaveFlash As New AxShockwaveFlash
axShockwaveFlash.Location = New System.Drawing.Point(10, 10)
Me.Controls.Add(axShockwaveFlash)
axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"
axShockwaveFlash.Size = New System.Drawing.Size(400, 400)
Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"
Try
axShockwaveFlash.FlashVars = "flvurl=" & flvFileName
'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")
' The above generates an error
Catch ex As Exception
End Try
axShockwaveFlash.Play()
End Sub
When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement
immediately
below that generates and error:
{"Error HRESULT E_FAIL has been returned from a call to a COM
component."}
System.Exception
How do I get it to work?
Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv

Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.

Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.

Hope this helps,

Onur Güzel
After you added "Shockwave Flash Object" in your toolbox by right-
clicking -"Choose Items" in Toolbox, also right-click your project
in Solution Explorer -"add reference", look at "COM" tab, select
"OLE Automation" to add reference, then re-try placing the flash
control.

I don't know why, after updating flash to Flash9f.ocx, rebuilding does
not work anylonger but it seems OLE Automation does.

Thanks,

Onur Güzel
Aug 5 '08 #6
I was mistaken, it doesn't work! I still get the same error - it just
happened to be in Try Catch without any handler. Also, could you point me
to a resource on how I could write the function LoadFLV in Flash?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"kimiraikkonen" <ki*************@gmail.comwrote in message
news:f9**********************************@y21g2000 hsf.googlegroups.com...
On Aug 4, 7:54 pm, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
Yes, that is why I did not insert the control from the Toolbox (as Dick
suggested in the previous message) - it gives all kinds of errors. What
exactly do you mean by "reference OLE Automation in COM tab to solve
error."?

Thanx,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv"kim iraikkonen"
<kimiraikkone...@gmail.comwrote in message

news:ef**********************************@34g2000h sh.googlegroups.com...
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim axShockwaveFlash As New AxShockwaveFlash
axShockwaveFlash.Location = New System.Drawing.Point(10, 10)
Me.Controls.Add(axShockwaveFlash)
axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"
axShockwaveFlash.Size = New System.Drawing.Size(400, 400)
Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"
Try
axShockwaveFlash.FlashVars = "flvurl=" & flvFileName
'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")
' The above generates an error
Catch ex As Exception
End Try
axShockwaveFlash.Play()
End Sub
When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. Also the commented out statement
immediately
below that generates and error:
{"Error HRESULT E_FAIL has been returned from a call to a COM
component."}
System.Exception
How do I get it to work?
Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv

Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.

Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.

Hope this helps,

Onur Güzel
After you added "Shockwave Flash Object" in your toolbox by right-
clicking -"Choose Items" in Toolbox, also right-click your project
in Solution Explorer -"add reference", look at "COM" tab, select
"OLE Automation" to add reference, then re-try placing the flash
control.

I don't know why, after updating flash to Flash9f.ocx, rebuilding does
not work anylonger but it seems OLE Automation does.

Thanks,

Onur Güzel
Aug 5 '08 #7
On Aug 5, 2:11*pm, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I was mistaken, it doesn't work! *I still get the same error - it just
happened to be in Try Catch without any handler. *Also, could you pointme
to a resource on how I could write the function LoadFLV in Flash?

Thanx,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv"kim iraikkonen" <kimiraikkone...@gmail.comwrote in message

news:f9**********************************@y21g2000 hsf.googlegroups.com...
On Aug 4, 7:54 pm, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:


Yes, that is why I did not insert the control from the Toolbox (as Dick
suggested in the previous message) - it gives all kinds of errors. *What
exactly do you mean by "reference OLE Automation in COM tab to solve
error."?
Thanx,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv"kim iraikkonen"
<kimiraikkone...@gmail.comwrote in message
news:ef**********************************@34g2000h sh.googlegroups.com...
On Aug 4, 8:36 am, "Anil Gupte/iCinema.com" <anil-l...@icinema.com>
wrote:
I am trying to create a simple FlashPlayer in VB. *I used the following:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim axShockwaveFlash As New AxShockwaveFlash
axShockwaveFlash.Location = New System.Drawing.Point(10, 10)
Me.Controls.Add(axShockwaveFlash)
axShockwaveFlash.Movie = "D:\Projects\Flash\Learning\Learning-2.swf"
axShockwaveFlash.Size = New System.Drawing.Size(400, 400)
Dim flvFileName As String = "D:\Video\Clips\PoliceBikeChase.flv"
Try
axShockwaveFlash.FlashVars = "flvurl=" & flvFileName
'axShockwaveFlash.CallFunction("<invoke name=""loadFLV""
returntype=""xml""><arguments><string>" + flvFileName +
"</string></arguments></invoke>")
' The above generates an error
Catch ex As Exception
End Try
axShockwaveFlash.Play()
End Sub
When I inspect FlashVars, it shows as blank, both before and after the
statement inside Try above. *Also the commented out statement
immediately
below that generates and error:
{"Error HRESULT E_FAIL has been returned from a call to a COM
component."}
System.Exception
How do I get it to work?
Thanx in advance,
--
Anil Guptewww.keeninc.netwww.icinema.comwww.wizo.tv
Note that after adding Shockwave Flash Object control to your toolbox,
it has a bug with VS when you try to place it fails, and you need to
also reference OLE Automation in COM tab to solve error.
Formerly, i remember the problem was being solved by rebuilding
project more than one time, having flash9f, i couldn't confirm
rebuilding is a solution, but OLE Automation still works to make
Shockwave Flash Object work.
Hope this helps,
Onur Güzel

After you added "Shockwave Flash Object" in your toolbox by right-
clicking -"Choose Items" in Toolbox, also right-click your project
in Solution Explorer -"add reference", look at "COM" tab, select
"OLE Automation" to add reference, then re-try placing the flash
control.

I don't know why, after updating flash to Flash9f.ocx, rebuilding does
not work anylonger but it seems OLE Automation does.

Thanks,

Onur Güzel- Hide quoted text -

- Show quoted text -
Ok, as you added flash control to your form also with referencing OLE
Automation, as far as i know it supports SWF extensions natively and
look at "Movie" at properties window of flash control and enter sth
like: http://www.domain.com/file.swf or a local swf path.

Flash player control may not be able to play FLV files alone as it may
require a FLV player which is needed to be embedded like in popular
video sharing websites.
http://en.wikipedia.org/wiki/Flash_Video#File_formats

Hope this helps,

Onur Güzel
Aug 5 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
12899
by: Kerry Neilson | last post by:
For the past couple of months, Idle won't start when I invoke it. I am at a complete loss for why this is. When this happens, they python command line still starts, and python works fine...
3
6157
by: DFS | last post by:
I've been working around this for years (I believe), so I figured someone here might know: Why won't a crosstab query accept a value from a form reference? TRANSFORM...
7
1762
by: simon | last post by:
I have simple html(aspx) page, but vertical height won't work. Even if i had set the height of a table=100%, the table is not 100% height. I spend a lot of time(my real page is more...
3
5040
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
7
11182
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The...
1
5094
by: lexx | last post by:
Hello, I was wondering if this is possible. Can I change the value of the FlashVars parameter of an embeded swf file using a button with a javascript onClick event handler. I want a button to...
2
2959
tpgames
by: tpgames | last post by:
Two days ago, MS office Word would type JP fonts, I thought. I didn't think I was using Works. Now, it won't type in JP. Jasc Paint shop pro 8, should type JP fonts because I am using XP, according...
0
1683
colinod
by: colinod | last post by:
I have a flash file setup to play an mp3, just a simple player at the moment. the followinf code tells it what the file to play is s = new Sound(); s.loadSound("test.mp3",true);...
2
2764
by: harryusa | last post by:
Greetings all: I'm using an off the shelf uploader called MultipowUpload (see http://www.element-it.com/MultiPowUpload.aspx) a nice Flash FTP uploader. I have used it for a few years but I only...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.