Tags: | Categories: Blog Posted by admin on 3/9/2009 5:54 PM | Comments (4)

As a programmer I am not very interested in the Macromedia Flash, the main reason is that I am not a very good designer, and flash is all for artistic people.

Today I would like to share a webcontrol to for flash, just reference in any page and pass the property FileName, you can add as many properties as you want to the class, if you want, you can send me your improvements

using System;

System;

using System.Collections.Generic;

System.Collections.Generic;

using System.ComponentModel;

System.ComponentModel;

using System.Text;

System.Text;

using System.Web;

System.Web;

using System.Web.UI;

System.Web.UI;

using System.Web.UI.WebControls;

System.Web.UI.WebControls;

using System.Drawing;

System.Drawing;

using System.Security.Permissions;

System.Security.Permissions;

using System.Collections;

System.Collections;

namespace CJControl

{

/*[AspNetHostingPermission(SecurityAction.Demand,

Level = AspNetHostingPermissionLevel.Minimal),

AspNetHostingPermission(SecurityAction.InheritanceDemand,

Level=AspNetHostingPermissionLevel.Minimal),*/

CJControl

{

/*[AspNetHostingPermission(SecurityAction.Demand,

Level = AspNetHostingPermissionLevel.Minimal),

AspNetHostingPermission(SecurityAction.InheritanceDemand,

Level=AspNetHostingPermissionLevel.Minimal),*/

/*[AspNetHostingPermission(SecurityAction.Demand,

Level = AspNetHostingPermissionLevel.Minimal),

AspNetHostingPermission(SecurityAction.InheritanceDemand,

Level=AspNetHostingPermissionLevel.Minimal),*/

[DefaultProperty("Text"),

ToolboxData("<{0}:FlashControl runat=\"server\"> </{0}:FlashControl>")]

public class FlashControl : WebControl

{

[Bindable(true)]

[Category("Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

"Text"),

ToolboxData("<{0}:FlashControl runat=\"server\"> </{0}:FlashControl>")]

public class FlashControl : WebControl

{

[Bindable(true)]

[Category("Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

"<{0}:FlashControl runat=\"server\"> </{0}:FlashControl>")]

public class FlashControl : WebControl

{

[Bindable(true)]

[Category("Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

public class FlashControl : WebControl

{

[Bindable(true)]

[Category("Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

true)]

[Category("Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

"Appearance")]

[DefaultValue("Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

"Extending the Flash control")]

[Localizable(true)]

public virtual String FileName

{

get

true)]

public virtual String FileName

{

get

public virtual String FileName

{

get

get

{

if (ViewState["FileName"] == null)

return ("");

return ((string)ViewState["FileName"]);

}

set

if (ViewState["FileName"] == null)

return ("");

return ((string)ViewState["FileName"]);

}

set

return ("");

return ((string)ViewState["FileName"]);

}

set

return ((string)ViewState["FileName"]);

}

set

set

{

ViewState["FileName"] = value;

}

}

public virtual string WIDTH

{

get

"FileName"] = value;

}

}

public virtual string WIDTH

{

get

public virtual string WIDTH

{

get

get

{

if (ViewState["WIDTH"] == null)

return ("");

return ((string)ViewState["WIDTH"]);

}

set

if (ViewState["WIDTH"] == null)

return ("");

return ((string)ViewState["WIDTH"]);

}

set

return ("");

return ((string)ViewState["WIDTH"]);

}

set

return ((string)ViewState["WIDTH"]);

}

set

set

{

ViewState["WIDTH"] = value;

}

}

public virtual string HEIGHT

{

get

"WIDTH"] = value;

}

}

public virtual string HEIGHT

{

get

public virtual string HEIGHT

{

get

get

{

if (ViewState["HEIGHT"] == null)

return ("");

return ((string)ViewState["HEIGHT"]);

}

set

if (ViewState["HEIGHT"] == null)

return ("");

return ((string)ViewState["HEIGHT"]);

}

set

return ("");

return ((string)ViewState["HEIGHT"]);

}

set

return ((string)ViewState["HEIGHT"]);

}

set

set

{

ViewState["HEIGHT"] = value;

}

}

public virtual string bgcolor

{

get

"HEIGHT"] = value;

}

}

public virtual string bgcolor

{

get

public virtual string bgcolor

{

get

get

{

if (ViewState["bgcolor"] == null)

return ("ffffff");

return ((string)ViewState["bgcolor"]);

}

set

if (ViewState["bgcolor"] == null)

return ("ffffff");

return ((string)ViewState["bgcolor"]);

}

set

return ("ffffff");

return ((string)ViewState["bgcolor"]);

}

set

return ((string)ViewState["bgcolor"]);

}

set

set

{

ViewState["bgcolor"] = value;

}

}

public virtual string id

{

get

"bgcolor"] = value;

}

}

public virtual string id

{

get

public virtual string id

{

get

get

{

if (ViewState["id"] == null)

return ("");

return ((string)ViewState["id"]);

}

set

if (ViewState["id"] == null)

return ("");

return ((string)ViewState["id"]);

}

set

return ("");

return ((string)ViewState["id"]);

}

set

return ((string)ViewState["id"]);

}

set

set

{

ViewState["id"] = value;

}

}

public virtual string quality

{

get

"id"] = value;

}

}

public virtual string quality

{

get

public virtual string quality

{

get

get

{

if (ViewState["quality"] == null)

return ("High");

return ((string)ViewState["quality"]);

}

set

if (ViewState["quality"] == null)

return ("High");

return ((string)ViewState["quality"]);

}

set

return ("High");

return ((string)ViewState["quality"]);

}

set

return ((string)ViewState["quality"]);

}

set

set

{

ViewState["quality"] = value;

}

}

protected override void Render(HtmlTextWriter writer)

{

if (Context != null)

{

string ToWrite = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" +

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

"quality"] = value;

}

}

protected override void Render(HtmlTextWriter writer)

{

if (Context != null)

{

string ToWrite = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" +

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

protected override void Render(HtmlTextWriter writer)

{

if (Context != null)

{

string ToWrite = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" +

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

if (Context != null)

{

string ToWrite = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" +

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

string ToWrite = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" +

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'" +

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" WIDTH='" + ViewState["WIDTH"].ToString() + "' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' id='" + ViewState["id"].ToString() + "'> " +

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" <PARAM NAME='movie' VALUE='" + ViewState["FileName"].ToString() + "'>" +

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" <PARAM NAME='quality' VALUE='" + ViewState["quality"].ToString() + "'>" +

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" <PARAM NAME='bgcolor' VALUE='" + ViewState["bgcolor"].ToString() + "'>" +

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" <EMBED src='" + ViewState["FileName"].ToString() + "' quality='high' bgcolor='" + ViewState["bgcolor"].ToString() + "' WIDTH='" + ViewState["WIDTH"].ToString() + "\' HEIGHT='" + ViewState["HEIGHT"].ToString() + "' NAME='" + ViewState["FileName"].ToString() + "' ALIGN=''" +

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>" +

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

" </OBJECT>";

writer.Write(ToWrite);

base.Render(writer);

}

}

}

}

base.Render(writer);

}

}

}

}

blog comments powered by Disqus