How to run a flash (.swf) file in an ASP.NET page?

1

I have an ASP.NET WebForms application and I want to know how to execute a flash (.swf) file in a div of an ASP.NET page.

    
asked by anonymous 04.12.2014 / 21:43

2 answers

0

It worked as follows:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
        id="painelv3" width="100%" height="100%"
        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
        <param name="movie" value="meuArquivoFlash.swf" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#ffffff" />
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="FlashVars" value="<% =flashvar %>" />
        <embed src="<% =sUrl %>" quality="high" bgcolor="#ffffff"
            width="800" height="800" name="meuArquivoFlash" align="middle"
            play="true"
            loop="false"
            quality="high"
            allowScriptAccess="sameDomain"
            type="application/x-shockwave-flash"
            pluginspage="http://www.adobe.com/go/getflashplayer">
        </embed>
    </object>

In the code-behind of the aspx page I declare the variables flashvar (parameters passed to the swf file) and sUrl (file path).

    public string sUrl = "";
    public string flashvar = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            sUrl = "meuArquivoFlash.swf";
            flashvar = "cdUsuario=1&cdDestino=2";
        }
    }
    
09.12.2014 / 12:37
0

You need to set an HTML object tag on your page that references your swf file. link

Here's an example: link

    
06.12.2014 / 01:06