<?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>Oinam&#039;s Blog &#187; Flash</title>
	<atom:link href="http://blog.oinam.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.oinam.com</link>
	<description>All about Oinam</description>
	<lastBuildDate>Fri, 17 Oct 2008 11:27:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Issue with PDO Adaptor wrt MySQL DateTime Datatypes in AMFPHP Remoting</title>
		<link>http://blog.oinam.com/2006/issue-with-pdo-adaptor-wrt-mysql-datetime-datatypes-in-amfphp-remoting/</link>
		<comments>http://blog.oinam.com/2006/issue-with-pdo-adaptor-wrt-mysql-datetime-datatypes-in-amfphp-remoting/#comments</comments>
		<pubDate>Sun, 19 Feb 2006 18:13:00 +0000</pubDate>
		<dc:creator>Brajeshwar</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=20</guid>
		<description><![CDATA[PHP, MySQL, mysqli, PDO, AmfPHP Remoting, Flash]]></description>
			<content:encoded><![CDATA[<p>Lately, during a project development involving <a href="http://www.php.net/" title="PHP 5"><span class="caps">PHP</span> 5</a>, <a href="http://www.mysql.com/" title="MySQL 5">MySQL 5</a> and <a href="http://www.amfphp.org/" title="AMFPHP 1.1"><span class="caps">AMFPHP</span> 1.1</a> Remoting, we realized that there is an issue with the <span class="caps">PDO</span> Adaptor that comes with <a href="http://www.amfphp.org/" title="AMFPHP"><span class="caps">AMFPHP</span></a> with respect to the MySQL DateTime datatypes. Well, we would like to term it more of a missing feature than a bug/issue and hope to see it included in the next release of <span class="caps">AMFPHP </span>with the updated <span class="caps">PDO</span> Adaptor bundled.</p>

<p>Basically <a href="http://www.amfphp.org/" title="AMFPHP"><span class="caps">AMFPHP</span></a> comes with various recordset adaptors depending on what database/abstraction layer you are using, like <a href="http://www.php.net/mysqli/" title="mysqli">mysqli</a>, <a href="http://www.php.net/pdo/" title="PDO"><span class="caps">PDO</span></a> etc. The adaptors that currently comes with it, do not convert datatypes correctly when returning the recordset to Flash. Selecting a datetime datatype returns a string date to flash as opposed to a date object.</p>

<p>And since the timezone offset is not included in the date string, the flash client parses the datetime with an incorrect timezone offset.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/issue-with-pdo-adaptor-wrt-mysql-datetime-datatypes-in-amfphp-remoting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>23HQ, The Flash 8 Multiple Photo Upload Feature</title>
		<link>http://blog.oinam.com/2006/23hq-the-flash-8-multiple-photo-upload-feature/</link>
		<comments>http://blog.oinam.com/2006/23hq-the-flash-8-multiple-photo-upload-feature/#comments</comments>
		<pubDate>Thu, 09 Feb 2006 18:37:44 +0000</pubDate>
		<dc:creator>Brajeshwar</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[23hq]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[filereference]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=18</guid>
		<description><![CDATA[Flash, FileReference, Multiple File Upload in Flash, Ajax]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.23hq.com/" title="23hq">23hq</a> is a web application which makes it easy to share your digital photos. They have tried to put together a mix of old and brand new ways of sharing stuff. You can share your photos via the web or with prints. You can share with blogs, use mail or subscription-based sharing and more. Share your photos with whom you want, private or public or both.</p>

<p>Recently <a href="http://www.23hq.com/" title="23hq">23hq</a> contacted us so they can implement the <a href="http://blog.oinam.com/2005/flash-8-file-upload-download/" title="multiple file upload">multiple file upload</a> feature of Flash Player 8. Finally, the result is a cool way of provinding the users the ability to upload single or multiple photo uploads and at the same time allowing them to preview uploaded photos, tag them while the remaining at still being uploaded. You will be experiencing the cool combination of Flash and <a href="http://www.adaptivepath.com/publications/essays/archives/000385.php" title="Ajax">Ajax</a>.</p>

<p><a href="http://www.23hq.com/" title="23hq">23hq</a> have a an article describing their new feature in details, <a href="http://blog.23hq.com/articles/2006/02/07/flashy-uploading/" title="Flashy Uploads">Flashy Uploads</a>. Test out their <a href="http://www.23hq.com/23/redirect/photo/upload-flash" title="Upload Feature">Upload Feature</a> or keep a tap of their discussion on the <a href="http://www.23hq.com/forums/message-view?message%5fid=397908" title="Multiple file upload with Flash">topic</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/23hq-the-flash-8-multiple-photo-upload-feature/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Join the LSD Beta</title>
		<link>http://blog.oinam.com/2006/join-the-lsd-beta/</link>
		<comments>http://blog.oinam.com/2006/join-the-lsd-beta/#comments</comments>
		<pubDate>Mon, 30 Jan 2006 20:56:40 +0000</pubDate>
		<dc:creator>Brajeshwar</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=15</guid>
		<description><![CDATA[Live Speed Dating, LSD]]></description>
			<content:encoded><![CDATA[<p>We are ready to beta test <a href="http://www.livespeedating.com/" title="Live Speed Dating"><span class="caps">LSD</span></a>, an online Live Speed Dating Application. <a href="http://www.livespeedating.com/" title="Sign Up for LSD">Sign Up</a> for the same and start <strong>LiveSpeedDating</strong> online.</p>

<p>During the first phase, the <span class="caps">LSD </span>are event-based with events lined up every 30 minutes. There will be 24/7 <span class="caps">LSD</span>s and much more in the upcoming phases of deployment.</p>

<p>Currently, during the beta, all events are set to be &#8220;Gender Neutral&#8221;, so you might get paired with your own gender. Once user count grows, we will pair you with your choice mate &#8211; male-female, male-male, female-female <em>et al</em>.</p>

<p>We are looking for US-US, cross crountry, cross continent pairing test and to see how our <span class="caps">FCS</span> Load Balancer can balance the load/bandwidth.</p>

<p>Please sign up for <a href="http://www.livespeeddating.com/" title="Live Speed Dating">Live Speed Dating</a> to enjoy this unique dating experience and if you would be able to help test out and give us feedbacks, please sign up for the mailing discussion list separately at <a href="http://list.oinam.com/lsd/" title="LSD Beta Mailing List"><span class="caps">LSD</span> Beta Mailing List</a>.</p>

<p>Please remember to check your Junk Folder as we have received notifications from subscribers informing us that the confirmation mail were caught in Junk Folders.</p>

<p><a href="http://www.brajeshwar.com/archives/2005/09/online-live-speed-dating-a-flash-media-server-application/" title="More Details about LSD">More Details about <span class="caps">LSD</span></a></p>

<p>We are open to criticism, suggestions, anything that you wish to say.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/join-the-lsd-beta/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Namespace in ActionScript 3.0</title>
		<link>http://blog.oinam.com/2006/namespace-in-actionscript-30/</link>
		<comments>http://blog.oinam.com/2006/namespace-in-actionscript-30/#comments</comments>
		<pubDate>Tue, 03 Jan 2006 09:01:01 +0000</pubDate>
		<dc:creator>Santosh</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=12</guid>
		<description><![CDATA[In general Namespaces allow for group entities like classes, objects and functions under a name. In ActionScript 3.0, Namespaces works like namespaces in an XML. It allows for the control of the visibility of class members. How to declare Namespace? namespace ; @ function @ Example namespace AddString; namespace AddNumber; // AddString function Sum(a:String,b:String):String { [...]]]></description>
			<content:encoded><![CDATA[<p>In general Namespaces allow for group entities like classes, objects and functions under a name. In ActionScript 3.0, Namespaces works like namespaces in an <span class="caps">XML.</span> It allows for the control of the visibility of class members.</p>

<p><strong>How to declare Namespace?</strong></p>

<p><code>namespace ;</code><br />
@ function @<br />
<span id="more-12"></span><br />
<strong>Example</strong></p>

<pre><code language="as">namespace AddString;
namespace AddNumber;
//
AddString function Sum(a:String,b:String):String
{
return a+b;
}  
//
AddNumber function Sum(a:Number,b:Number):Number
{
return a+b;
}  </code></pre>

<p><strong>How to use Namespace?</strong><br />
Now you can access the Namespace funtions in 2 ways.</p>


<ol>
<li>Using &#8216;use&#8217; keyword</li>
<li>Using fully qualified name (:: notation)&#8195; </li>
</ol>



<p>from the previous example we declared now we can use in 2 ways</p>

<pre><code language="as">// 1.
use AddString
Sum(&quot;santosh&quot;,&quot;kumar&quot;);
//
use AddNumber
Sum(1,2);</code></pre>

<pre><code language="as">// 2.
AddString::Sum(&quot;santosh&quot;,&quot;kumar&quot;);
AddNumber::Sum(1,2);  </code></pre>

<p>Using NameSpace, we can have same function name defined any number of times. for example function Sum is defined twice for addition of string and as well as for addition of number.</p>

<p>Let us look at the following codes</p>

<pre><code language="as">package
{
	import flash.util.trace;
	import flash.display.Sprite;
	//
	public class Addition extends Sprite
	{
		namespace AddString;
		namespace AddNumber;
		//
		public function Addition()
		{
			trace ( AddString::Sum(&quot;Hello&quot;,&quot;World&quot;));
			trace ( AddNumber::Sum(1,2));
		}
		//
		AddString function Sum(a:String,b:String):String
		{
			return a+b;
		}
		//
		AddNumber function Sum(a:Number,b:Number):Number
		{
			return a+b;
		}  
	}
}</code></pre>

<p><strong>Note</strong></p>

<p>1. If we declare namespace in package we can use same namespace name in multiple classes.</p>

<p>for e.g.</p>

<pre><code language="as">package
{
namespace X
public class A
{
  public function class A()
  {
    X::someMethod()
  }  
  X function someMethod()
  {
  } 
}
//
public class B
{
  public function class B()
  {
    X::someMethod()
  }
  X function someMethod(){
  }
 }
} </code></pre>

<p>Here, the same Namespace X is used in class A and class B</p>

<p>2. When using Namespaces you cannot specify access modifier like private, public etc</p>

<p>for e.g.<br />
  <br />
namespace X<br />
// Errror: Access specifiers not allowed in namespace attributes<br />
  X private function someMethod()<br />
  {<br />
  }</p>

<p>3. Namespaces cannot be used like C++ for declaring properties or variables</p>

<p>// Error:<br />
namespace myNamespace<br />
{<br />
  int a, b;<br />
}</p>

<p>4. The namespace of superclass can be accessed via subclass using keyword &#8216;super&#8217;</p>

<p><code>super.::</code></p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/namespace-in-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Polymorphism in ActionScript 3.0</title>
		<link>http://blog.oinam.com/2006/polymorphism-in-actionscript-30/</link>
		<comments>http://blog.oinam.com/2006/polymorphism-in-actionscript-30/#comments</comments>
		<pubDate>Sun, 01 Jan 2006 16:43:14 +0000</pubDate>
		<dc:creator>Santosh</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=11</guid>
		<description><![CDATA[Polymorphism, ActionScript 3.0]]></description>
			<content:encoded><![CDATA[<p>The term Polymorphism describes multiple possible states for a single property. And for the computers geeks, programmers, coders in us describes it as &#8220;a mechanism allowing a given function to have many different specifications, depending on the type(s) to which it is applied&#8221;.</p>

<p>More aptly in the world of <span class="caps">OOP,</span> Polymorphism is extensively used in an Inheritance relationship. It may not be wrong to point out that Polymorphism in ActionScript 2.0 was not as clear as it should have been. With ActionScript 3.0, it is being clearly demarcated with the keyword <code>Override</code>.<br />
<span id="more-11"></span><br />
Let us look at some simple sample codes</p>

<pre><code language="as">// Mammal Speech in AS3.0
package
{
	import flash.display.Sprite;
	import flash.util.trace;
	//
	public class MammalSpeech extends Sprite
	{
		public function MammalSpeech()
		{
			var mammals:Array = [new HumanBeing(), new Cat(), new Dog()];
			for each (var mammal:Object in mammals)
			{
				command(mammal);
			}
		}
		private function command(mammal:Mammal)
		{
			mammal.speak();
		}
	}    
	// Base class Mammal
	private class Mammal
	{
		public function speak()
		{
		}
	}     
	// following are derived classes
	private class Cat extends Mammal
	{
		//Override keyword used in derived compulsory to override the Base class
		public override function speak()
		{
			trace(&quot;meow!&quot;);
		}
	}
	private class Dog extends Mammal
	{
		public override function speak()
		{
			trace(&quot;woof!&quot;);
		}
	}
	private class HumanBeing extends Mammal
	{
		public override function speak()
		{
			trace(&quot;Hi I am santoshkumar spend a lot of time in programming&quot;);             }
		}
	}
}</code></pre>

<p>For the above code class Mammal is a Base class(Super) and type of Mammals like HumanBeing, Dog, Cat are derived class(Sub). It is very clear from the fact that HumanBeing, Dogs, Cats etc speak in different ways. So all derived classes must override the Base class method speak. This was an attempt to make an easy implementation of Polymorphism in ActionScript 3.0.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2006/polymorphism-in-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Access Modifiers in ActionScript 3.0</title>
		<link>http://blog.oinam.com/2005/access-modifiers-in-actionscript-30/</link>
		<comments>http://blog.oinam.com/2005/access-modifiers-in-actionscript-30/#comments</comments>
		<pubDate>Fri, 30 Dec 2005 13:47:45 +0000</pubDate>
		<dc:creator>Santosh</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=10</guid>
		<description><![CDATA[Access Modifiers, ActionScript 3.0, internal, private, public, protected]]></description>
			<content:encoded><![CDATA[<p>The Basic <strong>Access Modifiers</strong> are</p>


<ol>
<li>internal</li>
<li>private</li>
<li>public</li>
<li>protected</li>
</ol>



<p><em>internal</em> is the default access modifier which is used if no other modifier is specified. It allows internal access and package-level access. Unlike in ActionScript 2.0 where it was treated as public, <em>internal</em> is not public but internal by default in ActionScript 3.0.</p>

<p><em>private</em> is strictly private in ActionScript 3.0. Private is the most restrictive access modifier. It only allows internal access to members and it does not allow package-level access nor access from subclasses.</p>

<p><em>public</em> is the least restrictive access modifier and thus allows access from anywhere.</p>

<p><em>protected</em> allows internal access to members and access from subclasses but restricts package-level access.<br />
<span id="more-10"></span><br />
Let us look at some sample codes</p>

<pre><code language="as">package
{
	import flash.util.trace;
	import flash.display.Sprite;  
	public class A extends Sprite
	{
		public function A()
		{
			var accessB:B = new B();
			accessB.internalMethod();
			// Error: Method is protected cannot be accessed
			accessB.ProtectedMethod();
			// Error: Method is private cannot be accessed
			accessB.PrivateMethod();
			// class C inherits from class B 
			var accessC:C = new C();
			// B ProtectedMethod can be accessed via Derived class method
			// it cannot be accessed by instance 
			// Error: cannot Access via instance method 
			accessC.ProtectedMethod()
			// can be accessed only b class C
			accessC.accessProtectedMethod();
		}                     
	}
	private class B
	{
		public function B()
		{
			//ProtectedMethod();
		}
		protected function ProtectedMethod()
		{
			trace(&quot;Protected can be accessed by me and my children(subclass&quot;);
		}
		internal function internalMethod()
		{
			trace(&quot;i am internal can be accessed in Package Level&quot;);
		}
		private function PrivateMethod(){
			trace(&quot;i am Private cannot be accessed anywhere except me&quot;);
		}
	}
	private class C extends B
	{
		public function C()
		{
			// I can acess my parent ProtectedMethod
			//super.ProtectedMethod();
		}
		public function accessProtectedMethod()
		{
			super.ProtectedMethod();      
		}
	}
}</code></pre>

<p><strong>Private and Protect</strong><br />
Often Private and Protect can create some level of confusion to a Programmer evenso their difference is very subtle. In short, <strong>Protected</strong> means it is <strong>&#8220;Private to all other Classes, except for Subclass&#8221;</strong>. So, Subclasses alone can access the protected method. But when it is <strong>private</strong> even subclass cannot access it.</p>

<p><strong>Can Subclass inherit private access modifiers from Super Class?</strong><br />
No, Subclasses cannot inherit and access the private acess modidiers.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2005/access-modifiers-in-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unique, Random, Serial Movies, Image Loader</title>
		<link>http://blog.oinam.com/2005/unique-random-serial-movies-image-loader/</link>
		<comments>http://blog.oinam.com/2005/unique-random-serial-movies-image-loader/#comments</comments>
		<pubDate>Mon, 19 Dec 2005 17:31:03 +0000</pubDate>
		<dc:creator>Brajeshwar</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=9</guid>
		<description><![CDATA[While doing a randomizer for our splashes, we decided to get this out to the public and make it open for people to use it. This is a Flash SWF or an Image Loader spiced with the ability to load a default SWF or a random/serial from a list listed in an xml nodes. The [...]]]></description>
			<content:encoded><![CDATA[<p>While doing a randomizer for our splashes, we decided to get this out to the public and make it open for people to use it. This is a Flash <span class="caps">SWF </span>or an Image Loader spiced with the ability to load a default <span class="caps">SWF </span>or a random/serial from a list listed in an xml nodes.</p>

<p>The <a href="http://labs.oinam.com/flash/load-unique-random-serial/" title="SWF/Image Unique, Random, Serial Loader"><span class="caps">SWF</span>/Image Unique, Random, Serial Loader</a> will try to load an <span class="caps">SWF </span>or an Image either randomly or in a serial order. In order to get to the next or a random <span class="caps">SWF, </span>the mother Splash looks up for the splashes with the method <code>splashDone();</code>. Thus all splashes will need to called the method <code>_parent.splashDone()</code> for this example to work. In the case of an Image, it is considered single frame and thus the method is automatically called. One may be able to customize the <span class="caps">SWF</span>s or the images in the <code>splash.xml</code> available in the <a href="http://labs.oinam.com/flash/load-unique-random-serial/load-unique-random-serial.zip" title="download source">download</a>.</p>

<p>The <span class="caps">SWF </span>is published to version 6 to attain high compatibility with browser-flash-plugins. Coded in ActionScript 2.0 and adorned with <a href="http://www.martinfowler.com/eaaDev/ModelViewPresenter.html" title="Model View Presenter">Model View Presenter</a> pattern. Well, you might as well look at it as a simple <span class="caps">MVP </span>sample.<br />
<span id="more-9"></span><br />
<strong>splash.xml</strong></p>

<p><span class="caps">SPLASHES NODE ATTRIBUTES</span></p>

<p>1. mode : serial, random, default<br />
serial is for ordered loading of swfs<br />
random picks a random swf from the xml <br />
default is to pick the default swf first</p>

<p>2. refreshInterval<br />
refreshIntereval is the amount of time in seconds to pause for after the splash has completed. All splashes need to call a <code>_parent.splashDone();</code> method on their timeline to indicate that the splash has completed.</p>

<p>3. autoRefresh<br />
Flag indicates whether to auto-refresh the swf <br />
When auth refresh is off, only the initial swf is loaded into the splash swf</p>

<p>autoRefresh : true/false</p>

<p><span class="caps">SPLASH NODE ATTRIBUTES</span></p>

<p>1. url<br />
The url of the splash swf, either Absolute or relative url will work</p>

<p>2. default<br />
Use default=&#8221;true&#8221; on the splash node to promote the splash to be displayed initially</p>

<p><a href="http://labs.oinam.com/flash/load-unique-random-serial/" title="Preview">Preview</a> | <a href="http://labs.oinam.com/flash/load-unique-random-serial/load-unique-random-serial.zip" title="Download">Download</a><br />
Hope, somebody finds this useful!</p>

<p><em>Update</em></p>


<ul>
<li>This example is also being distributed as a <a href="http://www.ifbin.com/news/2006/01/free-friday-flash-unique-random-serial.html" title="Free Friday Source on IFBIN">Free Friday Source on <span class="caps">IFBIN</span></a>.</li>
<li>2006 Nov 26 &#8212; Here is the <a href="http://www.oinam.com/downloads/backups/load-unique-random-serial.zip" title="Backup Download">Backup Download Link</a>.</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2005/unique-random-serial-movies-image-loader/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Player 8 &#8211; ExternalInterface</title>
		<link>http://blog.oinam.com/2005/flash-player-8-externalinterface/</link>
		<comments>http://blog.oinam.com/2005/flash-player-8-externalinterface/#comments</comments>
		<pubDate>Thu, 08 Dec 2005 13:36:33 +0000</pubDate>
		<dc:creator>Brajeshwar</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=8</guid>
		<description><![CDATA[Pre Flash Player 8 Era In the times before the dawn of the Flash Player 8, Flash-Javascript communication, interaction was done with methods like, SetVariable and GetVariable. The technique however is not that browser-proof in some cases, and is a bit slow too. Nonthless, with the release of the Flash Javascript Integration Kit, it makes [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Pre Flash Player 8 Era</strong></p>

<p>In the times before the dawn of the Flash Player 8, Flash-Javascript communication, interaction was done with methods like, <code>SetVariable</code> and <code>GetVariable</code>. The technique however is not that browser-proof in some cases, and is a bit slow too. Nonthless, with the release of the <a href="http://www.macromedia.com/go/flashjavascript/" title="Flash Javascript Integration Kit">Flash Javascript Integration Kit</a>, it makes it possible to somehow seamlessly communicate between Flash and JavaScript. You can call JavaScript functions from Flash, and ActionScript functions from JavaScript.</p>

<p><strong>In the time of Flash Player 8</strong></p>

<p>Then, came Flash Player 8 and specifically <code>ExternalInterface</code> class; <code>flash.external.ExternalInterface</code> which extends <code>Object</code>. Now the entire approach of Flash-Javascript communication is realizing to a new awakening. The <code>ExternalInterface</code> enables straightforward communications between ActionScript and the Flash Player&#8217;s contrainer (for instance, the <span class="caps">HTML </span>page with Javascript or a C#, C++ or a Java wrapper). We can safely say that the olden days method of <code>FSCommand()</code> is replaced.</p>

<p><strong>ActionScript &#8211; JavaScript</strong></p>


<ul>
<li>to invoke custom ActionScript functions from JavaScript and vice versa and that too with a much cleaner <span class="caps">API</span></li>
<li>pass primitive (number, boolean, string) or complex (array, object, etc) data between ActionScript and JavaScript</li>
<li>function calls are synchronous and makes you feel as if you are invoking the functions withing same scripting engine (if you invoke a JavaScript function from ActionScript you get the return values instantly, same is true if you invoke ActionScript function from JavaScript).<br />
<span id="more-8"></span><br />
<em>For example</em></li>
</ul>



<p>Let us look at the following sample codes.<br />
Considering addInJS(&#8230;) is a function in JavaScript and addInAS(..) is the one in ActionScript.</p>

<pre><code language="as">//in ActionScript
function addInJS()
{
  var len:Number = arguments.length;
  var result:Number = 1;
  for(var i = 0;  i </code></pre>]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2005/flash-player-8-externalinterface/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash 8 File Upload Download</title>
		<link>http://blog.oinam.com/2005/flash-8-file-upload-download/</link>
		<comments>http://blog.oinam.com/2005/flash-8-file-upload-download/#comments</comments>
		<pubDate>Wed, 24 Aug 2005 04:44:32 +0000</pubDate>
		<dc:creator>Darshan</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.oinam.com/__blog/?p=5</guid>
		<description><![CDATA[We have completed an example of one of the new feature in Flash Player 8, the File Upload/Download &#8211; FileReference. The current demo have a parameter to control the MAX size of the individual files that can be uploaded. This value is changeable via the FlashObject variables in the SWF embedded html. The current demo [...]]]></description>
			<content:encoded><![CDATA[<p>We have completed an example of one of the new feature in Flash Player 8, the <a href="http://labs.oinam.com/flash8/fileuploaddownload/" title="File Upload/Download - FileReference">File Upload/Download &#8211; FileReference</a>. The current demo have a parameter to control the <span class="caps">MAX </span>size of the individual files that can be uploaded. This value is changeable via the <a href="http://blog.deconcept.com/flashobject/" title="FlashObject">FlashObject</a> variables in the <span class="caps">SWF </span>embedded html. The current demo is also configured to save the uploaded files to a directory, &#8220;userUploads&#8221;.</p>

<p><span id="more-5"></span></p>

<p><strong>Sypnosis</strong></p>

<p>Flash Developers have been asking for File Upload download functionality in Flash for a long time now. This time round, <a href="http://www.macromedia.com/" title="Macromedia">Macromedia</a> finally decided to put in this functionality in the Flash 8 Player. And the better news is that the <span class="caps">API </span>that has been provided allows for uploading not just one but multiple files as well. This <a href="http://labs.oinam.com/flash8/fileuploaddownload/" title="file upload/download example">example</a> shows how multiple files can be uploaded to the server using a simple upload queue. The upload queue groups together multiple upload requests and provides unified progress events for the entire group. This helps us provide the user with a single progress display even when uploading multiple files.</p>

<p>The possibilities this opens up for flash <span class="caps">RIA&#8217;</span>s is amazing. Imagine populating an entire photo gallery with a <i>Select All</i> + <i>Upload</i> combo. Flash developers now not only have file uploads but the usability of multiple file uploads, which beats other current implementations as well.</p>

<p><strong>FootNote</strong></p>

<p><i>Express Install</i><br />
This example is combined with the Express Install feature of Flash Player 8, whereby if your Flash Player vesion is earlier to 8, it will try to do an Express Install.</p>

<p><i>Image Preview before Download</i><br />
There is also an Image Preview before you Download a particular Image.</p>

<p><i>ColdFusion</i><br />
The file drop routine can be done by any Server Side Script, for example, there is a <a href="http://community.sgdotnet.org/blogs/shunjie/archive/2005/08/20/19656.aspx" title="C#.NET">C#.NET</a> upload script. Our example uses ColdFusion for dropping the uploaded file to the server and the CF code was just one single line</p>

<p>Here are the corresponding upload Routines for Reference.</p>

<p>C#.NET<br />
<i>Via <a href="http://community.sgdotnet.org/blogs/shunjie/" title="Shunjie">Shunjie</a> Blog</i></p>

<p>string saveToFolder = &#8220;savedFiles&#8221;<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
 HttpFileCollection uploadedFiles =&#8195;Request.Files;<br />
 string Path = Server.MapPath(saveToFolder);<br />
 for(int i = 0 ; i&#8195;0)<br />
  {&#8195; <br />
   string newName = <span class="caps">F.F</span>ileName.Substring(F.FileName.LastIndexOf(&#8220;\\&#8221;) + 1);<br />
   <span class="caps">F.S</span>aveAs(Path + &#8220;/&#8221; + newName);<br />
  }<br />
 }<br />
}</p>

<p><span class="caps">PHP</span> Code<br />
<i>Thanks to <a href="http://www.tink.ws/blog/" title="Tink">Tink</a> for helping out with the <span class="caps">PHP</span> Code.</i></p>


<ul>
<li><a href="http://labs.oinam.com/flash8/fileuploaddownload/">Preview File Upload/Download Example</a></li>
<li><a href="http://labs.oinam.com/flash8/fileuploaddownload/fileuploaddownload.zip">Download Source</a> (zip)</li>
<li><a href="http://forum.oinam.com/viewtopic.php?pid=41">Discussion Forum</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.oinam.com/2005/flash-8-file-upload-download/feed/</wfw:commentRss>
		<slash:comments>125</slash:comments>
		</item>
	</channel>
</rss>
