[Help]Using SWF Files in webbrowser

Posts 1–9 of 9 · Page 1 of 1
[Help]Using SWF Files in webbrowser

Excuse me but I need help for running swf files through the web browser
It seems just putting the url doesn't working...

I want my swf file to run in the web browser while it is on my resources.
anyone knows these code?

Info : the SWF files are the games in y8 to be played in offline
Create a html file like this:

Code:
<html>
<body>

<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

</body>
</html>
Replace 'somefilename.swf' with the name of the swf file. Save it as 'whatever.html' in the same place as the SWF file and navigate to the html through the web browser:
Code:
WebBrowser1.Navigate("C:\whatever.html")
If you don't know how to extract the file from resources, use:
Code:
IO.File.WriteAllBytes("pathHere", My.Resources.ResourceName)
You may also just set the documents text to what master said and then navigate to "about:blank". Thus, you won't have to create a html file.
Quote Originally Posted by Blubb1337 View Post
You may also just set the documents text to what master said and then navigate to "about:blank". Thus, you won't have to create a html file.
I swear I already said that But my post isn't even there. And you don't need any navigation, just set the documentText of the browser to that HTML
Quote Originally Posted by Jason View Post


I swear I already said that But my post isn't even there. And you don't need any navigation, just set the documentText of the browser to that HTML
Well, somehow, it did only work after navigating

But nevermind...this should be solved...
Why don't you use a Shockwave control?
Perhaps he wants to try something new and use a webbrowser? Or perhaps he hasn't found the workaround for the Shockwave component not working on 64-bit compiled applications. It's really his call and we (Blubb, Master and Me) are just here to help.
I personally like the idea of creating the HTML during runtime,

[highlight=vbnet]
WebBrowser1.Navigate("about:blank")
Dim Document1 As System.Windows.Forms.HtmlDocument = CType(WebBrowser1.Document, System.Windows.Forms.HtmlDocument)
Document1.Write("html here")
'I have not tested it, for some reason I remember having issues using embed within the htmldocument when done this way.


[/highlight]
Quote Originally Posted by NextGen1 View Post
I personally like the idea of creating the HTML during runtime,

[highlight=vbnet]
WebBrowser1.Navigate("about:blank")
Dim Document1 As System.Windows.Forms.HtmlDocument = CType(WebBrowser1.Document, System.Windows.Forms.HtmlDocument)
Document1.Write("html here")
'I have not tested it, for some reason I remember having issues using embed within the htmldocument when done this way.


[/highlight]
You don't actually have to write to the HTML Document, you can simply set the webbrowser's DocumentText and aloha, we have action!
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.
Talk with us