<?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>Designscripting &#187; ActionScript 2.0</title>
	<atom:link href="http://www.designscripting.com/category/actionscript-20/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designscripting.com</link>
	<description>Latest in flash, Free slideshow, Flash tutorials, advance flash, actionscript, Adobe Air, flash slideshow, New technology, RIA, Abstract wall paper</description>
	<lastBuildDate>Thu, 17 Jun 2010 09:48:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>To find percentage between two given values</title>
		<link>http://www.designscripting.com/2010/06/to-find-percentage-between-two-given-values/</link>
		<comments>http://www.designscripting.com/2010/06/to-find-percentage-between-two-given-values/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 09:48:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=426</guid>
		<description><![CDATA[Formulae:
((X &#8211; minValue)/(maxValue &#8211; minValue)) * 100
Suppose we need to convert 14 &#8211; 100 as 0% &#8211; 100%
X may be any input from 14 to 100, and the calculation is 
((X &#8211; 14)/(100 &#8211; 14)) * 100
This might be usefull in scrollBar calculations or when we want to restrict size of Image and so on.
]]></description>
			<content:encoded><![CDATA[<p>Formulae:<br />
((X &#8211; minValue)/(maxValue &#8211; minValue)) * 100</p>
<p>Suppose we need to convert 14 &#8211; 100 as 0% &#8211; 100%</p>
<p>X may be any input from 14 to 100, and the calculation is </p>
<p>((X &#8211; 14)/(100 &#8211; 14)) * 100</p>
<p>This might be usefull in scrollBar calculations or when we want to restrict size of Image and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2010/06/to-find-percentage-between-two-given-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Flash/Flex Preloaders</title>
		<link>http://www.designscripting.com/2009/12/free-flashflex-preloaders/</link>
		<comments>http://www.designscripting.com/2009/12/free-flashflex-preloaders/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 06:36:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=288</guid>
		<description><![CDATA[Preloaders are much needed for Flash/Flex RIA&#8217;s.
Here some of the free preloader animations created by me this morning.

Idea of preloader is indicating the user that some assets are being loaded, and making them to wait.
But we should keep in mind that the user may lost their patience, so keeping the Flash assets filesize minimal is much important while making Flash websites or Flash applications.

]]></description>
			<content:encoded><![CDATA[<p>Preloaders are much needed for Flash/Flex RIA&#8217;s.</p>
<p>Here some of the free preloader animations created by me this morning.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="310" height="87" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="StageResize" /><param name="bgcolor" value="#666666" /><param name="align" value="middle" /><param name="src" value="http://www.designscripting.com/wp-content/uploads/2009/12/Preloader_Symbols.swf" /><param name="allowfullscreen" value="false" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="310" height="87" src="http://www.designscripting.com/wp-content/uploads/2009/12/Preloader_Symbols.swf" quality="high" allowfullscreen="false" align="middle" bgcolor="#666666" name="StageResize"></embed></object></p>
<p>Idea of preloader is indicating the user that some assets are being loaded, and making them to wait.<br />
But we should keep in mind that the user may lost their patience, so keeping the Flash assets filesize minimal is much important while making Flash websites or Flash applications.</p>
<p style="text-align: center;"><a href="http://www.designscripting.com/wp-content/uploads/2009/12/Preloader_Symbols.zip"><img class="aligncenter" src="http://www.designscripting.com/wp-content/uploads/2008/12/download.jpg" alt="" width="239" height="54" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/12/free-flashflex-preloaders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mailto in Flash Actionscript</title>
		<link>http://www.designscripting.com/2009/07/mailto-in-flash-actionscript/</link>
		<comments>http://www.designscripting.com/2009/07/mailto-in-flash-actionscript/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 08:52:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[email in actionscript]]></category>
		<category><![CDATA[email in flash]]></category>
		<category><![CDATA[Mailto in flash]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=149</guid>
		<description><![CDATA[We can send mail directly using SMTP+Actionscript3.0 but here we are going to discuss about simple form of &#8220;mailto&#8221; function that just opens the default mail application with the supplied subject and body content.
Difficulty:
Beginners &#8211; intermediate
Version:
AS2 and AS3
Here we are going to see how to use mailto function in AS2 and AS3.

Actionscript2.0
Step1:
Open New Flash Document (File &#62; New) from menu or (CTRL + N) shortcut
key.Select Flash File (Actionscript2.0)
Step2:
select the first keyframe on the layer1.
Step3:
Press F9 (Function key) or open the Actions Panel under the Windows menu.
Step4:
Paste the below code
getURL("mailto:designscripting@gmail.com?subject=Test Message&#38;body=Site ...]]></description>
			<content:encoded><![CDATA[<p>We can send mail directly using SMTP+Actionscript3.0 but here we are going to discuss about simple form of &#8220;mailto&#8221; function that just opens the default mail application with the supplied subject and body content.</p>
<p><strong>Difficulty:</strong><br />
Beginners &#8211; intermediate</p>
<p><strong>Version:</strong><br />
AS2 and AS3</p>
<p>Here we are going to see how to use mailto function in AS2 and AS3.</p>
<p><img src="http://designscripting.com/wp-content/uploads/2009/04/mailto.jpg" alt="Mail to function in Actionscript" /></p>
<p><strong>Actionscript2.0</strong></p>
<p><strong>Step1:</strong></p>
<p>Open New Flash Document (File &gt; New) from menu or (CTRL + N) shortcut</p>
<p>key.Select Flash File (Actionscript2.0)</p>
<p><strong>Step2:</strong></p>
<p>select the first keyframe on the layer1.</p>
<p><strong>Step3:</strong></p>
<p>Press F9 (Function key) or open the Actions Panel under the Windows menu.</p>
<p><strong>Step4:</strong></p>
<p>Paste the below code</p>
<pre class="brush:as3">getURL("mailto:designscripting@gmail.com?subject=Test Message&amp;body=Site link: http://www.designscripting.com");</pre>
<p><strong>Step5:</strong></p>
<p>Save your work and CTRL + ENTER to run the flash</p>
<p>You will see default mailing service with the mail address, subject and body</p>
<p>content.</p>
<p><strong>Actionscript3.0</strong></p>
<p><strong>Step1:</strong></p>
<p>Open New Flash Document (File &gt; New) from menu or (CTRL + N) shortcut key.</p>
<p>Select Flash File (Actionscript3.0)</p>
<p><strong>Step2:</strong></p>
<p>select the first keyframe on the layer1.</p>
<p><strong>Step3:</strong></p>
<p>Press F9 (Function key) or open the Actions Panel under the Windows menu.</p>
<p><strong>Step4:</strong></p>
<p>Paste the below code</p>
<pre class="brush:as3">var email_str:String = "mailto:designscripting@gmail.com?subject=Test Message&amp;body=Site link: http://www.designscripting.com";
var _request:URLRequest = new URLRequest(email_str);
navigateToURL(_request, "_blank");</pre>
<p><strong>Step5:</strong></p>
<p>Save your work and CTRL + ENTER to run the flash</p>
<p>You will see default mailing service with the mail address, subject and body content.</p>
<p>Thats it we are one click away to send email&#8230; from Flash actionscript</p>
<p>Cheers <img src='http://www.designscripting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/07/mailto-in-flash-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search Actionscript code</title>
		<link>http://www.designscripting.com/2009/07/search-actionscript-code/</link>
		<comments>http://www.designscripting.com/2009/07/search-actionscript-code/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 06:30:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[actionscript code snippets]]></category>
		<category><![CDATA[actionscript samples]]></category>
		<category><![CDATA[learn actionscript]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=147</guid>
		<description><![CDATA[The launch of new search engine for Actionscript developers has made the life easier for the developers to search code snippets easier.
HexoSearch â€“ The worldâ€™s first search engine dedicated for actionscript.
HexoSearch is aiming to provide the best actionscript search experience which we believe is to offer a best solution for any specific topic.

To achieve that, actionscript developers are able to vote for the link that they find useful. Given enough time, links that provide useful information will be pushed up to save everybody&#8217;s time.
]]></description>
			<content:encoded><![CDATA[<p>The launch of new search engine for Actionscript developers has made the life easier for the developers to search code snippets easier.</p>
<p>HexoSearch â€“ The worldâ€™s first search engine dedicated for actionscript.</p>
<p>HexoSearch is aiming to provide the best actionscript search experience which we believe is to offer a best solution for any specific topic.</p>
<p><img src="http://www.designscripting.com/wp-content/uploads/2009/04/hexosearch.jpg" alt="" /></p>
<p>To achieve that, actionscript developers are able to vote for the link that they find useful. Given enough time, links that provide useful information will be pushed up to save everybody&#8217;s time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/07/search-actionscript-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trace statement in Actionscript</title>
		<link>http://www.designscripting.com/2009/03/trace-statement-in-actionscript/</link>
		<comments>http://www.designscripting.com/2009/03/trace-statement-in-actionscript/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 13:43:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=104</guid>
		<description><![CDATA[We can trace as many variables or Objects with single trace statements in both Actionscript 2.0 and Actionscript 3.0 without concat operator &#8216;+&#8217;
Actionscript 2.0
var one:Number = 1;
var two:String = "two"
trace([one, two]);
Actionscript 3.0
var one:Number = 1;
var two:String = "two"
trace(one, two);
one difference is that no need to use square brackets in AS3.0
]]></description>
			<content:encoded><![CDATA[<p>We can trace as many variables or Objects with single trace statements in both Actionscript 2.0 and Actionscript 3.0 without concat operator &#8216;+&#8217;</p>
<p><strong>Actionscript 2.0</strong></p>
<pre class="brush:as3">var one:Number = 1;
var two:String = "two"
trace([one, two]);</pre>
<p><strong>Actionscript 3.0</strong></p>
<pre class="brush:as3">var one:Number = 1;
var two:String = "two"
trace(one, two);</pre>
<p>one difference is that no need to use square brackets in AS3.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/03/trace-statement-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Unique GUID &#8211; AS2</title>
		<link>http://www.designscripting.com/2009/02/create-unique-guid-as2/</link>
		<comments>http://www.designscripting.com/2009/02/create-unique-guid-as2/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 11:42:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[GUID]]></category>
		<category><![CDATA[random alphanumeric variable]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=98</guid>
		<description><![CDATA[In my project there was a need to create unique alpha numeric value + to act as a substitute for session variables.
I serached internet and got this Class GUID.
It has one drawback that it always create GUID of length 40. So i made some change to generate GUID of specified length.
Version of Actionscript:
Actionscript 2.0
Here is the usage of the Class GUID
trace(GUID.create(40))
Note:
Make sure that GUID resides in the same folder.

]]></description>
			<content:encoded><![CDATA[<p>In my project there was a need to create unique alpha numeric value + to act as a substitute for session variables.</p>
<p>I serached internet and got this <a href="http://www.designscripting.com/wp-content/uploads/2009/02/guid.zip">Class GUID</a>.</p>
<p>It has one drawback that it always create GUID of length 40. So i made some change to generate GUID of specified length.</p>
<p>Version of Actionscript:<br />
Actionscript 2.0</p>
<p>Here is the usage of the Class GUID</p>
<pre lang="actionscript3">trace(GUID.create(40))</pre>
<p>Note:<br />
Make sure that GUID resides in the same folder.</p>
<p style="text-align: center;"><a href="http://www.designscripting.com/wp-content/uploads/2009/02/guid.zip"><img src="http://www.designscripting.com/wp-content/uploads/2008/12/download.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/02/create-unique-guid-as2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Slideshow + with preloader</title>
		<link>http://www.designscripting.com/2009/01/dynamic-slideshow-with-preloader/</link>
		<comments>http://www.designscripting.com/2009/01/dynamic-slideshow-with-preloader/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 10:33:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=78</guid>
		<description><![CDATA[In this version2 of Dynamic slide show i have added preloading support and opening links on clicking the image..
Here you can have look t previous version 
Nothing complicated from the previous version&#8230; just need to update the swf and xml
in xml
image url=&#8221;Images/image1.jpg&#8221; gotoURL=&#8221;http://www.designscripting.com&#8221; target=&#8221;_blank&#8221;
gotoURL = webpage to be opened on clicking
target = _blank &#124; _self
_blank opens the link in new page;
_self opens the link in same page.
Next in slideshow is Fader Classes in AS3 with that its possible to Fade back to back images, wait till preloading, load animated swf ...]]></description>
			<content:encoded><![CDATA[<p>In this version2 of Dynamic slide show i have added preloading support and opening links on clicking the image..</p>
<p><a href="http://www.designscripting.com/2008/11/12/dynamic-slideshow-xml-flash/" target="_blank">Here you can have look t previous version </a></p>
<p>Nothing complicated from the previous version&#8230; just need to update the swf and xml</p>
<p>in xml</p>
<p>image url=&#8221;Images/image1.jpg&#8221; gotoURL=&#8221;http://www.designscripting.com&#8221; target=&#8221;_blank&#8221;</p>
<p style="padding-left: 30px;">gotoURL = webpage to be opened on clicking</p>
<p style="padding-left: 30px;">target = _blank | _self</p>
<p style="padding-left: 90px;">_blank opens the link in new page;</p>
<p style="padding-left: 90px;">_self opens the link in same page.</p>
<p>Next in slideshow is <strong>Fader Classes</strong> in AS3 with that its possible to Fade back to back images, wait till preloading, load animated swf files in slideshow, fade textfield without embeding fonts&#8230; <img src='http://www.designscripting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="padding-left: 30px; text-align: center;"><a href="http://www.designscripting.com/wp-content/uploads/2009/01/slideshow-v2.zip"><img src="http://www.designscripting.com/wp-content/uploads/2008/12/download.jpg" alt="" width="239" height="54" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2009/01/dynamic-slideshow-with-preloader/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Use Splice to delete all elements in an Array</title>
		<link>http://www.designscripting.com/2008/12/use-splice-to-delete-all-elements-in-an-array/</link>
		<comments>http://www.designscripting.com/2008/12/use-splice-to-delete-all-elements-in-an-array/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 10:31:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Array reference]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=61</guid>
		<description><![CDATA[In my project i was passing array to another class(passing by reference). And i was editing the items there in another class(Composition). I was in a situation to resset the array. Then i suddenly reinitialized the array(arr = new Array() or arr = []).
That will create some error in application. Bcoz the reference will end there.
So its advisable to delete items alone. When passing the array references accross several Class.
var Num_arr:Array = new Array();
Num_arr.push(1)
Num_arr.push(6)
Num_arr.push(2)
Num_arr.push(4)
Num_arr.push(9)
trace("--"+Num_arr+"--")
arr.splice(0,Num_arr.length)
trace("--"+Num_arr+"--")
Happy coding  
]]></description>
			<content:encoded><![CDATA[<p>In my project i was passing array to another class(passing by reference). And i was editing the items there in another class(Composition). I was in a situation to resset the array. Then i suddenly reinitialized the array(arr = new Array() or arr = []).<br />
That will create some error in application. Bcoz the reference will end there.</p>
<p>So its advisable to delete items alone. When passing the array references accross several Class.</p>
<pre lang="actionscript" lineno="1">var Num_arr:Array = new Array();
Num_arr.push(1)
Num_arr.push(6)
Num_arr.push(2)
Num_arr.push(4)
Num_arr.push(9)
trace("--"+Num_arr+"--")
arr.splice(0,Num_arr.length)
trace("--"+Num_arr+"--")</pre>
<p>Happy coding <img src='http://www.designscripting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2008/12/use-splice-to-delete-all-elements-in-an-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check your Flash player version installed</title>
		<link>http://www.designscripting.com/2008/11/check-your-flash-player-version-installed/</link>
		<comments>http://www.designscripting.com/2008/11/check-your-flash-player-version-installed/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 18:51:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Check flash Player Version]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=40</guid>
		<description><![CDATA[Flash player 10 is in beta &#8230; its time to check the Flash player version installed in your system and upgrade to latest Flash player..
There are some easy ways to check the player installed..
Follow the link and check the version

kb.adobe.com
duber.com
playerversion.com

Â 
Dont have Adobe Flash Player&#8230;.
Install Adobe Flash Player
]]></description>
			<content:encoded><![CDATA[<p>Flash player 10 is in beta &#8230; its time to check the Flash player version installed in your system and upgrade to latest Flash player..</p>
<p>There are some easy ways to check the player installed..</p>
<p>Follow the link and check the version</p>
<ul>
<li><a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507">kb.adobe.com</a></li>
<li><a href="http://www.duber.com/LetsTalk/playerCheck.html">duber.com</a></li>
<li><a href="http://www.playerversion.com/">playerversion.com</a></li>
</ul>
<p>Â </p>
<p>Dont have Adobe Flash Player&#8230;.</p>
<h4><img src="http://www.adobe.com/shockwave/download/images/flashplayer_100x100.jpg" alt="" align="middle" /><a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">Install Adobe Flash Player</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2008/11/check-your-flash-player-version-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Slideshow XML + Flash:</title>
		<link>http://www.designscripting.com/2008/11/dynamic-slideshow-xml-flash/</link>
		<comments>http://www.designscripting.com/2008/11/dynamic-slideshow-xml-flash/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 06:49:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 2.0]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Sllideshow]]></category>

		<guid isPermaLink="false">http://www.designscripting.com/?p=30</guid>
		<description><![CDATA[This tutorial shows how to create dynamic slideshow by fetching the data from XML and the slideshow.
This tutorial covers reading XML using XPathAPI, Conditional operator, MovieClipLoader, setTimeout.
XpathAPI:
The native XPathAPI class allows us to search the XML nodes and attributes within XML that €™s loaded in to flash.
To know more about using XPathAPI click here
Conditional Operator:
Using conditional operator is similar to if else statement.
Example:

var test_boolean : Boolean = true
if(test_boolean)
trace("I am True");
else
trace("I am False");
//output:I am True

Same Logic using the conditional operator

var test_boolean : Boolean = true
test_boolean == true ? trace("I am True") ...]]></description>
			<content:encoded><![CDATA[<p>This tutorial shows how to create dynamic slideshow by fetching the data from XML and the slideshow.<br />
This tutorial covers reading XML using XPathAPI, Conditional operator, MovieClipLoader, setTimeout.<br />
<strong>XpathAPI:</strong><br />
The native XPathAPI class allows us to search the XML nodes and attributes within XML that €™s loaded in to flash.<br />
To know more about using XPathAPI click here</p>
<p><strong>Conditional Operator:</strong><br />
Using conditional operator is similar to if else statement.</p>
<p style="PADDING-LEFT: 30px"><strong>Example:</strong></p>
<p style="PADDING-LEFT: 30px">
<pre class="brush:as3">var test_boolean : Boolean = true
if(test_boolean)
trace("I am True");
else
trace("I am False");
//output:I am True</pre>
</p>
<p style="PADDING-LEFT: 30px">Same Logic using the conditional operator</p>
<p style="PADDING-LEFT: 30px">
<pre class="brush:as3">var test_boolean : Boolean = true
test_boolean == true ? trace("I am True") : trace("I am False");
//output:I am True</pre>
</p>
<p><strong>setTimeout:</strong><br />
setTimeOut() method is an undocumented feature of flash8. This method is very useful when we need to call a function after specified duration of time. But not more than once.<br />
<strong>Simple usage:</strong></p>
<p style="PADDING-LEFT: 30px">
<pre class="brush:as3">setTimeout(sayHello, 1000);
function sayHello() {
  trace("Hello, welcome here!");
}</pre>
</p>
<p style="PADDING-LEFT: 30px"><strong>Passing argument:</strong></p>
<p style="PADDING-LEFT: 30px">And incase we need to pass some argument then</p>
<p style="PADDING-LEFT: 30px">
<pre class="brush:as3">setTimeout(sayHello, 1000,"Hello, welcome here!");
function sayHello( arg:String ) {
  trace(arg);
}</pre>
</p>
<p style="PADDING-LEFT: 30px">
<p>Output SWF File</p>
<div>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="223" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.designscripting.com/wp-content/uploads/2008/11/Slideshow.swf" /><embed type="application/x-shockwave-flash" width="480" height="223" src="http://www.designscripting.com/wp-content/uploads/2008/11/Slideshow.swf"></embed></object></div>
<p><strong>Slideshow Code:</strong></p>
<p style="PADDING-LEFT: 30px"><strong></strong></p>
<pre class="brush:as3">
import mx.transitions.Tween;
import mx.transitions.easing.*;
import mx.xpath.XPathAPI;
var delay:Number;
var animationDuration:Number;
var current_num:Number = 0;
var first_num:Number = 0;
var image_holder:MovieClip = this.createEmptyMovieClip("image_holder", this.getNextHighestDepth());
var mcl_lis:Object = new Object();
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(mcl_lis);
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function( isLoaded:Boolean )
{
  if( isLoaded )
  {
    data_arr = XPathAPI.selectNodeList(this.firstChild,"Slideshow/images/image");
    delay = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/delay").firstChild);
    animationDuration = parseInt(XPathAPI.selectSingleNode(this.firstChild,"Slideshow/settings/animationDuration").firstChild);
    //optional code to check delay and animationDuration values
    (delay == undefined || delay == null) ? delay = 5000: delay&lt;1000? delay =1000:true;
    (animationDuration == undefined || animationDuration == null) ? animationDuration = .8: animationDuration&lt;.3? animationDuration =.8:true;
    load_image();
  }else
  {
    trace("XML Load error");
  }
}
xml.load("XML/data.xml")

function load_image()
{
  mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
  (current_num&gt;=data_arr.length-1) ? current_num = first_num:current_num++;
}

mcl_lis.onLoadInit = function(target_mc:MovieClip) {
  var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 0, 100, .5, true);
    setTimeout(function(){
                var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 100, 0, .5, true);
                  obj.onMotionFinished = function() {load_image();};
               },5000);
};</pre>
</p>
<p>In loadImage function we are loading the next image using MovieClip Loader and Checking the present number of image against the last.</p>
<pre class="brush:as3">
mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
  (current_num&gt;=data_arr.length-1) ? current_num = first_num:current_num++;</pre>
<p>Here I am not going to explain the full code bcoz after the above description and XPath tutorial; it €™s very easy to understand.</p>
<p style="text-align: center;"><a href="http://www.designscripting.com/wp-content/uploads/2008/11/Slideshow.zip"><img src="http://www.designscripting.com/wp-content/uploads/2008/12/download.jpg" alt="" /></a></p>
<p style="text-align: left;"><a href="http://www.designscripting.com/2009/01/06/dynamic-slideshow-with-preloader/">Updated SlideShow</a></p>
<p>Cheers<br />
-sara</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designscripting.com/2008/11/dynamic-slideshow-xml-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
