How to run a flash file (.swf) on one page ASP.NET?

I have an application ASP.NET WebForms and want to know how to run a flash file (.swf), in a one-page div ASP.NET.

Author: Arthur Menezes, 2014-12-04

2 answers

You need to set an HTML object tag on your page that references your swf file. http://www.w3schools.com/tags/tag_object.asp

Follows an example: https://stackoverflow.com/questions/668846/how-to-embed-a-flash-swf-file-into-asp-net

 0
Author: Luis Alexandre Rodrigues, 2017-05-23 12:37:29

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 declared 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";
        }
    }
 0
Author: Arthur Menezes, 2014-12-09 11:37:09