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.
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.
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";
}
}