Control used to embed SWFObject enabled Flash movies in a Page.

Namespace:  GrannetDotNet.Web.UI.WebControls
Assembly:  GrannetDotNet.Web.UI.WebControls (in GrannetDotNet.Web.UI.WebControls.dll)

Syntax

Visual Basic (Declaration)
Public Class SwfObject _
	Inherits Control
C#
public class SwfObject : Control
Visual C++
public ref class SwfObject : public Control
JavaScript
GrannetDotNet.Web.UI.WebControls.SwfObject = function();

Type.createClass(
	'GrannetDotNet.Web.UI.WebControls.SwfObject',
	Control);

Examples

Example #1: Add an SwfObject control to a Page using markup.

 Copy Code
            <gdn:SwfObject       
              ID="swfObj1"
              AllowScriptAccess="Always" 
              BaseUrl="~/App_Support/Flash/"
              runat="server"
              MovieUrl="~/App_Support/Flash/player.swf" 
              Height="200px" 
              Width="328px"    
              UseDynamicPublishing="false"
              UseExpressInstallation="true">
              <FlashVars>
                <gdn:FlashVar Name="file" Value="video.flv"/>
                <gdn:FlashVar Name="image" Value="preview.jpg"/>        
              </FlashVars>
              <AlternateContentTemplate>
                <p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>        
              </AlternateContentTemplate>
            </gdn:SwfObject>
             

Example #2: Add an SwfObject control to a Page using managed code.

 Copy Code
             SwfObject                 swfObj1        = null;
             SwfObjectAlternateContent swfObjContent1 = null;    
             
             /* Create SwfObject control */
             swfObj1                          = new SwfObject();
             swfObj1.ID                       = "swfObj1";
             swfObj1.AllowScriptAccess        = SwfScriptAccess.Always;
             swfObj1.BaseUrl                  = "~/App_Support/Flash/";
             swfObj1.MovieUrl                 = "~/App_Support/Flash/player.swf";
             swfObj1.Height                   = Unit.Parse("200px");
             swfObj1.Width                    = Unit.Parse("328px");        
             swfObj1.UseDynamicPublishing     = false;
             swfObj1.UseExpressInstallation   = true;
             
             /* Add FlashVars */
             swfObj1.FlashVars.Add(new FlashVar("file", "video.flv"));
             swfObj1.FlashVars.Add(new FlashVar { Name = "image", Value = "preview.jpg" });
             
             /* Create Alternate Content Template */
             swfObjContent1                   = new SwfObjectAlternateContent();
             swfObjContent1.Controls.Add(new LiteralControl("<p><a href=\"http://get.adobe.com/flashplayer\">Get Flash</a> to see this player.</p>"));
             swfObj1.AlternateContentTemplate = swfObjContent1;
             
             /* Add the SwfObject to a PlaceHolder on the Page */
             this.plchGdnSwfObject.Controls.Add(swfObj1);
             

Inheritance Hierarchy

System..::.Object
  System.Web.UI..::.Control
    GrannetDotNet.Web.UI.WebControls..::.SwfObject

See Also