Skip to main content
August 4, 2010
Question

how to embed different swf movies dynamically

  • August 4, 2010
  • 1 reply
  • 981 views

I am developing a web site with .net and there is a page named loadanymovie.aspx

I want to call the swf movie file name dynamically by code (by querystring, such as  : www.mysite.com/loadanymovie.aspx?moviename=1)

i used following code for this :

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Len(Request.QueryString("st")) > 0 Then

            firmasec.Items.FindByValue(Request.QueryString("st").ToString).Selected = True


            Dim lc As New LiteralControl

            lc.Text = "<embed align=""middle"" allowfullscreen=""false"" allowscriptaccess=""sameDomain"" bgcolor=""#333333""" + _

                      "  height=""700"" name=""main1004"" pluginspage=""http://www.adobe.com/go/getflashplayer""" + _

                      "  quality=""high"" src=""swfs/" + Request.QueryString("moviename").ToString + ".swf" + """ type=""application/x-shockwave-flash"" width=""1000""></embed>"

            PlaceHolder1.Controls.Add(lc)

        Else

        End If

    End Sub

this code works and doesnt produce any error. But i cannot see the movie at internet explorer. (i can see it at chrome browser)

any idea?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 4, 2010

If you are having differences between browsers, it will most likely be an issue with your embedding code.  I don't know what the latest trend is in embedding code, but what you show is suspect as it appears to use only an <embed> tag.  What you probably need to do is have Flash publish  an html page for you that you know displays in all browsers, and then create your dynamic embedding code using that as your guide.

August 4, 2010

i am a bit confused because i have no problem with other flash movies while surfing at the internet or my developments.

Yes you are probably right, explorer 8 cannot implement embed tags.