<?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>theDeSilva.com&#187; Flash</title>
	<atom:link href="http://www.thedesilva.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedesilva.com</link>
	<description>Andrew de Silva</description>
	<lastBuildDate>Tue, 26 Apr 2011 20:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Removing Context Menu from Flash Player</title>
		<link>http://www.thedesilva.com/2008/09/removing-context-menu-from-flash-player/</link>
		<comments>http://www.thedesilva.com/2008/09/removing-context-menu-from-flash-player/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 22:38:07 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript 2]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe flash player]]></category>
		<category><![CDATA[context menu]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=67</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/>Here&#8217;s how to show or hide the default items in the Flash Player context menu. If showMenu is set to true (the default), all context menu items appear. If showMenu is set to false, only Settings and About Adobe Flash Player items appear. Note that in actionscript 3 showMenu has been replaced by showDefaultContextMenu // [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/><p>Here&#8217;s how to show or hide the default items in the Flash Player context menu. If showMenu is set to true (the default), all context menu items appear. If showMenu is set to false, only Settings and About Adobe Flash Player items appear. Note that in actionscript 3 showMenu has been replaced by<br />
showDefaultContextMenu</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// Actionscript 2</span>
&nbsp;
<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">showMenu</span>=<span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #808080; font-style: italic;">// Actionscript 3</span>
&nbsp;
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">showDefaultContextMenu</span>=<span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2008/09/removing-context-menu-from-flash-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Workaround] Flash Bitmap maximum width and height</title>
		<link>http://www.thedesilva.com/2008/08/workaround-flash-bitmap-maximum-width-and-height/</link>
		<comments>http://www.thedesilva.com/2008/08/workaround-flash-bitmap-maximum-width-and-height/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 16:43:57 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[Height]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[maximum]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=55</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/>In my recent posting on Flash Bitmap maximum width and height, I blog about how Flash bitmapData object has a maximum width and height of 2880 pixel . I was recently contacted by John Keyton who was really nice to point a work around created by Ronald Losbañes that would allow you to create a [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/><p>In my recent <a href="http://www.thedesilva.com/2008/08/bitmap-maximum-width-and-height/" target="_self">posting</a> on Flash Bitmap maximum width and height, I blog about how Flash bitmapData object has a maximum width and height of 2880 pixel . I was recently contacted by John Keyton who was really nice to point a work around created by <a href="http://underdevelopment.maravillaclan.net/?p=7" target="_blank">Ronald Losbañes</a> that would allow you to create a bitmapData object that is bigger than 2880 pixel in height and width . Here&#8217;s the workaround from <a href="http://underdevelopment.maravillaclan.net/?p=7" target="_blank">Ronald Losbañes</a> site.</p>
<blockquote><p>The trick is to “kidnap” a BitmapData object from a loaded image with dimension over the limit of 2880 pixels (Which flash allows. Huh! Yes Flash can actually handle bitmaps larger the the limit. It just doesn’t let you create one.).</p>
<p>It’s simple. Create a dummy image with the dimension you need. Save it and make it accessible to Flash. Dynamically load it using ActionScript. And take the loader object’s BitmapData object. That’s why I termed it “kidnap”. We are actually just taking the child of the parent object(loader object), which is the BitmapData, and use it like we build it ourselves.</p></blockquote>
<p><span id="more-55"></span></p>
<p>Here&#8217;s the actionscript ,</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// 1. Create an image loader and</span>
<span style="color: #000000; font-weight: bold;">var</span> DummyImageLoader:Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader;
&nbsp;
<span style="color: #808080; font-style: italic;">// 2. Assign a function to “kidnap” the BitmapData object</span>
DummyImageLoader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, DummyImageOnComplete<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// 3. Load the image with the preferred dimension</span>
<span style="color: #000000; font-weight: bold;">var</span> DummyImageRequest:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>“dummy_image.<span style="color: #006600;">jpg</span>”<span style="color: #66cc66;">&#41;</span>;
DummyImageLoader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>DummyImageRequest<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> DummyImageOnComplete<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">var</span> DummyImageBitmap = Bitmap<span style="color: #66cc66;">&#40;</span>DummyImageLoader.<span style="color: #006600;">content</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #808080; font-style: italic;">// “kidnap” the BitmapData object</span>
    <span style="color: #000000; font-weight: bold;">var</span> ValidBitmapData:BitmapData = DummyImageBitmap.<span style="color: #006600;">bitmapData</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// you can now use ValidBitmapData to draw any element larger than 2880×2880</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> InvalidBitmapData:BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3000</span>, <span style="color: #cc66cc;">3000</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Big thanks to John to pointing out the link to me and <a href="http://underdevelopment.maravillaclan.net/?p=7" target="_blank">Ronald Losbañes</a> for the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2008/08/workaround-flash-bitmap-maximum-width-and-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Bitmap maximum width and height</title>
		<link>http://www.thedesilva.com/2008/08/bitmap-maximum-width-and-height/</link>
		<comments>http://www.thedesilva.com/2008/08/bitmap-maximum-width-and-height/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 16:11:33 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[flash actionscript]]></category>
		<category><![CDATA[image size]]></category>
		<category><![CDATA[maximum height]]></category>
		<category><![CDATA[maximum width]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=48</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/>An updated post has been posted , check it out at [Workaround] Flash Bitmap maximum width and height Recently I was working with a flash image zoom application and realized that after launching the application it kept crashing when it was loading the larger image, I&#8217;ve checked every where and nothing seems to be wrong. [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><br/><div class="redbox">An updated post has been posted , check it out at <a title="[Workaround] Flash Bitmap maximum width and height" href="http://www.thedesilva.com/2008/08/workaround-flash-bitmap-maximum-width-and-height/ " target="_self">[Workaround] Flash Bitmap maximum width and height</a></div>
<p>Recently I was working with a flash image zoom application and realized that after launching the application it kept crashing when it was loading the larger image, I&#8217;ve checked every where and nothing seems to be wrong. File name , image size , file location were all correct. After awhile I realized that the maximum width and maximum height of a BitmapData object is 2880 pixels.  The image that I was working with was way more bigger than that.  Anything that has a height and width that is larger than 2880 will cause flash unable to redraw the bitmap.</p>
<p><span id="more-48"></span></p>
<p>Here&#8217;s what Adobe has to say about the maximum width and height</p>
<blockquote><p><strong>Note:</strong> The maximum dimensions of a bitmap in Flash Player is limited to 2880 pixels in either direction (width or height). If you attempt to create a BitmapData instance that is larger than this restriction, the Bitmap will not be created. This limit is in place to keep people from creating Flash movies that gobble up the client&#8217;s RAM. A bitmap that is 2880 x 2880 pixels, will use roughly 32MB of RAM.</p></blockquote>
<p>Also interestingly enough</p>
<blockquote><p>An instance of the BitmapData object can eat up the viewer&#8217;s memory quickly. Every pixel in a bitmap is stored using 4 bytes of memory (1 byte per color channel ARGB). If you create a bitmap that is 500 x 500 pixels in size, it will take up close to 1MB of RAM. If you don&#8217;t need a BitmapData object anymore, then it is good practice to free the memory that the bitmap is using. The BitmapData class has a method that enables you to do just this, the dispose() method.</p></blockquote>
<p>So the solution to remove unwanted BitmapData object is to use the following</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">myBitmap.<span style="color: #006600;">dispose</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2008/08/bitmap-maximum-width-and-height/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

