locked
Embedding flash player in custom control RRS feed

  • Question

  • User-1159791214 posted

    How is the embedding for swf player is done in custom control...

    protected override void RenderContents(HtmlTextWriter output)
            {
                string str = "<embed src=MYFLASHPLAYER.swf width=" + Width + " height=" + Height + " allowscriptaccess=always allowfullscreen=true flashvars=file=" + this.Url + ">";
                output.Write(str);
                
            }


    currently MYFLASHPLAYER.swf resides in websites application's root..I want to centralize things..


    Friday, December 4, 2009 12:46 PM

Answers

  • User-16411453 posted

    It's alot more work than that.

    I'll give you a free version of my flash control, already build, and give you a key for it. Jusr private message me for the key.

    http://www.redcopper.net/redCopper-Software/redCopperFlashObject/Download-the-FlashObject-Server-Control-Free-Trial.aspx

    This is the heart and soul of the control. All of the elements have been considered in the making of it. [] is a property, that you can assign


    lit_AC_RunActiveContent = New LiteralControl
    		With lit_AC_RunActiveContent
    			.Text = "" & vbCrLf & _
    			"<script language=""javascript"" type=""text/javascript"">" & vbCrLf & _
    			"	if (AC_FL_RunContent == 0) {" & vbCrLf & _
    			"		alert(""This page requires AC_RunActiveContent.js."");" & vbCrLf & _
    			"	} else {" & vbCrLf & _
    			"		AC_FL_RunContent(" & vbCrLf & _
    			"			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" & [Flash_Codebase] & "'," & vbCrLf & _
    			"			'width', '" & [Width].Value.ToString & "'," & vbCrLf & _
    			"			'height', '" & [Height].Value.ToString & "'," & vbCrLf & _
    			"			'src', '" & e_Flash_MovieURL_NoExt & "'," & vbCrLf & _
    			"			'quality', '" & e_Flash_Quality & "'," & vbCrLf & _
    			"			'pluginspage', 'http://www.macromedia.com/go/getflashplayer'," & vbCrLf & _
    			"			'align', '" & e_Flash_Align & "'," & vbCrLf & _
    			"			'play', '" & [Flash_AutoPlay] & "'," & vbCrLf & _
    			"			'loop', '" & [Flash_LoopMovie] & "'," & vbCrLf & _
    			"			'scale', '" & e_Flash_Scale & "'," & vbCrLf & _
    			"			'wmode', '" & e_Flash_wMode & "'," & vbCrLf & _
    			"			'devicefont', 'false'," & vbCrLf & _
    			"			'id', '" & [Flash_MovieID] & "'," & vbCrLf & _
    			"			'bgcolor', '" & [Flash_BGColor] & "'," & vbCrLf & _
    			"			'name', '" & [Flash_MovieID] & "'," & vbCrLf & _
    			"			'menu', '" & [Flash_Menu] & "'," & vbCrLf & _
    			"			'allowFullScreen', '" & [AllowFullScreen] & "'," & vbCrLf & _
    			"			'allowScriptAccess','" & e_AllowScriptAccess & "'," & vbCrLf & _
    			"			'movie', '" & e_Flash_MovieURL_NoExt & "'," & vbCrLf & _
    			"			'salign', '" & e_Flash_sAlign & "'" & vbCrLf & _
    			"		); //end AC code" & vbCrLf & _
    			"}" & vbCrLf & _
    			"</script>" & vbCrLf
    		End With
    		td_Container.Controls.Add(lit_AC_RunActiveContent)
    
    		lit_FlashObject = New LiteralControl
    		With lit_FlashObject
    			.Text = "" & vbCrLf & _
    			"				<noscript>" & vbCrLf & _
    			"					<object id=""" & [Flash_MovieID] & """ classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000""" & vbCrLf & _
    			"					codebase = ""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" & [Flash_Codebase] & "" & vbCrLf & _
    			"					height=""" & [Height].Value.ToString & """ style=""text-align: " & e_Movie_Alignment & ";"" width=""" & [Width].Value.ToString & """>" & vbCrLf & _
    			"						<param name=""allowScriptAccess"" value=""" & e_AllowScriptAccess & """ />" & vbCrLf & _
    			"						<param name=""allowFullScreen"" value=""" & [AllowFullScreen] & """ />" & vbCrLf & _
    		 "						<param name=""wmode"" value=""" & e_Flash_wMode & """ />" & vbCrLf & _
    			"						<param name=""salign"" value=""" & e_Flash_sAlign & """ />" & vbCrLf & _
    			"						<param name=""movie"" value=""" & e_Flash_MovieURL & """ />" & vbCrLf & _
    			"						<param name=""quality"" value=""" & e_Flash_Quality & """ />" & vbCrLf & _
    			"						<param name=""bgcolor"" value=""" & [Flash_BGColor] & """ />" & vbCrLf & _
    			"						<embed align=""middle"" allowfullscreen=""" & [AllowFullScreen] & """ allowscriptaccess=""" & e_AllowScriptAccess & """ bgcolor=""" & [Flash_BGColor] & """" & vbCrLf & _
    			"						height=""" & [Height].Value.ToString & """ name=""" & [Flash_MovieID] & """ pluginspage=""http://www.macromedia.com/go/getflashplayer""" & vbCrLf & _
    			"						quality=""" & e_Flash_Quality & """ src=""" & e_Flash_MovieURL & """ type=""application/x-shockwave-flash""" & vbCrLf & _
    			"						width=""" & [Width].Value.ToString & """></embed>" & vbCrLf & _
    			"					</object>" & vbCrLf & _
    			"				</noscript>" & vbCrLf
    		End With
    		td_Container.Controls.Add(lit_FlashObject)
    


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 5, 2009 2:36 AM