<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UC&#039;s Corner &#187; flash</title>
	<atom:link href="http://yussi.nl/index.php/tag/flash/feed" rel="self" type="application/rss+xml" />
	<link>http://yussi.nl</link>
	<description>Yussi Ariefiyono</description>
	<lastBuildDate>Fri, 25 Jun 2010 12:57:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>embedding flash in server control</title>
		<link>http://yussi.nl/index.php/embedding-flash-in-server-control.html</link>
		<comments>http://yussi.nl/index.php/embedding-flash-in-server-control.html#comments</comments>
		<pubDate>Mon, 29 Jun 2009 14:10:00 +0000</pubDate>
		<dc:creator>yussi ariefiyono</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">/post/embedding-flash-in-server-control-aspx.aspx</guid>
		<description><![CDATA[
Problem:


When you got your website (aspx website), especially when you already put url rewriting, you want to embed flash ( doesnt matter if its swf or flv)
You need to have relative path, starting with (&#34;~/&#34; ) in the url.


Solution: 
you can put the code in your server control, so it will be easier to integrate
FlashPlayer.ascx
&#60;object&#160; <a href="http://yussi.nl/index.php/embedding-flash-in-server-control.html" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong>
</p>
<p>
When you got your website (aspx website), especially when you already put url rewriting, you want to embed flash ( doesnt matter if its swf or flv)<br />
You need to have relative path, starting with (<strong>&quot;~/&quot;</strong> ) in the url.
</p>
<p>
<strong>Solution: </strong><br />
you can put the code in your server control, so it will be easier to integrate</p>
<p><strong>FlashPlayer.ascx</strong><br />
<em>&lt;object&nbsp; classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0&quot; width=&quot;745&quot; height=&quot;181&quot; id=&quot;header&quot; align=&quot;middle&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param name=&quot;allowFullScreen&quot; value=&quot;false&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param&nbsp; name=&quot;movie&quot; value=&#39;&lt;asp:Literal ID=&quot;Literal1&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;&#39; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;embed src=&#39;&lt;asp:Literal ID=&quot;Literal2&quot; runat=&quot;server&quot;&gt;&lt;/asp:Literal&gt;&#39; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;745&quot; height=&quot;181&quot; name=&quot;header&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; allowFullScreen=&quot;false&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.adobe.com/go/getflashplayer_nl&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/object&gt;</em>
</p>
<p>
and in the <strong>FlashPlayer.ascx.cs</strong>
</p>
<p>
&nbsp; protected void Page_Load(object sender, EventArgs e)<br />
&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Literal1.Text = Page.ResolveUrl(&quot;<strong>~/</strong>yourpath&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Literal2.Text = Page.ResolveUrl(&quot;<strong>~/</strong>yourpath&quot;);<br />
&nbsp;&nbsp; }
</p>
<p>
and you will got flash playing! enjoy ^_^
</p>
<p>
================================
</p>
<p>
thank to <a href="http://www.linkedin.com/in/marcneeft" target="_blank">Marc Neeft</a>, hereby his input :
</p>
<p>
<span class="text">it would be even more powerful when you add the movieUrl, width and height as properties of the usercontrol:</p>
<p>private string movieUrl = String.empty;<br />
<br />
private int movieWidth = 0;<br />
<br />
private int movieHeight = 0;</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
<br />
{<br />
<br />
// todo: check if url, width and height are set, if not, throw exception</p>
<p>Literal1.Text = Page.ResolveUrl(movieUrl);<br />
<br />
Literal2.Text = Page.ResolveUrl(movieUrl);<br />
<br />
Literal3.Text = movieWidth;<br />
<br />
Literal4.Text = movieHeight;<br />
<br />
} </p>
<p>public string MovieUrl<br />
<br />
{<br />
<br />
get { return movieUrl; }<br />
<br />
set { movieUrl = value; }<br />
<br />
}</p>
<p>public string MovieWidth<br />
<br />
{<br />
<br />
get { return movieWidth; }<br />
<br />
set { movieWidth = value; }<br />
<br />
}</p>
<p>public int MovieHeight<br />
<br />
{<br />
<br />
get { return movieHeight; }<br />
<br />
set { movieHeight = value; }<br />
<br />
}</p>
<p>Of course you need to add the 2 extra literals and the errorchecking yourself but you get the general idea.</p>
<p>&lt;uc:FlashPlayer id=&quot;Flashplayer&quot; runat=&quot;server&quot; MovieUrl=&quot;~/flash</span><br />
<span class="text">/movie.flv</span><br />
<span class="text">&quot; MovieWidth=&quot;300&quot; MovieHeight=&quot;150&quot; /&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://yussi.nl/index.php/embedding-flash-in-server-control.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
