<?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>Murtuza Topiwalla &#187; Flash</title>
	<atom:link href="http://www.sowebme.com/murtaza/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sowebme.com/murtaza</link>
	<description>Blog about flash, movies, travel and more! Email me at yankeedoodles[at]hotmail[dot]com for anything you want to add!</description>
	<lastBuildDate>Thu, 28 Jan 2010 07:23:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Bitmap and Bitmap Data.</title>
		<link>http://www.sowebme.com/murtaza/2010/01/bitmap-and-bitmap-data/</link>
		<comments>http://www.sowebme.com/murtaza/2010/01/bitmap-and-bitmap-data/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 06:41:48 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[bitmap]]></category>
		<category><![CDATA[bitmapdata]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[january 2010]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=143</guid>
		<description><![CDATA[Bitmap is a display object which wraps the BitmapData within it. The BitmapData is the array of data used to form the pixels in the image. Now a point to note here is that you can't use use the BitmapData of one state of a movieclip and expect it to gather all the frames. What it does is it takes a photograph sort of and gets its pixel data value.]]></description>
			<content:encoded><![CDATA[<p>I thought today I would post something about Bitmap and Bitmap Data in AS3.</p>
<p>Bitmap is a display object which wraps the BitmapData within it. The BitmapData is the array of data used to form the pixels in the image. Now a point to note here is that you can&#8217;t use use the BitmapData of one state of a movieclip and expect it to gather all the frames. What it does is it takes a photograph sort of and gets its pixel data value.</p>
<p>Ok so all this may seem like a lot of text. Let&#8217;s just jump into flash and figure this out. Let&#8217;s start by creating a movie clip with a text field inside of it.</p>
<p><a href="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy01.jpg"><img class="alignleft size-medium wp-image-144" style="border: 0px initial initial;" title="Sample copy " src="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy01-300x220.jpg" alt="sample copy" width="300" height="220" /></a>Give this movieclip an instance name of mc and hit f9 to get into the actionscript panel.</p>
<p>Now we begin by declaring our variables and defining their properties.</p>
<div id="_mcePaste"><em><span style="color: #ffff99;">var newBitmap : Bitmap;</span></em></div>
<div id="_mcePaste"><em><span style="color: #ffff99;">var bd:BitmapData=new BitmapData(mc.width,mc.height,true,0&#215;000)</span></em></div>
<div>the parameters we pass in when constructing a BitmapData are:<br />
1) width- compulsory<br />
2) height -compulsory<br />
3) alpha<br />
4) fill colour</div>
<div>We now proceed  to tell the bitmap what data to copy and then to tell the bitmap which bitmapdata it should be wrapping.</div>
<div>
<div><span style="color: #ffff99;"><em>bd.draw(mc)</em></span></div>
<div><span style="color: #ffff99;"><em>newBitmap = new Bitmap(bd);</em></span></div>
</div>
<div>we turn on smoothing for the bitmap (this is quite processor heavy for complex images but for this illustration I would like it)</div>
<div><em><span style="color: #ffff99;">newBitmap.smoothing=true;</span></em></div>
<div>finally we add it to the display list</div>
<div><span style="color: #ffff99;"><em>addChild(newBitmap);</em></span></div>
<div>lets compile and check it out</div>
<div><a href="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy02.jpg"><img class="size-medium wp-image-145 alignnone" title="Bitmap Copy2" src="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy02-300x158.jpg" alt="" width="300" height="158" /><br />
</a> So now obviously we have a new display object called newBitmap. This has the display object properties and methods attached to it.</div>
<div>But there is one drawback of using the Bitmap to copy movieclips you already have drawn out or text or whatever.</div>
<div>Here it is.<a href="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy03.jpg"><img class="alignleft size-medium wp-image-146" title="BitMapcopy03" src="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/BitMapcopy03-299x242.jpg" alt="" width="299" height="242" /></a> The image you have just created is indeed a Bitmap. If you scale it or whatever, the image is going to be pixelated. Comparing it to vector graphics or the text you just copied, there is a noticeable difference in quality.</p>
<p>There are of course uses of this to create objects which wont ever scale. I think its really handy. Besides, this is just the first step in many more things you can do with the bitmapdata. I will try and post more about it. It is truly an amazing class. I am going to try and have another post about this in the near future.</p>
<p>Download the source here <a href="http://www.sowebme.com/murtaza/wp-content/uploads/2010/01/bitmap_data.zip">Bitmap-Data example</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2010/01/bitmap-and-bitmap-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTPS with Flash</title>
		<link>http://www.sowebme.com/murtaza/2009/09/https-with-flash/</link>
		<comments>http://www.sowebme.com/murtaza/2009/09/https-with-flash/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 00:17:43 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Serverside]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[crossdomain]]></category>
		<category><![CDATA[https]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=124</guid>
		<description><![CDATA[HTTPS calls from flash which do not lie on the same server.]]></description>
			<content:encoded><![CDATA[<p>Recently and a long time back, sometime in December 08 to be exact, I had the rare challenge of making HTTPS calls from a swf which did not sit on the same server. I faced quite a bunch of problems and I still do. But I do have some solutions which I have found on the internet from reliable sources, though not tried and tested, which may solve your issues should you come across this situation at any time.</p>
<p>The &#8220;allow-access-from&#8221; has an attribute called secure which very few people use.</p>
<p>Adobe says :  <strong><br />
</strong></p>
<dl>
<dt id="allow-access-from-secure"><strong>secure</strong></dt>
<dd>[HTTPS and Sockets only, optional] When false, allows an HTTPS policy file to grant access to a request coming from an HTTP source. The default for URL policy files is true, providing only HTTPS sources permission. Using false is <span style="color: #ff0000;"><strong>not recommended</strong></span>. Socket policy files  use a default of false.</dd>
</dl>
<p>So a sample would be</p>
<pre>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;

&lt;cross-domain-policy&gt;
	&lt;<strong>allow-access-from</strong> <strong>domain="*.somedomain.com"</strong> <strong>secure="false"</strong>/&gt;
&lt;/cross-domain-policy&gt;</pre>
</pre>
<p>The second option which I believe will never give you any problems is using a proxy. This works even when you cannot get a crossdomain file onto the server you are feeding from.</p>
<p>A sample PHP Proxy is as follows:<br />
<code><br />
&lt;?php<br />
$dataURL = "http://www.sowebme.com/murtaza/feed/";<br />
//note that this does not follow redirects.<br />
readfile($dataURL);<br />
?><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/09/https-with-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Singtel Youth Portal &#8211; tons of prizes to be won!</title>
		<link>http://www.sowebme.com/murtaza/2009/08/singtel-youth-portal-tons-of-prizes-to-be-won/</link>
		<comments>http://www.sowebme.com/murtaza/2009/08/singtel-youth-portal-tons-of-prizes-to-be-won/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 09:59:37 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Contests]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Serverside]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[august]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[no purchase required]]></category>
		<category><![CDATA[september]]></category>
		<category><![CDATA[singtel]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=78</guid>
		<description><![CDATA[Singtel is giving away 8 Tickets to the Formula One™ race with chauffeured limo ride, 8 LG handsets and 8 Free Exclusive Passes to Zouk's Formula One™ week special parties to 1 super-friendly person!]]></description>
			<content:encoded><![CDATA[<div id="attachment_77" class="wp-caption alignright" style="width: 363px"><a href="http://www.sowebme.com/murtaza/wp-content/uploads/2009/08/screengrab.jpg"><img class="size-medium wp-image-77" title="SingTel Refer your friends and Win!" src="http://www.sowebme.com/murtaza/wp-content/uploads/2009/08/screengrab-300x190.jpg" alt="SingTel Youth Portal" width="353" height="222" /></a><p class="wp-caption-text">SingTel Youth Portal</p></div>
<p>Hey everyone, the new SingTel Youth portal is up and running at <a title="http://home.singtel.com/youth" href="http://home.singtel.com/youth">http://home.singtel.com/youth</a> and to kick things off, Singtel is giving away 8 Tickets to the Formula One™ race with chauffeured limo ride, 8 LG handsets and 8 Free Exclusive Passes to Zouk&#8217;s Formula One™ week special parties to 1 super-friendly person!</p>
<p>That&#8217;s massive.</p>
<p>Good luck to everyone around and have fun referring!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/08/singtel-youth-portal-tons-of-prizes-to-be-won/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going to attend TAC 2009</title>
		<link>http://www.sowebme.com/murtaza/2009/08/going-to-attend-tac-2009/</link>
		<comments>http://www.sowebme.com/murtaza/2009/08/going-to-attend-tac-2009/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 02:02:24 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[tac]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=69</guid>
		<description><![CDATA[Hello! TAC 2009 is coming up on the 14th and 15th of  September. This year though we wont be seeing Lee Brimelow, we will be hearing speakers such as Peter Elst, Andre Michelle, Marco Casario. Its going to be during the fasting month of Ramadan though, but I&#8217;m sure it will be cool. Alrite here [...]]]></description>
			<content:encoded><![CDATA[<p>Hello!<br />
TAC 2009 is coming up on the 14th and 15th of  September. This year though we wont be seeing Lee Brimelow, we will be hearing speakers such as Peter Elst, Andre Michelle, Marco Casario. Its going to be during the fasting month of Ramadan though, but I&#8217;m sure it will be cool.</p>
<p>Alrite here is the site you should visit for more information : <a title="The Action Script Conference" href="http://www.tac.sg" target="_blank">www.tac.sg</a></p>
<p><a href="http://tac.sg/" title="The Actionscript Conference 2009"><img src="http://tac.sg/wp-content/uploads/2009/07/tac09-200x200.jpg" alt="The Actionscript Conference 2009" title="The Actionscript Conference 2009" width="200" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/08/going-to-attend-tac-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Super in AS3 &#8211; An explanation.</title>
		<link>http://www.sowebme.com/murtaza/2009/07/superas3/</link>
		<comments>http://www.sowebme.com/murtaza/2009/07/superas3/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 09:19:00 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[super]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=46</guid>
		<description><![CDATA[Hello, today I was wondering what the super keyword in AS3 did while they were used in classes. Initially it seemed like it was the constructor for the base class. However after exploring a bit deeper, I realised that there was more to super than it seemed. So here is a scenario. ChildClass.as extends ParentClass.as [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, today I was wondering what the super keyword in AS3 did while they were used in classes. Initially it seemed like it was the constructor for the base class. However after exploring a bit deeper, I realised that there was more to super than it seemed.</p>
<p>So here is a scenario.</p>
<p><em><span style="color: #ffcc99;">ChildClass.as extends ParentClass.as which requires a string in its constructor. </span></em><br />
SO, in this case a super is required from ChildClass to pass in the string value that its base class requires. This is extremely important during events and is really apparent then. I will explain how to use, and manipulate events to your advantage in some other post.</p>
<p>Getting back to super, I also found out, not like its some great accomplishment, that you can run other items from parent, just so long as it does not conflict with the required parameters. So in the above scenario, ChildClass.as can run some other independent functions BEFORE running the super. So what you may ask. But this means you can actually append and modify the value of the super from its parent before you pass the super into the parent. IE, say for example your ParentClass wants to always add &#8221; good bye&#8221; to the end of the string to be passed into its constructor, you could have a function that returns that value to your child and then from your child pass it to the constructor. Yeah, I am lost in my own post too!</p>
<p>Luckily, I found a person who made some kind of really really great example. I don&#8217;t remember who it was though, as I was searching all over for an example. If you are the owner please contact me for your credits here. Meanwhile, you guys can download the modified super example here.</p>
<p><a href="http://www.sowebme.com/murtaza/wp-content/uploads/2009/07/Super.zip">Download link for super example</a></p>
<p>Feel free to leave any comments and ask anything you want here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/07/superas3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Passing parameters from a holder to loaded swf</title>
		<link>http://www.sowebme.com/murtaza/2009/07/passing-parameters-from-a-holder-to-loaded-swf/</link>
		<comments>http://www.sowebme.com/murtaza/2009/07/passing-parameters-from-a-holder-to-loaded-swf/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 07:52:57 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flashVars]]></category>

		<guid isPermaLink="false">http://www.sowebme.com/murtaza/?p=21</guid>
		<description><![CDATA[Well there are many instances when we need to pass flashVars from the html to a preloader and then on to a loaded movieClip. This is how I&#8217;ve done it. HTML &#8211; &#60;param name=&#8221;FlashVars&#8221; value=&#8221;baseURL=http://www.sowebme.com/murtaza&#8221; /&#62; For AC_RunActiveContent.js users, There should be 3 instances where you would place this For swfObject users, there will be [...]]]></description>
			<content:encoded><![CDATA[<p>Well there are many instances when we need to pass flashVars from the html to a preloader and then on to a loaded movieClip.</p>
<p>This is how I&#8217;ve done it.</p>
<p>HTML &#8211;</p>
<p><span style="color: #ffcc99;">&lt;param name=&#8221;FlashVars&#8221; value=&#8221;baseURL=http://www.sowebme.com/murtaza&#8221; /&gt;</span><br />
For AC_RunActiveContent.js users, There should be 3 instances where you would place this<br />
For swfObject users, there will be only once.</p>
<p>Flash &#8211;<br />
holder mc will get the paramets from FlashVars in stage.loaderInfo.parameters.whatevernameditemhere</p>
<p>But a more robust way to ensure you have it and that you&#8217;ve not jumped the gun, use an event to ensure its ready.<br />
An example is as follows:</p>
<p><span style="color: #ffcc99;">root.loaderInfo.addEventListener(Event.COMPLETE, func);<br />
var parameters:Object=new Object();<br />
function func(e:Event):void {<br />
//Do what you want here<br />
}</span></p>
<p>Now to load another swf we will be using it to append to the current url we are already loading. So the above code will now look like</p>
<p><span style="color: #ffcc99;">root.loaderInfo.addEventListener(Event.COMPLETE, func);<br />
var parameters:Object=new Object();<br />
var loader:Loader=new Loader();<br />
function func(e:Event):void {<br />
loader.load(new URLRequest(&#8220;loadme.swf?baseURL=&#8221;+root.loaderInfo.parameters.baseURL));<br />
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);<br />
addChild(loader);<br />
}</span><br />
<span style="color: #ffcc99;">function swfLoaded(e:Event):void {<br />
//More code here<br />
}</span></p>
<p>So that about sums up how you can use flashVars and pass them along. Note one thing though. If you are using classes, you can use stage.loaderInfo instead of root.loaderInfo</p>
<p>You can download the source file for <a href="http://www.sowebme.com/murtaza/wp-content/uploads/2009/07/passingFlashVars.zip">passing flash vars</a></p>
<p>Have fun and please post your comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/07/passing-parameters-from-a-holder-to-loaded-swf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open new browser window from flash.</title>
		<link>http://www.sowebme.com/murtaza/2009/07/open-new-browser-window-from-flash/</link>
		<comments>http://www.sowebme.com/murtaza/2009/07/open-new-browser-window-from-flash/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 04:00:58 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[new browser window]]></category>

		<guid isPermaLink="false">http://sowebme.com/murtaza/?p=7</guid>
		<description><![CDATA[Hey, In this first tutorial today we are going to talk about how to use javascript to open a new browser window from flash. The code that is required is fairly simple actually. var request:String = &#8220;javascript: window.open(&#8216;http://www.sowebme.com/murtaza&#8217;,'win&#8217;,'height=400,width=600,toolbar=no,scrollbars=yes&#8217;); void(0)&#8221;; var url:URLRequest = new URLRequest(request); navigateToURL(url, &#8220;_self&#8221;); Within your HTML housing the flash, you are going [...]]]></description>
			<content:encoded><![CDATA[<p>Hey,<br />
In this first tutorial today we are going to talk about how to use javascript to open a new browser window from flash.<br />
The code that is required is fairly simple actually.</p>
<p><span style="color: #ffcc99;">var request:String =<br />
&#8220;javascript: window.open(&#8216;http://www.sowebme.com/murtaza&#8217;,'win&#8217;,'height=400,width=600,toolbar=no,scrollbars=yes&#8217;); void(0)&#8221;;</span></p>
<p><span style="color: #ffcc99;">var url:URLRequest = new URLRequest(request);</span></p>
<p><span style="color: #ffcc99;">navigateToURL(url, &#8220;_self&#8221;);</span></p>
<p>Within your HTML housing the flash, you are going to need the parameter &#8220;AllowScriptAccess&#8221; set to &#8220;always&#8221;.</p>
<p>Feel free to download the working files here:<a href="http://sowebme.com/murtaza/wp-content/uploads/2009/07/newWindow.zip"><br />
New Window Example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/07/open-new-browser-window-from-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First post &#8211; Introduction</title>
		<link>http://www.sowebme.com/murtaza/2009/06/introduction/</link>
		<comments>http://www.sowebme.com/murtaza/2009/06/introduction/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 07:58:20 +0000</pubDate>
		<dc:creator>Murtuza</dc:creator>
				<category><![CDATA[Leisure]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[movies]]></category>
		<category><![CDATA[soccer]]></category>
		<category><![CDATA[traveling]]></category>

		<guid isPermaLink="false">http://mtopiwalla.wordpress.com/?p=3</guid>
		<description><![CDATA[This is a brief introduction of myself and what this blog is about.]]></description>
			<content:encoded><![CDATA[<p>Hey, before I begin blogging about stuff, let me just introduce myself. Im Murtuza Topiwalla a flash developer from Singapore. I married to arwa, my wonderful wife since 2006 and I&#8217;ve got 1 kid. Im not going to write his age or I&#8217;ll have to modify this post again. I enjoy exploring new technology and playing around with new gadgets, fortunately that also constitutes part of my job.</p>
<p>Apart from work or work related activities,  I enjoy playing soccer, bowling, watching movies and traveling. I shall be blogging about any of the above and probably more. So do read and follow my blog.</p>
<p>Thanks</p>
<p>Murtuza</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sowebme.com/murtaza/2009/06/introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
