<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-34775174</id><updated>2011-11-11T01:51:08.894-08:00</updated><category term='Flash'/><category term='actionscript at chennai.'/><category term='actionscript'/><category term='actionscript meet'/><category term='flash on the beach'/><category term='discussion on actionscript'/><category term='flash meet'/><title type='text'>ActionScript  2 ActionScript</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34775174.post-3465397177160107887</id><published>2009-08-07T05:44:00.000-07:00</published><updated>2009-08-17T23:19:08.816-07:00</updated><title type='text'></title><content type='html'>&lt;p&gt;As i had promised in my last blog. Here are some screenshots of what is happening with the Open Source IDE that i have started writing. Currently i am looking at tools and libraries to generate swf files from this IDE. &lt;/p&gt;&lt;p&gt;&lt;img style="WIDTH: 550px; HEIGHT: 407px" src="http://static.flickr.com/2627/3797344507_a0706898c3_o.JPG" height="704" alt="01" hspace="8" width="794" align="top" border="0" /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style="WIDTH: 550px; HEIGHT: 360px" src="http://static.flickr.com/2524/3798161280_fef4d0943a_o.JPG" height="577" alt="02" hspace="8" width="744" align="top" border="0" /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style="WIDTH: 550px; HEIGHT: 528px" src="http://static.flickr.com/2481/3797346811_3620b017cd_o.JPG" height="707" alt="03" hspace="8" width="836" align="top" border="0" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-3465397177160107887?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/3465397177160107887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=3465397177160107887' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3465397177160107887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3465397177160107887'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2009/08/as-i-had-promised-in-my-last-blog.html' title=''/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-6991570857153801977</id><published>2009-08-03T06:53:00.000-07:00</published><updated>2009-08-03T07:14:01.799-07:00</updated><title type='text'>Busy Writing an Alternative Flash IDE.</title><content type='html'>&lt;p&gt;So its been a long long time, since i had updated my blog. What to do, i was too busy doing nothing worthwhile all this while. The latest update at my end is that i have started writing an Alternative for the Flash IDE. I always felt that its high time people need to do something for an IDE on Linux, but realized i am also one among the people so it is my responsibility too to see that someone does something. &lt;/p&gt;&lt;p&gt;Coming to the subject, the Flash alternative IDE i am talking about is written using C++ and QT4 framework. Though i have knowledge about C++ and the syntax, but never had any working experience on the same. Initially felt a bit scary about apprehensions like will i able to complete it? or is it a reality that i am pursuing, but i made to myself that i will never have these thoughts and will start on my dream. C# was my initial choice to write this open source IDE, cheating myself that i can make this work on Linux using Mono. But later on things were proved to be wrong, as i got stuck with the flood fill algorithm. Then faced myself with the truth and decided that though C++ might look primitive after working on Actionscript, but still it is the powerful element that has the ability to create (I consider this as &amp;quot;Brahma&amp;quot;). C# was wonderful for me to work with because of its language structure which i felt comfortable after having worked in complete oops elements like Actionscript and Java. But at later stages had some trouble and finally had to take digest the fact and fear of working in C++. But the results were really fruitful. I (have / am) (learnt / learning) a lot of C++ working on this project. &lt;/p&gt;&lt;p&gt;The current number to denote the progress of work that has happened would look something like (15 / 100). Though a lot of time has been invested to achieve this minimal value, I would say from what has been observed is that the speed is getting picked up on an exponential fashion. Nowadays i have started investing more time on it. One good reason for the increased time being spent on this is solely due to the IDE i am using to create this application. As i said in the beginning about my intention of having an Open Source Flash IDE for Open Source platforms like Linux, this application is now being developed using KDevelop on Linux GNOME environment. The story behind using Linux to develop this OS Flash IDE using Linux has only one reason, which is my Windows Desktop recently crashed and the hard disk got filled with Viruses. I felt sick trying to repair this and decided i will go for Linux and installed it. &lt;/p&gt;&lt;p&gt;This is the story so far and will soon come back with screenshots to update the progress. &lt;/p&gt;&lt;p&gt;Meanwhile anybody out there interested in the development of this project, please get in touch with me at &lt;a href="mailto:ashok_srinivasan2002@yahoo.com"&gt;ashok_srinivasan2002@yahoo.com&lt;/a&gt; or leave a comment in this blog with your mail id and i will get in touch with you.&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Ashok Srinivasan.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-6991570857153801977?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/6991570857153801977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=6991570857153801977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6991570857153801977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6991570857153801977'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2009/08/busy-writing-alternative-flash-ide-so.html' title='Busy Writing an Alternative Flash IDE.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-6173926849748828293</id><published>2009-07-03T07:39:00.001-07:00</published><updated>2009-07-03T07:39:41.746-07:00</updated><title type='text'></title><content type='html'>&lt;div class="TWIIGSPOLL"&gt; &lt;script type="text/javascript" src="http://www.twiigs.com/poll.js?pid=34914&amp;color=blue"&gt;&lt;/script&gt; &lt;div class="TWIIGSPOLLpolllink" style="background-color: transparent; background-image: none; border-style: none; clear: none; display: block; float: none; position: static; visibility: visible; height: auto; line-height: normal; width: auto; margin-top: 10px; margin-right: 0; margin-bottom: 0; margin-left: 0; outline-style: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; clip: auto; overflow: hidden; vertical-align: baseline; z-index: auto; letter-spacing: normal; text-align: right; text-decoration: none; text-indent: 0; text-shadow: none; text-transform: none; white-space: normal; word-spacing: normal;"&gt; &lt;a class="TWIIGSPOLLmorelink" href="http://www.twiigs.com/" style="background-color: transparent; background-image: none; border-style: none; clear: none; display: inline; float: none; position: static; visibility: visible; height: auto; line-height: normal; width: auto; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; outline-style: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; clip: auto; overflow: hidden; vertical-align: baseline; z-index: auto; letter-spacing: normal; text-align: left; text-indent: 0; text-shadow: none; text-transform: none; white-space: normal; word-spacing: normal; font-weight: bold;"&gt;poll by twiigs.com&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-6173926849748828293?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/6173926849748828293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=6173926849748828293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6173926849748828293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6173926849748828293'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2009/07/poll-by-twiigs_03.html' title=''/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-507919316217886686</id><published>2009-07-03T07:37:00.001-07:00</published><updated>2009-07-03T07:37:47.941-07:00</updated><title type='text'></title><content type='html'>&lt;div class="TWIIGSPOLL"&gt; &lt;script type="text/javascript" src="http://www.twiigs.com/poll.js?pid=34914&amp;color=blue"&gt;&lt;/script&gt; &lt;div class="TWIIGSPOLLpolllink" style="background-color: transparent; background-image: none; border-style: none; clear: none; display: block; float: none; position: static; visibility: visible; height: auto; line-height: normal; width: auto; margin-top: 10px; margin-right: 0; margin-bottom: 0; margin-left: 0; outline-style: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; clip: auto; overflow: hidden; vertical-align: baseline; z-index: auto; letter-spacing: normal; text-align: right; text-decoration: none; text-indent: 0; text-shadow: none; text-transform: none; white-space: normal; word-spacing: normal;"&gt; &lt;a class="TWIIGSPOLLmorelink" href="http://www.twiigs.com/" style="background-color: transparent; background-image: none; border-style: none; clear: none; display: inline; float: none; position: static; visibility: visible; height: auto; line-height: normal; width: auto; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; outline-style: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; clip: auto; overflow: hidden; vertical-align: baseline; z-index: auto; letter-spacing: normal; text-align: left; text-indent: 0; text-shadow: none; text-transform: none; white-space: normal; word-spacing: normal; font-weight: bold;"&gt;poll by twiigs.com&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-507919316217886686?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/507919316217886686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/507919316217886686'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2009/07/poll-by-twiigs.html' title=''/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-2910878350199109600</id><published>2009-07-03T07:25:00.000-07:00</published><updated>2009-07-06T03:36:21.750-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flash on the beach'/><category scheme='http://www.blogger.com/atom/ns#' term='discussion on actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='flash meet'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript meet'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript at chennai.'/><title type='text'>Flash on the beach........</title><content type='html'>Marina, the second longest beach in the world could be an ideal place for us developers to have an informal meet to discuss on flash actionscript 2 &amp;amp; 3.&lt;br /&gt;&lt;br /&gt;This is not restricted to any one, whoever works in flash can come and attend this meet.&lt;br /&gt;&lt;br /&gt;But i wish to know how many of them would be really interested to attend this. For this i request you to poll on this blog.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-2910878350199109600?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/2910878350199109600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=2910878350199109600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/2910878350199109600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/2910878350199109600'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2009/07/flash-on-beach.html' title='Flash on the beach........'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-3134236823548456880</id><published>2008-01-31T23:01:00.001-08:00</published><updated>2008-01-31T23:01:52.366-08:00</updated><title type='text'>Streams not being Saved or saved with zero file size.</title><content type='html'>&lt;p&gt;I am currently playing around with Flash Media Server based applications  using RED 5(Amazing tool I would say.) and encountered a very very strange Bug.  When I tried to record voice over the web using my application url I found that  a FLV file is being created but it does not appear to have a valid file size. I  have been struggling over this from changing my code from AS3 - AS2 and vice  versa but with no luck. But one thing that constantly came to my notice during  this struggle was that in other applications (that came along with red 5 server  as demo files ) whenever I tried to record my voice I was able to see a setting  window invoked by the flash player asking for user's confirmation to allow data  to be recorded. And in my application whenever i clicked record this setting  window never showed. Maybe it was my bad luck that stopped me from thinking or  analyzing in this line of thought i was busy thinking about other problems which  resulted in failure to make my application work correctly until today morning  when tried the red 5 applications native demo swf file to record my voice using  my app's url. Amazingly my voice was starting to be recorded and i could see the  flv's file size constantly increasing with voice data being stored.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;I did not know why or how it occured to me but i once again opened my own  application fla file and changed its stage size to 250 x 250 then published it  to test. &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Guess what happened ??? when i connected to the RED 5 server and clicked the  record button i was able to see the flash setting window being opened asking for  the request to allow my url to record data. And happily saw the size of flv file  increasing being saved in my streams folder.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Concluding i guess it was the stage size that was giving problem all this  time. My guess is that if the stage size needs to be big enough to accommodate  the flash player setting box to be shown (in my case i found it to work  perfectly with 250 x 250 px).&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Regards,&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Ashok Srinivasan.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-3134236823548456880?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/3134236823548456880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=3134236823548456880' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3134236823548456880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3134236823548456880'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2008/01/streams-not-being-saved-or-saved-with.html' title='Streams not being Saved or saved with zero file size.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-439160994031564453</id><published>2007-10-24T04:48:00.001-07:00</published><updated>2007-10-24T04:48:44.740-07:00</updated><title type='text'>Organizing your ActionScript code.</title><content type='html'>&lt;p&gt;Well when it comes to actionscript projects, one stops to think and wonder how do&amp;nbsp;I start ? Wow that's a very elementary question but also it is very important and fundamental. &lt;/p&gt; &lt;p&gt;One approach is to open flash IDE and start writing the code like hell and pride yourself with the speed with which you&amp;nbsp;complete, and end up&amp;nbsp;being the most most happiest person in this whole world.&amp;nbsp;Days&amp;nbsp;pass by and one day something new to be added turns up for the happiest project you did once before only to make you feel annoyed and irritated at the end of the day. Remember writing code would be like getting married to a girl due to infatuation where you enjoy the initial phase but regret later. Whereas on the contrary if things had been organized and are in the right places with proper framework will result in something that can be better maintained and a good rapport&amp;nbsp;will always exist between you and your code(wife). Forget about maintaining it yourself but anyone who takes it later will load you with lot's of blessings (in real life scenario this does not apply to my example). &lt;/p&gt; &lt;p&gt;Have you decided about your attitude towards writing code ? If yes please proceed further, else you always have time to take a decision and make a choice out of yourself. &lt;/p&gt; &lt;p&gt;Whatever I am going to explain hereafter will strongly pertain to AS3 and still will be applicable to AS2 also. I will not be explaining about frameworks or design patterns for I myself lack a lot in that area and lot to be learned is still pending. Instead what you will see in this tutorial is some of the techniques I have been following till now in my&amp;nbsp;ActionScript career. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font color="#000040" size="3"&gt;The folder Architecture :::::::::::::::::::&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Before you start with a project ensure to maintain proper folder architecture. A&amp;nbsp;good developer will always do this. Ensure that you have the following folders for sure in your project folder.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;com - Folder consisting of your class files.&lt;/p&gt; &lt;p&gt;src - Folder containing your source FLA file(s).&lt;/p&gt; &lt;p&gt;bin - Contains the output file (subfolder's Release || Debug).&lt;/p&gt; &lt;p&gt;assets&amp;nbsp;- Contains the graphic assets required for designing your flash&amp;nbsp;project.&lt;/p&gt; &lt;p&gt;includes (If as2 )&amp;nbsp;- Folder containing the necessary include files (Generally there is only main.as).&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Folder "com" explained&lt;/p&gt; &lt;p&gt;Usually this folder contains a folder named "yourcompany" which in turn will contain subfolder named "yourprojectname" and subfolders with the following names.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;main - The main controlling class file Main.as is present here.&lt;/p&gt; &lt;p&gt;display - Class files&amp;nbsp;used&amp;nbsp;for&amp;nbsp;linking to display objects&amp;nbsp;or referenced via linkage id are created here.&lt;/p&gt; &lt;p&gt;components - Class files used for your custom components are created here. (example : CustomScrollbar.as etc., )&lt;/p&gt; &lt;p&gt;utils - Class files that are written to do some utility operations (example : MyMath.as, Logging.as etc.,)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;With this you will now be able to sort out and will be able to design your application framework in an even better way.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Some example classes are written below for your better understanding.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Display class example&amp;nbsp;: &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;package&lt;/font&gt; com.yourcompany.yourprojectname.display&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;public class&lt;/font&gt;&amp;nbsp;YourClassName &lt;font color="#0000ff"&gt;extends MovieClip&lt;/font&gt;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public function&lt;/font&gt; YourClassName ()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;br&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Component&amp;nbsp;class example&amp;nbsp;:&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;package&lt;/font&gt; com.yourcompany.yourprojectname.component&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;public class&lt;/font&gt;&amp;nbsp;YourComponentName &lt;font color="#0000ff"&gt;extends MovieClip&lt;/font&gt;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public function&lt;/font&gt; YourComponentName()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;br&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Main&amp;nbsp;class example&amp;nbsp;:&lt;/p&gt; &lt;p&gt;This differs a little bit based on the version you are currently targeting.&amp;nbsp;The&amp;nbsp;immediate below&amp;nbsp;one is an example of AS3 and the next is for AS2&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;AS3:::::::::::::::&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;package&lt;/font&gt; com.yourcompany.yourprojectname.main&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;public class&lt;/font&gt;&amp;nbsp;Main &lt;font color="#0000ff"&gt;extends MovieClip&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public function&lt;/font&gt; Main()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;br&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;AS2:::::::::::::::&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&amp;nbsp;Main &lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private var mainmovie:MovieClip;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public function&lt;/font&gt; Main(targetScope:MovieClip)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mainMovie = targetScope;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Utils&amp;nbsp;class example&amp;nbsp;:&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;package&lt;/font&gt; com.yourcompany.yourprojectname.utils&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;public class&lt;/font&gt;&amp;nbsp;YourUtilClassName&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public function&lt;/font&gt; YourUtilClassName()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;br&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Fine I accept the way you have presented and will attempt to try this. But tell me how do I proceed after this ?&lt;/p&gt; &lt;p&gt;That was a good question you asked now, get back to the folder architecture mentioned above for a flash project. Supposing you are using AS3 then you just need to set the Main.as&amp;nbsp;as the document's class with the path com.yourcompany.yourprojectname.main.Main.as. Once again if you are using AS2 then comes the role of the "includes" folder where you write a small main.as and place it in this folder. The content of the main.as file would be something like as shown below. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#0000ff"&gt;import&lt;/font&gt; com.yourcompany.yourprojectname.main.Main;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; main:Main = &lt;font color="#0000ff"&gt;new&lt;/font&gt; Main(&lt;font color="#0000ff"&gt;this&lt;/font&gt;);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Save this file and include it in the first frame of the main main using : &lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;#include&lt;/font&gt; &lt;font color="#008080"&gt;"includes/main.as"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#008080"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now try compiling the file and lo the compile has failed ! But why ? I don't want to realize now that after all this amount of reading this has resulted in an error. Please don't tell me that. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Patience my friend I did not want you to anticipate errors and the reason for this is just wanted you to wonder and&amp;nbsp;know the concept of Document Class Path setting.&amp;nbsp;If you remember correctly we have put the fla inside&amp;nbsp;a folder named "src" and the files are above one level from the path of the flash source file. So when the movie is compiled it starts to look for the class files and the included file and hence it panics for it expects to find the folder "includes" and "com" inside "src" itself. To clarify all about this we will now look at Publish Settings.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Publish Settings ::::::::::::::::::::::&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Document Class Path :&lt;/p&gt; &lt;p&gt;Since we wanted to maintain the architecture of the folder intact we have kept the files in their respective directories. So in order to compile the class files along with the included "as" files we will add an&amp;nbsp;new path&amp;nbsp;using the PLUS button and enter ".." to Document Class Path in the Publish Settings for swf. Screenshot available for more clarification.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://farm3.static.flickr.com/2309/1727397190_d1bfb7011c_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img src="http://farm3.static.flickr.com/2309/1727397190_f5853c842a_m.jpg"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Publish Location Setting. Since the outputs generally go to the bin folder decide if the version is a release version or the debugger version and point them to the respective folders (release/debug)&amp;nbsp;inside bin folder.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;That's all is needed to be known for a effective project maintenance and the rest lies upon your rational and creative intelligence. See you all in a short time and till then bye.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Regards,&lt;/p&gt; &lt;p&gt;Ashok Srinivasan.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-439160994031564453?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/439160994031564453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=439160994031564453' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/439160994031564453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/439160994031564453'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/10/organizing-your-actionscript-code.html' title='Organizing your ActionScript code.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2309/1727397190_f5853c842a_t.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-9080809923029547703</id><published>2007-10-04T03:06:00.001-07:00</published><updated>2007-10-04T03:06:40.427-07:00</updated><title type='text'>AS3 Migration - XML PARSING.</title><content type='html'>&lt;p&gt;Something is&amp;nbsp;better than nothing. This is a thought that runs into the mind of a Flash Developer working on a project that requires a lot of XML based data handling. But now that is not the case anymore, with the new AS 3.0 comes a powerful XML parser that implements &lt;a href="http://www.w3schools.com/e4x/default.asp" target="_blank"&gt;E4X&lt;/a&gt;&amp;nbsp;standards. With this standard being implemented in AS 3.0 now we don't have to go through the pain of parsing a known&amp;nbsp;XML format anymore. What&amp;nbsp;I mean is &amp;nbsp;no more heavy loops and inner loops to access a childnode at a deeper levels. But still do not worry for the legacy XML AS 2.0 classes have been moved to flash.xml package and retained. So if you still want to use the old style XML class&amp;nbsp;still you can have it from this package. My sincere recommendation would be to get used to the new one and discard the old fashion of parsing the XML. &lt;/p&gt; &lt;p&gt;When I said &lt;a href="http://www.w3schools.com/e4x/default.asp" target="_blank"&gt;E4X&lt;/a&gt;&amp;nbsp;has been implemented what do I exactly mean by that ? In ActionScripting 2.0 while dealing with XML we had to refer to children nodes and their nodes values using index positions (numbers) and never had a way to find an element in a document by using the name value. Meaning we were not able to search XML documents using name values but had to use integers as the index position for locating&amp;nbsp;XML nodes. This resulted in cumbersome loops and logics to access a particular childnode that was lying deep into the rabbit hole.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For example consider the&amp;nbsp;below family tree represented in XML.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#004080" size="2"&gt;&amp;lt;GrandFather&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Ram&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Andrew/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;John/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Josephine age=21 isSingle ="single" sex="girl" beautiful="true"/&amp;gt;&lt;/font&gt;&lt;font face="Courier New" color="#004080" size="2"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Ram&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Rahim&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;David/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Celine/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Paul/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Mary age=24 isSingle =&amp;nbsp;"married" sex="girl" beautiful="true"&lt;font face="Courier New" color="#004080" size="2"&gt;&lt;/font&gt;/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Rahim&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/children&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#004080" size="2"&gt;&amp;lt;/GrandFather&amp;gt;;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#004080" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;So the XML is all about some Grandfather's family. The children node clearly shows the number of&amp;nbsp;sons he had under the node name children. Now further penetrating into his children nodes we&amp;nbsp;understand&amp;nbsp;more of&amp;nbsp;his children's family and about their&amp;nbsp;offspring's.&amp;nbsp;Ok now let's say&amp;nbsp;I am interested about the family of his&amp;nbsp;first son "Ram". And to enquire about&amp;nbsp;Ram's family&amp;nbsp;details present in the&amp;nbsp;XML using AS 2.0 would be done&amp;nbsp;as shown below.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;AS 2.0 ::::::::::::&lt;/em&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; &lt;font color="#000000"&gt;xml&lt;/font&gt;:&lt;font color="#0000ff"&gt;XML&lt;/font&gt; = &lt;font color="#0000ff"&gt;new XML&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;'&amp;lt;GrandFather&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;children&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Ram&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font size="+0"&gt;&amp;lt;children&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Andrew/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;John/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Josephine age=21 isSingle =&amp;nbsp;"single" sex="girl" beautiful="true"/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="#008000"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;font size="+0"&gt;&amp;lt;/children&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Ram&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Rahim&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;children&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;David/&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Celine/&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Paul/&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Mary age=21 isSingle =&amp;nbsp;"married" sex="girl" beautiful="true"/&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/children&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Rahim&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/children&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GrandFather&amp;gt;'&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Courier New" color="#808080" size="2"&gt; &lt;p&gt;&lt;br&gt;&lt;font color="#008000"&gt;&lt;font color="#000000"&gt;xml&lt;/font&gt;.&lt;font color="#0000ff"&gt;ignoreWhite&lt;/font&gt; = &lt;font color="#0000ff"&gt;true&lt;/font&gt;;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#008000"&gt;&lt;br&gt;&lt;font color="#0000ff"&gt;trace&lt;/font&gt;&lt;font color="#000000"&gt;(xml.&lt;/font&gt;&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;font color="#0000ff"&gt;childNodes&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So in order to know about Ram's family we have to start from his grandpa as a reference and go all the way using the&amp;nbsp;firstChild&amp;nbsp;property (or childNodes[0]) for&amp;nbsp;four levels and finally ask for the childNodes property&amp;nbsp;to know about Ram's Children. &lt;/p&gt; &lt;p&gt;Now seeing that Ram's third child is a girl whose&amp;nbsp;name is&amp;nbsp;Josephine (nice name isn't it ?)&amp;nbsp;with age&amp;nbsp;being 21 and also beautiful property being true, I would like to know if she is single and hence see if&amp;nbsp;I can marry her(her attribute claims that&amp;nbsp;she is beautiful). Let's see how I can message her in AS 2.0 for marrying her&amp;nbsp;if her status&amp;nbsp;is single, for I don't want to be beaten by her husband incase she is married already.&lt;/p&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; josephine:&lt;font color="#0000ff"&gt;XMLNode&lt;/font&gt; = xml.&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;.&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;.&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;.&lt;font color="#0000ff"&gt;firstChild&lt;/font&gt;.&lt;font color="#0000ff"&gt;childNodes&lt;/font&gt;[2];&lt;/font&gt;&lt;/font&gt;  &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;(josephine.&lt;font color="#0000ff"&gt;attributes&lt;/font&gt;.isSingle == 'single')&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;trace&lt;/font&gt;(&lt;font color="#008000"&gt;'Josephine will you marry me ?'&lt;/font&gt;);&lt;br&gt;}&lt;br&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;trace&lt;/font&gt;(&lt;font color="#008000"&gt;'Convey my regards to your husband'&lt;/font&gt;);&lt;br&gt;}&lt;/font&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Without bothering about my what happened to my proposal let's get back to the tutorial and see how the above process can be done in AS 3.0. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;AS 3.0 ::::::::::::&lt;/em&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; family:&lt;font color="#0000ff"&gt;XML&lt;/font&gt; = &amp;lt;GrandFather&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Ram&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Andrew/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;John/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Josephine age="21" isSingle="single" sex="girl" beautiful="true" /&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New" size="2"&gt;&amp;lt;/children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Ram&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rahim&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;David/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Celine/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Paul/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Mary/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Rahim&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/children&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GrandFather&amp;gt;;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#008000"&gt;&lt;font color="#0000ff"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;trace&lt;/font&gt;(family.&lt;font color="#0000ff"&gt;descendants&lt;/font&gt;('children')[1].&lt;font color="#0000ff"&gt;children&lt;/font&gt;());&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; josephine:&lt;font color="#0000ff"&gt;XMLList&lt;/font&gt; = family.&lt;font color="#0000ff"&gt;descendants&lt;/font&gt;(&lt;font color="#008000"&gt;'Josephine'&lt;/font&gt;);&lt;/font&gt;&lt;/font&gt; &lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;(josephine.&lt;font color="#0000ff"&gt;attribute&lt;/font&gt;('isSingle') == 'single')&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;trace&lt;/font&gt;(&lt;font color="#008000"&gt;'Josephine will you marry me ?'&lt;/font&gt;);&lt;br&gt;}&lt;br&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;trace&lt;/font&gt;(&lt;font color="#008000"&gt;'Convey my regards to your husband'&lt;/font&gt;);&lt;br&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Don't you think this is much easier than the previous one? The concept reference by name is actually good. Still one can access the childnodes using index positions too but the thing is&amp;nbsp;it is more easy to traverse through a&amp;nbsp;XML using&amp;nbsp;String based search words rather than indexes.&amp;nbsp;&lt;/p&gt; &lt;p&gt;Did you see the vast leap in XML processing ? I would personally say that is really a great thing Adobe has introduced into&amp;nbsp;AS 3.0. For&amp;nbsp;I see no more nightmares with&amp;nbsp;monster loops&amp;nbsp;having big i,j,k..... claws to fight through a XML and its childNodes.&lt;/p&gt; &lt;p&gt;Hope the above tutorial on XML was useful. More is yet to come.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Regards,&lt;/p&gt; &lt;p&gt;Ashok Srinivasan.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-9080809923029547703?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/9080809923029547703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=9080809923029547703' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/9080809923029547703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/9080809923029547703'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/10/as3-migration-xml-parsing.html' title='AS3 Migration - XML PARSING.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-4634500765439757360</id><published>2007-09-13T23:24:00.001-07:00</published><updated>2007-09-13T23:39:57.137-07:00</updated><title type='text'>AS 3 Migration ..... Part 2</title><content type='html'>&lt;p&gt;As each day is progressing with AS-3, my life has become really interesting nowadays. Today we will be seeing the next step's we will be taking in learning more about&amp;nbsp;AS-3 migration. To do that we will start with a small hello world application. By this way we will learn almost all&amp;nbsp; of the basic aspects of Flash/AS 3.0 and by the way&amp;nbsp;to do this exercise&amp;nbsp;you&amp;nbsp;need to have Flash CS3 installed&amp;nbsp;in your machine.&lt;/p&gt; &lt;p&gt;Before starting with the new HelloWorld application, we have a small home work to be done initially. Create a new folder in a location and with name of your convenience and inside the folder you created just now, create a new folder&amp;nbsp;named "Hello World".&amp;nbsp;Once that is done then navigate inside the created folder and create&amp;nbsp;a subfolder named "com". Inside "com" create another subfolder named "learn". Don't get angry with me but for the one final time create two folders named "as3" and "Main" as subfolder's inside the last created folder "learn".&lt;/p&gt; &lt;p&gt;Now if look at&amp;nbsp; your current screen it should look like the one below(except for the three red circles which was made by me using mspaint to show the path and the two subfolders created for reference).&lt;/p&gt; &lt;p&gt;&lt;a title="Pic00" href="http://farm2.static.flickr.com/1171/1377280246_62ae874177_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="109" src="http://farm2.static.flickr.com/1171/1377280246_62ae874177_o.jpg" width="236"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Thats it for now and&amp;nbsp;run the Flash IDE, after it has initialized&amp;nbsp;completely do select&amp;nbsp;"File" -&amp;gt;&amp;nbsp;"New". From the options select "Flash File(ActionScript 3.0)"&amp;nbsp;and click "OK". The screenshot is attached below for your reference. &lt;/p&gt; &lt;p&gt;&lt;a title="Pic01" href="http://farm2.static.flickr.com/1283/1377170894_79c190d5b6_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="251" src="http://farm2.static.flickr.com/1283/1377170894_79c190d5b6_o.jpg" width="390"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;After creating the Actionscript 3.0&amp;nbsp; type File click on the stage and&amp;nbsp;create&amp;nbsp;two objects as follows&lt;/p&gt; &lt;p&gt;1)&amp;nbsp;Dynamic TextField&amp;nbsp; - instance name "$dyn". &lt;/p&gt; &lt;p&gt;2) Simple&amp;nbsp;Button - instance name "$btn"&amp;nbsp;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now click an stage area and open the properties panel(shortcut ctrl+f3). Now the property panel is open type&amp;nbsp;com.learn.Main.Main in&amp;nbsp;the Document Class field. See screenshot below.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a title="PIC02" href="http://farm2.static.flickr.com/1227/1377593714_a80b4a89ff_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="326" src="http://farm2.static.flickr.com/1227/1377593714_a80b4a89ff_o.jpg" width="415"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Do not try to compile for we have to add the class files now. Still you wish to know what could have changed in the error messages go ahead and try it. &lt;/p&gt; &lt;p&gt;After all the above steps are completed hit Ctrl+N or create a new ActionScript File from the&amp;nbsp;New Document&amp;nbsp;window just like the way you created a new flash file sometime before but select ActionScript File (which would be probably the sixth item).&amp;nbsp;Upon successfully opening an empty ActionScript file copy and paste the code below. see screenshots first.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a title="PIC03" href="http://farm2.static.flickr.com/1037/1376769233_bee447d192_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="234" src="http://farm2.static.flickr.com/1037/1376769233_bee447d192_o.jpg" width="349"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#808080"&gt;package com.learn.Main&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.display.MovieClip;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.text.TextField;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.events.MouseEvent;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import flash.display.SimpleButton;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import com.learn.as3.HelloWorld;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Main extends MovieClip&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private var hWorld:HelloWorld;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function Main()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; init();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function init():void&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace('I N I T');&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hWorld = new HelloWorld();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $dyn.text = hWorld.sayHello();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $btn.addEventListener(MouseEvent.CLICK,releaseAction);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function releaseAction(e:MouseEvent):void&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace('onRelease : '+e.target.name);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Finished pasting the above code ???? Now save it in the&amp;nbsp;name "Main" under the folder com-&amp;gt;learn-&amp;gt;Main-&amp;gt;Main.as. What we have done now is an ActionScript class has been associated with the FlashDocument itself. have you ever remembered this being possible in the previous versions ? what we have been doing earlier was that we wrote an class file and associated the main timeline as an parameter to AS2.0 class file. But now the Flash File itself can be associated with an Custom Class File. isn't this great ?&lt;/p&gt; &lt;p&gt;We are almost 70% done for the tutorial to be completed. The one final thing you have to do is create another ActionScript Class just like the way you created Main.as and paste the below code in that. Save the file under the folder com-&amp;gt;learn-&amp;gt;as3 with the name HelloWorld.as.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#808080"&gt;package com.learn.as3&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class HelloWorld&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function HelloWorld()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function sayHello():String&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Hello World";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Done pasting the second code? Now get back to the fla file and save it under the folder Hello World with the file named as "HelloWorld.fla". Now there should be a flash source file "HelloWorld.fla"(you will see file name extension ".fla" only if you have enabled show extensions setting in windows) and a folder (which we created initially)&amp;nbsp;named "com" inside the folder HelloWorld. To avoid confusion and for having a clarity see screenshot below.&lt;/p&gt; &lt;p&gt;&lt;a title="PIC04" href="http://farm2.static.flickr.com/1058/1377728028_ee1b4ae8fa_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="226" src="http://farm2.static.flickr.com/1058/1377728028_ee1b4ae8fa_o.jpg" width="403"&gt;&lt;/a&gt; &lt;br&gt;&lt;/p&gt; &lt;p&gt;Now that everything is in place and the only step remaining is to compile the flash file we have created. Doing this will generate the swf file named "HelloWorld.swf " without any errors if you had&amp;nbsp;copied and pasted the code and saved them with the appropriate names and at&amp;nbsp;correct location specified above. The output of the swf &amp;nbsp;is attached as a screenshot below. &lt;/p&gt; &lt;p&gt;&lt;a title="PIC05" href="http://farm2.static.flickr.com/1185/1377776630_8454453ad4_o.jpg" target="_blank" atomicselection="true"&gt;&lt;img height="369" src="http://farm2.static.flickr.com/1185/1377776630_8454453ad4_o.jpg" width="459"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;But still if you wish to know what happens when the button is clicked you need to either run it from the Flash IDE or have some good logger tools like afterthought or Flash Tracer plugin for firefox. &lt;/p&gt; &lt;p&gt;Thats it for now and we will in less time see what the chunk of code written for this tutorial does.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Regards,&lt;/p&gt; &lt;p&gt;Ashok Srinivasan.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-4634500765439757360?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/4634500765439757360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=4634500765439757360' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/4634500765439757360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/4634500765439757360'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/09/as-3-migration-part-2.html' title='AS 3 Migration ..... Part 2'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-6585574919936783813</id><published>2007-09-11T04:24:00.001-07:00</published><updated>2007-09-11T04:30:27.914-07:00</updated><title type='text'>AS3 Migration......</title><content type='html'>&lt;p&gt;&amp;nbsp;  &lt;p&gt;Hi folks,&lt;br&gt;it's been a long time once again. Latest news at my end is that i have started working on AS3 and i need to say at this point that it really great and cool. With the new AVM2 (adobe virtual machine version 2) powering players above 9 one can really create wonders double/triple the times over the previous versions.&lt;br&gt;Initially i was a bit skeptical about getting into AS3 for my current projects i am working on are so Himalayan such that it would take a lot of time and energy to really convert it to support flash player9. Moreover i felt it was a great paradigm shift for someone like me for AS3 migration. Guru's out there have really started rocking with AS3, while a lot of children like me sitting here keep wondering about what's the deal in the new version of flash. I was also feeling that i am not doing my homework on learning AS3 for my current projects did not spare me the time for that but luckily and also daringly i thought of starting my new project based on AS3. Though it was a great risk but still was ready to face it.&lt;br&gt;Below i have mentioned a few areas where great changes have happened.&lt;/p&gt; &lt;p&gt;&lt;br&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#804040"&gt;The new Class&amp;nbsp;style :::::&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt; &lt;p&gt;&lt;br&gt;Whenever we wanted to have more than one class file to share the same name serving different purpose but could not have it. In As3 they have introduced the concept of package naming culture as used in JAVA(but can you tell me what in Actionscript is not like JAVA?). This serves as a way to differentiate two classes sharing the same name but serving different purposes. Look below for an example.&lt;/p&gt; &lt;p&gt;&lt;br&gt;An example of a AS3 class file&lt;br&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#6c6c6c"&gt;package com.mycompany.myprojectname.purposename;&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;import requiredclasses.*;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MyClass&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function MyClass()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6c6c6c"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public function doSomething():void&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6c6c6c"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6c6c6c"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6c6c6c"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;And now after the class is being written we can as usual import the package in the timeline and instantiate the variable the usual way as we do in AS2.0&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#000000"&gt;&lt;em&gt;&lt;u&gt;Example ::::::&lt;/u&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#808080"&gt;import com.mycompany.myprojectname.purposename.MyClass;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#808080"&gt;var mclass:MyClass =&amp;nbsp; new MyClass();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;mclass.doSomething();&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;And now as we have now seen how the classes have changed to a class way we will now look at what has happened to our onPress, onRelease, onReleaseOutside etc.,&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;em&gt;&lt;font color="#800000"&gt;Handling Events ::::::&lt;/font&gt;&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Before&amp;nbsp;dwelling deep into the details we will now look at how we assigned mouse events to movieclips and buttons the AS-2.0 way.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;u&gt;&lt;font color="#000000"&gt;Example AS-2.0 ::::&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#404040"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#6e6e6e"&gt;var mc:MovieClip = this.createEmptyMovieClip("mc",0);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6e6e6e"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mc.onPress = function()&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6e6e6e"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6e6e6e"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("Hey i think a jerk pressed me");&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6e6e6e"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //output shows this message when pressed&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#6e6e6e"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;em&gt;&lt;u&gt;&lt;font color="#000000"&gt;Example AS-3.0 ::::::&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000"&gt;First create a rectangle and convert it to movieclip with the library name MyMc. Below&amp;nbsp;are the screenshot's for your reference.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;img src="http://3.bp.blogspot.com/_tKLwtqbHFYw/RuZ6JjRIoYI/AAAAAAAAAAM/GOCY6zdP0n0/s400/converttosymbol.JPG"&gt; &lt;/p&gt; &lt;p&gt;&lt;img src="http://1.bp.blogspot.com/_tKLwtqbHFYw/RuZ6RDRIoZI/AAAAAAAAAAU/N3QRK3uxmVw/s400/addLibraryProperties.PNG"&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;import flash.display.MovieClip;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;import flash.events.MouseEvent;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;var mc:MyMc = new MyMc();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;function myMcClick(e:MouseEvent):void&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;{&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;trace("Hey some jerk pressed me");&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.addChild(mc);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;mc.addEventListener(MouseEvent.CLICK,myMcclick);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So this is the way we add actions to the new version of Flash. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;&lt;font color="#800000"&gt;Depth Management ::::::&lt;/font&gt;&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Yeah this is the part i loved the most with AS-3.0. From the above example's code for AS-2.0 and 3.0&amp;nbsp;you would have noticed that there are some differences in the way we work with adding and assigning actions to MovieClips. The thing is that in the new version we have been spared the job of assigning the depth. You just need to use the keyword "addChild" which is a method in any MovieClip to add a childMovieClip. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;&lt;u&gt;Example ::::&lt;/u&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;//to create an MovieClip from the library.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;var myMc:MyMc = new MyMc();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.addChild(myMc);&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So how do we remove a MovieClip we added to the stage ????&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;u&gt;&lt;em&gt;Example :::::&lt;/em&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;//to create an EmptyMovieClip from the library.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;var myMc:MyMc = new MyMc();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;myMc.name = ''foo';&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.addChild(myMc);&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;//To remove this movieclip you have created.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.removeChildAt(0);//where the number is the index.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;//or&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.removeChild(this.getChildByName('foo'));&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;//or&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#808080"&gt;this.removeChild(myMc);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Many more promising new things have come in the new version and i am at all loss of words to express it completely now.&amp;nbsp;Better keep visiting my blog for there will be more updates,posts and learning's with what's&amp;nbsp;new in AS-3.0.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-6585574919936783813?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/6585574919936783813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=6585574919936783813' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6585574919936783813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/6585574919936783813'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/09/as3-migration.html' title='AS3 Migration......'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tKLwtqbHFYw/RuZ6JjRIoYI/AAAAAAAAAAM/GOCY6zdP0n0/s72-c/converttosymbol.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-7940823461483422977</id><published>2007-07-24T05:09:00.000-07:00</published><updated>2007-07-24T05:47:44.113-07:00</updated><title type='text'>Children will be Children, Flash will be Flash</title><content type='html'>Well the title itself suggests when things prove to be problematic while dealing it the natural way  then we need to do some workarounds always. But at the end we find a solution. And here i present a problem that i faced while working one of the vital child of Flash and mine called as the TEXTBOX.&lt;br /&gt;&lt;br /&gt;Assuming myself to be a dad in flash programming (not yet a dad in real life b'coz i am not a husband yet. I am still an Eligible bachelor you see...)  i had to deal with this TextBox child of mine. Let me tell you his problems, he can either stuff his fonts with him by embedding or either stay using Device Fonts before going out to the world from his development home. But the former way suggests that his bag becomes heavy with each different type of font he will be supporting. Consider supporting Ten generic fonts that will be available in all the operating systems, then the process is to add 4 types of fonts in the library with normal,bold,italic, and bolditalic options seperately.&lt;br /&gt;&lt;br /&gt;Elobrating on the process consider embedding Arial font which would result in four font items in the library with following linkage ids :&lt;br /&gt;&lt;br /&gt;Arial - normal support with bold and italic option disabled.&lt;br /&gt;ArialBold - Font with only Bold option.&lt;br /&gt;ArialItalic - Font with only Italic support.&lt;br /&gt;ArialBoldItalic - Font with Bold and Italic support.&lt;br /&gt;&lt;br /&gt;And the max size for all the above embedded fonts items would be 72.&lt;br /&gt;&lt;br /&gt;Now coming to the original count that we needed to support was 10 and hence the total number of embedded fonts we need would be (10 x 4 = 40). Can you imagine the size of your swf ? ok, here still i have the option of using RunTime shared font. After all this is done we can now rotate,scale the textboxes in our application.&lt;br /&gt;&lt;br /&gt;Think once again is there a better solution to this ? Now being in the world where Flash7 is close to becoming history and flash 9 prevailing on all the browsers widely we now have options of rendering text in a better way.&lt;br /&gt;&lt;br /&gt;One more time i am going to present you all a way to exploit the Bitmap Class for serving this purpose. Coming to the original requirement i just removed all the embedded fonts from the library and selected the Device Fonts as the text rendering method. But here comes the problem that i will not be to rotate and scale the textboxes in my application. Also using Device fonts ensures me no heavy stuffs to be stuffed to my TextBox child. He can be light and compact, the only time when i would face problem would be when rotating my child.&lt;br /&gt;&lt;br /&gt;Hmmmm...... what are we going to do now ? Better would be to draw a bitmap object using the textbox, attach it to a movieclip and rotate that instead of transforming the textbox directly. So only while editing the text we need to show the textbox and once the editing is completed we display bitmap that is drawn to the updated version of the textbox with the transformation applied already.&lt;br /&gt;&lt;br /&gt;Hope you understood how i dealt with my son and might also help you in a similar scenario.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-7940823461483422977?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/7940823461483422977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=7940823461483422977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/7940823461483422977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/7940823461483422977'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/07/children-will-be-children-flash-will-be.html' title='Children will be Children, Flash will be Flash'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-2156567405766170346</id><published>2007-07-05T00:50:00.000-07:00</published><updated>2007-07-19T07:58:45.454-07:00</updated><title type='text'>Being Greedy for finding WordWrap in Flash.</title><content type='html'>Hello All,&lt;br /&gt;&lt;br /&gt;Again after a longtime here i come to talk about learning a way to find the breaking position in a Dynamic/Input Textbox. Wait did i mean "Finding Wordwrap positions in a Dynamic Textbox " ?. Yes you thought right. I am here to discuss an algorithm to find the positions wherever Wordwrap happens to appear in a Dynamic Textbox in flash. But beware it is very greedy and quite possible that it might eat your processor. Still check out wikipedia on wordwrap and you will find "greedy" type algorithm to be one of the ways to find wordwrap positions in general.&lt;br /&gt;&lt;br /&gt;Okay let me not take this post further by posting code which again will not ensure that all of us might understand it.&lt;br /&gt;&lt;br /&gt;But before you proceed brush yourself about the TextFormat class and especially the "getTextExtent" method. I hope you would have guessed what i am trying to do. Yeah, Inorder to find the breaking positions within a TextBox this method is sufficient enough to find the answer/solution.&lt;br /&gt;&lt;br /&gt;Wait does flash not have a method to do this ? i would say a BIG NO.  For that instance not only flash but any application would not have a method to find the wordwrap position. Do you know the reason why ? Since the wordwrapping is handled by the applications UI Algorithm and does not insert nor append any line formatting characters such as "\n" or "\t" etc., at the breaking point so that we can break the text using the split method using these characters.&lt;br /&gt;&lt;br /&gt;Instead the solution that worked for me was getting the current TextFormat of the textbox we need to find wordwrap positions using getTextFormat(). Using this textformat we take the string content of the textbox and then using "WHILE" loop i move the character index one by one and store it in a temporary string "tempString" thereby also checking simultaneously the width in pixels which i get by applying  MyTextFormat.getTextExtent(tempString) to see if the textWidth returned has not crossed more the width of the textbox for which we are currently checking.&lt;br /&gt;&lt;br /&gt;Once if i find the condition of tempString width being more than the currentTextBox Width is successfully satisfied, i remove that part of the tempString from the original string using :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;&lt;span style="font-family: courier new;"&gt;originalString = originalString.&lt;span style="color: rgb(51, 51, 255);"&gt;substring&lt;/span&gt;(&lt;/span&gt;tempString.&lt;span style="color: rgb(51, 51, 255);"&gt;length&lt;/span&gt;-1,originalString.&lt;span style="color: rgb(51, 51, 255);"&gt;length&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;someArray.&lt;span style="color: rgb(51, 51, 255);"&gt;push&lt;/span&gt;(tempString.&lt;span style="color: rgb(51, 51, 255);"&gt;substring&lt;/span&gt;(0,tempString.&lt;span style="color: rgb(51, 51, 255);"&gt;length&lt;/span&gt;-1));&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;// REmember that the length has exeeded so the breaking point is the length -1 ;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;//Now clear the tempString &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;tempString = '';&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);font-family:arial;font-size:100%;"  &gt;&lt;span style="font-family:georgia;"&gt;This &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:georgia;"&gt;process is carried until after all the characters are removed from my original string meaning  (originalString == ''").&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;After this algorithm has finished running i would end up with an array containing strings. From the array length once can find the total number of lines and also the way the lines have been split up in a textbox with any font, size etc.,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Hope you understood the intention and its solution posted in this blog.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Ashok Srinivasan.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);font-family:georgia;font-size:130%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-2156567405766170346?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/2156567405766170346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=2156567405766170346' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/2156567405766170346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/2156567405766170346'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/07/being-greedy-for-finding-wordwrap-in.html' title='Being Greedy for finding WordWrap in Flash.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-3758692157547414718</id><published>2007-03-08T02:07:00.000-08:00</published><updated>2007-03-08T02:42:27.798-08:00</updated><title type='text'>Adding and removing Strings in ActionScript.</title><content type='html'>It's been a long time since i was hanging around with BitmapData and now for a change i am going to write about one of the primitive datatype of ActionScript called "String". Today i am going to discuss with a story about why we should focus on using methods that have been shipped with the native classes rather than writing flash loops and achieve the same.&lt;br /&gt;&lt;br /&gt;Today my colleague came rushing to me to show his new prototype he had written for String class. The reason he came to me was that i am known for optimizing codes(do not blame me for this) and hence he wanted me to take a glance of his code and suggest necessary  modifications wherever  applicable. But to his dismay and disappointment slowly his face started to grow smaller and smaller as we sat down to modify his code (he must have been thinking "oh my god why did i ask this guy anyway).&lt;br /&gt;&lt;br /&gt;Still wondering what am i talking about ? Let me take the pleasure of telling you what happened. In one of the application my friend was developing he had a requirement of adding and removing strings. The scenario was like this, a word is passed to a custom method written as a prototype as an argument which needs to be added to the existing string if it does not exist. Else if the particular word already exists then remove it.&lt;br /&gt;&lt;br /&gt;hmmmmm, nice requirement i would say and below is the code written by my friend .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="identifier"&gt;String&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;.appendAndRemove = &lt;span class="keyword"&gt;function&lt;/span&gt;(remStr:&lt;span class="identifier"&gt;String&lt;/span&gt;):&lt;span class="identifier"&gt;String&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;     &lt;span class="keyword"&gt;var&lt;/span&gt; tempArr:&lt;span class="identifier"&gt;Array&lt;/span&gt; = &lt;span class="identifier"&gt;this&lt;/span&gt;.&lt;span class="identifier"&gt;split&lt;/span&gt;(remStr);&lt;br /&gt;     &lt;span class="identifier2"&gt;trace&lt;/span&gt;(&lt;span class="'string'"&gt;'arr : '&lt;/span&gt;+&lt;span class="identifier"&gt;this&lt;/span&gt;.&lt;span class="identifier2"&gt;indexOf&lt;/span&gt;(remStr));&lt;br /&gt;     &lt;span class="keyword"&gt;if&lt;/span&gt;(tempArr.&lt;span class="identifier2"&gt;length&lt;/span&gt; &gt;=2)&lt;br /&gt;     {&lt;br /&gt;             &lt;span class="keyword"&gt;var&lt;/span&gt; tempArr1:&lt;span class="identifier"&gt;Array&lt;/span&gt; = &lt;span class="identifier"&gt;this&lt;/span&gt;.&lt;span class="identifier"&gt;split&lt;/span&gt;(remStr+&lt;span class="'string'"&gt;' '&lt;/span&gt;);&lt;br /&gt;             &lt;span class="identifier"&gt;this&lt;/span&gt; = &lt;span class="'string'"&gt;''&lt;/span&gt;;&lt;br /&gt;             &lt;span class="keyword"&gt;for&lt;/span&gt;(i=0;i&lt;temparr1.&gt;&lt;span class="identifier2"&gt;length&lt;/span&gt;;i++)&lt;br /&gt;             {&lt;br /&gt;                     &lt;span class="identifier"&gt;this&lt;/span&gt; += (tempArr1[i].&lt;span class="identifier2"&gt;length&lt;/span&gt; !=0)?tempArr1[i]:&lt;span class="'string'"&gt;''&lt;/span&gt;;&lt;br /&gt;             }&lt;br /&gt;         &lt;br /&gt;     }&lt;br /&gt;     &lt;span class="identifier"&gt;this&lt;/span&gt; += (tempArr.&lt;span class="identifier2"&gt;length&lt;/span&gt; != 2)?remStr+&lt;span class="'string'"&gt;' '&lt;/span&gt;:&lt;span class="'string'"&gt;''&lt;/span&gt;;s;&lt;br /&gt;     &lt;span class="keyword"&gt;return&lt;/span&gt; &lt;span class="identifier"&gt;this&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/temparr1.&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Looking at the code anybody can understand what the developer had intended to do and moreover the name itself suggests sharply about its use. okay let us ask achilles what he has to say about this.&lt;br /&gt;&lt;br /&gt;I would say we could have avoided the loop that's been used in the code and rather used the .join method instead. Below is my version of code which does the same thing as the above code and coincidentally has the same bug the above one has(find it out yourself about what the bug is).&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="identifier"&gt;String&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;.appendAndRemove = &lt;span class="keyword"&gt;function&lt;/span&gt;(remStr:&lt;span class="identifier"&gt;String&lt;/span&gt;):&lt;span class="identifier"&gt;String&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;     &lt;span class="keyword"&gt;return&lt;/span&gt; (&lt;span class="identifier"&gt;this&lt;/span&gt; = (&lt;span class="identifier"&gt;this&lt;/span&gt;.&lt;span class="identifier2"&gt;indexOf&lt;/span&gt;(remStr) == -1)?&lt;span class="identifier"&gt;this&lt;/span&gt;+remStr:&lt;span class="identifier"&gt;this&lt;/span&gt;.&lt;span class="identifier"&gt;split&lt;/span&gt;(remStr).&lt;span class="identifier"&gt;join&lt;/span&gt;(&lt;span class="'string'"&gt;''&lt;/span&gt;));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hey wait do not conclude i am bluffing and believe me both the version of codes literally do the same thing. If you still do not believe go ahead and check it out yourself.&lt;br /&gt;&lt;br /&gt;Meanwhile let's meet you all in some time soon.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-3758692157547414718?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/3758692157547414718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=3758692157547414718' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3758692157547414718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3758692157547414718'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/03/adding-and-removing-strings-in.html' title='Adding and removing Strings in ActionScript.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-3251995193826553099</id><published>2007-02-18T08:40:00.000-08:00</published><updated>2007-02-20T03:46:08.192-08:00</updated><title type='text'>ever wanted to make a face to others ?</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Subject : Face cropping in flash, irregular image cropping, cropping of irregular shapes and of irregular symmetry.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I do not know why but amongst all the new features of flash player 8, BitmapData stands out of the rest shining like DHRUVA guiding and seemingly being the solution to all image/graphic related issue in flash (those issues are now history anyway).&lt;br /&gt;&lt;br /&gt;But i would say that BitmapData ROCKS. Few days back i was just feeling i am getting to love this class very much and wanted to mention about her again and again. The rest of the blog is all about a small application that i had developed to meet the need like cutting a face or cutting a portion of the image using flash. I mean basically think it as an application/tool for cutting the beautiful face of yours and adding it to the headless cartoon with Superman's body. I know you have already suspected that i am upto some mischief. Maybe but even though it is so, but the end result is a tool being developed with the power of flash and php.&lt;br /&gt;&lt;br /&gt;First of all i would like to thank &lt;span style="font-weight: bold; font-style: italic;"&gt;"SEPIROTH"&lt;/span&gt; for his wonderful class tha does the  saving of  BitmapData and sending it to php safely. Hei man your class really rocks.&lt;br /&gt;&lt;br /&gt;Next coming to the flash part (kudos to ME),  which is the easiest part than php. Here is the place where some points are added to the image and in turn the points are interconnected with the lines and filled duly thus making a shape of irregular symmetry. No problem i have at all the times keep monitoring the individual points for their x,y coordinates and thus using them to compute the rectangle formed by these collection of points.&lt;br /&gt;&lt;br /&gt;Do not get overwhelmed at this point for once you see the output you will start to understand howExaggerating i was in this summarisation. But still if you still wish to proceed by reading further read on, else jump to the bottom where there is a link pointing to the location of the files. No problem at all jumping and do not feel bad.&lt;br /&gt;&lt;br /&gt;But before jumping to the link make sure you have all this in your system to test the tool !&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(153, 0, 0);"&gt;PHP server with GD library installed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Note: To install GD library (if not installed, make sure you take a backup of you php.ini before you make any changes.), open you php.ini file and remove the ';' symbol before the line ";extension=php_gd2.dll". This is for windows and i dont know what it looks like to enable GD library in php on linux box. i guess it should be "php_gd2.so" instead of ".dll"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ashok_srinivasan2002/imagecustomcropper.zip"&gt;Link to the image cropping files.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geocities.com/ashok_srinivasan2002/screenshot.JPG"&gt;Link to the screenshot of the tool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(incase you are finding it difficult to download the file then mail me : ashok_srinivasan2002@yahoo.com. i will see to that i will be in a position to sort it.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope you enjoy and use this tool for your wildest uses and adventures.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-3251995193826553099?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/3251995193826553099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=3251995193826553099' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3251995193826553099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/3251995193826553099'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/02/ever-wanted-to-make-face-of-others.html' title='ever wanted to make a face to others ?'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-502477655003033907</id><published>2007-02-16T03:38:00.000-08:00</published><updated>2007-02-16T04:30:04.546-08:00</updated><title type='text'>A Delegate Action.</title><content type='html'>So what does Delegate has got to do with ActionScript ? Yes it means a lot when it comes to Actionscript classes and scope management. Scope issues are one of the fundamental issues when it comes to ActionScript  classes.&lt;br /&gt;&lt;br /&gt;Let me take the pleasure of discussing about Delegate class today.  But wait  where does Delegate come from ? She comes from mx.utils.Delegate. Meaning there is a folder 'mx' containing lots of flash goodies classes among them we find a branch 'utils' which holds the fruit called 'Delegate'. Why do i need to praise so much will be understood by you shortly.&lt;br /&gt;&lt;br /&gt;Consider the following script :&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="'linecomment'"&gt;//in the main timeline we have a movieclip with instance name "$mc".&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; This:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt; = &lt;span class="identifier"&gt;this&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span class="identifier"&gt;this&lt;/span&gt;.$mc.&lt;span class="identifier"&gt;onPress&lt;/span&gt; = &lt;span class="keyword"&gt;function&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt;        &lt;span class="identifier2"&gt;trace&lt;/span&gt;(This);&lt;span class="'linecomment'"&gt;//traces _level0;&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Guess that code was very elementary to be understood and hope does not require any explanation. Things are working fine is assumed based on the trace message of "_level0" which should be seen when rendered.&lt;br /&gt;&lt;br /&gt;But this is not the case when it comes to classes. For example consider the next example :&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="'linecomment'"&gt;//Now in the main timeline using the movie created with the example 1.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; This:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt; = &lt;span class="identifier"&gt;this&lt;/span&gt;;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; te:Test = &lt;span class="keyword"&gt;new&lt;/span&gt; Test($mc);&lt;br /&gt;&lt;br /&gt;&lt;span class="'linecomment'"&gt;//For the class 'Test' copy the code below, create a new .as name it "Test" and paste the code.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="'linecomment'"&gt;//The class defintion starts.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; Test&lt;br /&gt;{&lt;br /&gt;        &lt;span class="keyword"&gt;var&lt;/span&gt; movie:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;;&lt;br /&gt;        &lt;span class="keyword"&gt;var&lt;/span&gt; This:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;;&lt;br /&gt;        &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; Test(mc:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;                movie = mc;&lt;br /&gt;                This = movie.&lt;span class="identifier"&gt;_parent&lt;/span&gt;;&lt;br /&gt;                movie.&lt;span class="identifier"&gt;onPress&lt;/span&gt; = &lt;span class="keyword"&gt;function&lt;/span&gt;()&lt;br /&gt;                {&lt;br /&gt;                        &lt;span class="identifier2"&gt;trace&lt;/span&gt;(This)&lt;span class="'linecomment'"&gt;//traces 'undefined';&lt;br /&gt;&lt;/span&gt;                }&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ctrl + Enter and click the movieclip on the stage.Now did you see what happened, it would have been a message 'undefined'. So how are we going to handle this forms the rest of the story with the introduction of our Delegate character as the hero.&lt;br /&gt;&lt;br /&gt;Okay now we will do some slight modification to our "Test" class with the help of Delegate and see what happens.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="'linecomment'"&gt;//The class re - defintion starts.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import&lt;/span&gt; &lt;span class="identifier2"&gt;mx&lt;/span&gt;.utils.Delegate;&lt;br /&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; Test&lt;br /&gt;{&lt;br /&gt;        &lt;span class="keyword"&gt;var&lt;/span&gt; movie:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;;&lt;br /&gt;        &lt;span class="keyword"&gt;var&lt;/span&gt; This:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;;&lt;br /&gt;        &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;function&lt;/span&gt; Test(mc:&lt;span class="identifier2"&gt;MovieClip&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;                movie = mc;&lt;br /&gt;                This = movie.&lt;span class="identifier"&gt;_parent&lt;/span&gt;;&lt;br /&gt;                movie.&lt;span class="identifier"&gt;onPress&lt;/span&gt; = Delegate.create(&lt;span class="identifier"&gt;this&lt;/span&gt;,&lt;span class="keyword"&gt;function&lt;/span&gt;()&lt;br /&gt;                {&lt;br /&gt;                        &lt;span class="identifier2"&gt;trace&lt;/span&gt;(This)&lt;span class="'linecomment'"&gt;//traces '_level0';&lt;br /&gt;&lt;/span&gt;                });&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now on ctrl+Enter and triggering the press action of the movieclip displays a message "_level0" meaning the code was successfully doing the right thing. hmmm can i know what has happened to the new version of 'Test' class ? It was the 'Delegate' class who was taking the pain of mapping the variables of the class within the scope of the $mc's onPress action. B-e-a-utiful isn't it ?&lt;br /&gt;&lt;br /&gt;The 'Delegate' class comes to the rescue for scope management while writing in classes.&lt;br /&gt;&lt;br /&gt;As a bonus i wish to specify a hack for the Delegate class but i am stopped to make you wonder for what the bonus could be. If you start using Delegate class, soon you will come to a point you will be struck. Then at that time come back and earn your bonus. Till then happy sailing with Delegate class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-502477655003033907?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/502477655003033907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=502477655003033907' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/502477655003033907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/502477655003033907'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/02/delegate-action.html' title='A Delegate Action.'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-546309509409626195</id><published>2007-02-14T22:34:00.000-08:00</published><updated>2007-02-14T23:10:57.608-08:00</updated><title type='text'>Cloning is illegal , but not for FLASH OBJECTS..........</title><content type='html'>Its been really a controversial topic. "CLONING" was a buzz word that started the dawn of the era where Biotechonology was seen by a common man. Ask Michael Crichton and he would tell you scores of information about it in the form of stories.  Dolly was the first cloned living being. Then there were protests, controversies and conspiracies following.&lt;br /&gt;&lt;br /&gt;Do not worry by reading this and learning to Clone an Object or Array will not end you up in Jail, for cloning in ActionScript is not controversial or understanding it is like a grasping a big conspiracy theory.&lt;br /&gt;&lt;br /&gt;But before that let us understand why do we need to clone ??? yeah that was a great question and i see a reason why you should read the rest of the story. The real reason for why cloning can be best understood by the following example :&lt;br /&gt;&lt;br /&gt;Example 1 :&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="'linecomment'"&gt;//in the main timeline&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; num1:&lt;span class="identifier"&gt;Number&lt;/span&gt; = 20;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; num2:&lt;span class="identifier"&gt;Number&lt;/span&gt; = num1;&lt;br /&gt;&lt;span class="identifier2"&gt;trace&lt;/span&gt;(num1);&lt;span class="'linecomment'"&gt;//traces 20&lt;br /&gt;&lt;/span&gt;num2 = 50;&lt;br /&gt;&lt;span class="identifier2"&gt;trace&lt;/span&gt;(num1);&lt;span class="'linecomment'"&gt;//traces 20 again;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Did you see what happened?&lt;br /&gt;1)we created a variable num1 with a value 20.&lt;br /&gt;2)Again we created a variable num2 and pointed it to num1.&lt;br /&gt;3)Traced the value of num1 and it was 20&lt;br /&gt;4) changed the value of num2 to 50&lt;br /&gt;5) Traced the value of num1 and it was still 20.&lt;br /&gt;&lt;br /&gt;I hope you would have understood what i am meaning by this. Once again consider the following example.&lt;br /&gt;&lt;br /&gt;Example 2:&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="'linecomment'"&gt;//In the main Timeline&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; obj1:&lt;span class="identifier"&gt;Object&lt;/span&gt; = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="identifier"&gt;Object&lt;/span&gt;();&lt;br /&gt;obj1.&lt;span class="identifier2"&gt;name&lt;/span&gt; = &lt;span class="'string'"&gt;'Ashok'&lt;/span&gt;;&lt;br /&gt;obj1.age  = 24;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; obj2:&lt;span class="identifier"&gt;Object&lt;/span&gt; = obj1;&lt;br /&gt;&lt;br /&gt;&lt;span class="identifier2"&gt;trace&lt;/span&gt;(obj1.&lt;span class="identifier2"&gt;name&lt;/span&gt;);&lt;span class="'linecomment'"&gt;//traces Ashok;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;obj2.&lt;span class="identifier2"&gt;name&lt;/span&gt; = &lt;span class="'string'"&gt;'Srinivasan'&lt;/span&gt;;&lt;br /&gt;&lt;span class="identifier2"&gt;trace&lt;/span&gt;(obj1.&lt;span class="identifier2"&gt;name&lt;/span&gt;);&lt;span class="'linecomment'"&gt;//traces Srinivasan.&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So what happened here. We did the same thing that was done in Example 1, but the difference was that first example was dealing with numbers and the second one was dealing with objects. In the first one it was "copying of the value operation" and in the second one it was "pointer operation" meaning it does not create a copy and store in the new variable but instead points the first object "obj1" to the new name "obj2". Coincidentally this is the same case when we do it with Arrays. Luckily we have the "slice" and "splice" methods which can get us a copy so as to leaving the choice to us for creating a copy or pointer for an Array. But there is not a method that gives us the choice of creating copies.&lt;br /&gt;&lt;br /&gt;Now how can this be solved ? How can i make a copy for an object and not create a pointer instead. ?&lt;br /&gt;&lt;br /&gt;The fundamental principle is to use the "for in " loop method. But how do we clone if there are objects inside object ?&lt;br /&gt;&lt;br /&gt;Accidentally when i was searching for ActionScript blogs yesterday i stumbled upon a blog in the name of "Arul's blog" (link:http://www.shockwave-india.com/blog/services/as-highlight2/index.php)  and there the blogger guy has mentioned about this problem which made me also to think and give a mention cum workaround solution for this problem.&lt;br /&gt;&lt;br /&gt;Using the code in "Arul's Blog" and modifying and reducing the lines where-ever possible i am pasting the code below. Make sure to check it out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;    pre {font-family:"Courier New", Courier, Arial; font-size: 12px;}&lt;br /&gt;    .operator {color: #000000;}&lt;br /&gt;    .keyword {color: #993300;}&lt;br /&gt;    .identifier {color: #000087;}&lt;br /&gt;    .properties {color: #000087;}&lt;br /&gt;    .identifier2 {color : #000087;}&lt;br /&gt;    .linecomment, .blockcomment {color: #808080;}&lt;br /&gt;    .string {color: #0000FF;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="identifier"&gt;Object&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;.clone = &lt;span class="keyword"&gt;function&lt;/span&gt; ()&lt;br /&gt;{&lt;br /&gt;        &lt;span class="keyword"&gt;if&lt;/span&gt; (&lt;span class="keyword"&gt;typeof&lt;/span&gt; (&lt;span class="identifier"&gt;this&lt;/span&gt;) == &lt;span class="'string'"&gt;"object"&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;                &lt;span class="keyword"&gt;var&lt;/span&gt; to = (&lt;span class="identifier"&gt;this&lt;/span&gt; &lt;span class="keyword"&gt;instanceof&lt;/span&gt; &lt;span class="identifier"&gt;Array&lt;/span&gt; )?[]:{};&lt;br /&gt;                &lt;span class="keyword"&gt;for&lt;/span&gt; (&lt;span class="keyword"&gt;var&lt;/span&gt; i &lt;span class="keyword"&gt;in&lt;/span&gt; &lt;span class="identifier"&gt;this&lt;/span&gt;)&lt;br /&gt;                {&lt;br /&gt;                        to[i] = (&lt;span class="keyword"&gt;typeof&lt;/span&gt; (&lt;span class="identifier"&gt;this&lt;/span&gt;[i]) == &lt;span class="'string'"&gt;"object"&lt;/span&gt;) ? &lt;span class="identifier"&gt;this&lt;/span&gt;[i].clone () : &lt;span class="identifier"&gt;this&lt;/span&gt;[i];&lt;br /&gt;                }&lt;br /&gt;                &lt;span class="keyword"&gt;return&lt;/span&gt; to;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="identifier2"&gt;trace&lt;/span&gt; (&lt;span class="'string'"&gt;"Warning! Object.clone can not be used on MovieClip or XML objects"&lt;/span&gt;);&lt;br /&gt;        &lt;span class="keyword"&gt;return&lt;/span&gt; &lt;span class="identifier"&gt;undefined&lt;/span&gt;;&lt;br /&gt;};&lt;br /&gt;&lt;span class="identifier"&gt;Object&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;.trace2 = &lt;span class="keyword"&gt;function&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt;        &lt;span class="keyword"&gt;for&lt;/span&gt;(&lt;span class="keyword"&gt;var&lt;/span&gt; i &lt;span class="keyword"&gt;in&lt;/span&gt; &lt;span class="identifier"&gt;this&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;                &lt;span class="identifier2"&gt;trace&lt;/span&gt; (i + &lt;span class="'string'"&gt;' : '&lt;/span&gt; + &lt;span class="identifier"&gt;this&lt;/span&gt;[i]);&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;ASSetPropFlags (&lt;span class="identifier"&gt;Object&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;, [&lt;span class="'string'"&gt;"clone"&lt;/span&gt;], 1);&lt;br /&gt;ASSetPropFlags (&lt;span class="identifier"&gt;Object&lt;/span&gt;.&lt;span class="identifier"&gt;prototype&lt;/span&gt;, [&lt;span class="'string'"&gt;"trace2"&lt;/span&gt;], 1);&lt;br /&gt;myObject = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="identifier"&gt;Object&lt;/span&gt; ();&lt;br /&gt;myObject.&lt;span class="identifier2"&gt;name&lt;/span&gt; = &lt;span class="'string'"&gt;"Ashok"&lt;/span&gt;;&lt;br /&gt;myObject.gender = &lt;span class="'string'"&gt;"Male"&lt;/span&gt;;&lt;br /&gt;myObject.age = 24;&lt;br /&gt;myObject.trace2();&lt;br /&gt;copyObject = myObject.clone ();&lt;br /&gt;copyObject.trace2();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So what does the code do ?? i guess the code was self-explanatory.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-546309509409626195?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/546309509409626195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=546309509409626195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/546309509409626195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/546309509409626195'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/02/cloning-is-illegal-but-not-for-flash.html' title='Cloning is illegal , but not for FLASH OBJECTS..........'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-8892820210991373110</id><published>2007-02-12T21:10:00.000-08:00</published><updated>2007-02-12T21:37:12.271-08:00</updated><title type='text'>BitmapData II.......................</title><content type='html'>Continuing from the previous post explaining about BitmapData class and using it to cache images, i am here again to share some more information about it. Okay till now we saw how we can use BitmapData to cache images but its not the only thing we can do with it but lots and lots.  Remember the days of those and before flash   player 7 where when a drawing application is developed the developer takes the pain of generating the color palette himself either by actionscripting or designing the color boxes in the "timeline" itself.&lt;br /&gt;&lt;br /&gt;And also the end user is at the mercy of selecting only the colors whatever the program(developer) provides. If i say i dont like that red color then i assure to see that red color does not exist at all in my program and the user suffering from red syndrome. Always giving the choice of colors in flash that satisfies the user was never satisfying . Now no more is the case like that with the flash player 8.&lt;br /&gt;&lt;br /&gt;Wondering how BitmapData is going to help us in this ????? Just wait and see. This BitmapData has a method called "getPixel" with the "x" and "y" Numbers as the arguments which specifies the location of the area whose color has to be picked. Yes whose COLOR (RGB) has to be picked. This method returns the color of the pixel specified at the x and y pixel. Also there is another method called getPixel32 which returns the ARGB values meaning RGB with Alpha.&lt;br /&gt;&lt;br /&gt;Cool isn't it ?? So gone are the days of providing hard coded color palettes where now the user can even pick the color that lies by the side of his circle, oval or square shape that he has drawn in his drawing program.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-8892820210991373110?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/8892820210991373110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=8892820210991373110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/8892820210991373110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/8892820210991373110'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/02/bitmapdata-ii.html' title='BitmapData II.......................'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-8837782086393478603</id><published>2007-02-11T23:58:00.000-08:00</published><updated>2007-02-12T00:40:23.927-08:00</updated><title type='text'>BitmapData.........</title><content type='html'>Hai all,&lt;br /&gt;&lt;br /&gt;i am back after a very long  long time. But happy i am back atleast now. Today we shall discuss about caching image using BitmapData class. Actually "bitmapdata" is a new class that has been introduced for flash player 8. What this class can do is enormous, but we are here to discuss today what it can do for caching dynamically loaded images.&lt;br /&gt;&lt;br /&gt;I was always wondering how can i stop those reloading of images again and again, until i was introduced to the BitmapData class by a colleague of mine who recently discovered this. After playing around with the class for sometime an idea struck to me for solving the problem of reloading the loaded images with BitmapData class being the key.  This  solution ultimately gave birth to a class "ImageCache" which looks after the images loaded using it and ultimately returns a BitmapData which can be attached to the image holding movieClip using attachBitmap() method.&lt;br /&gt;&lt;br /&gt;The content of the class goes like this :&lt;br /&gt;&lt;br /&gt;import flash.display.BitmapData&lt;br /&gt;&lt;br /&gt;class ImageCache&lt;br /&gt;{&lt;br /&gt;  /**&lt;br /&gt;      @ varible __paths&lt;br /&gt;      @ description: The array that holds the path of the images loaded.&lt;br /&gt;  */&lt;br /&gt;  private var __paths:Array;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ varible loader&lt;br /&gt;      @ description: MovieClip that holds the images to be loaded and cached.This is a temporary movieClip.&lt;br /&gt;  */&lt;br /&gt;  private var loader:MovieClip;&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ method ImageCache&lt;br /&gt;      @ description: Constructor Function.&lt;br /&gt;  */&lt;br /&gt;  public function ImageCache()&lt;br /&gt;  {&lt;br /&gt;      __paths = new Array();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ method registerTempLoader&lt;br /&gt;      @ arguments : None;&lt;br /&gt;      @ access : Public&lt;br /&gt;      @ returns : Nothing.&lt;br /&gt;      @ description: Method that registers a valid MovieClip to be used for caching Images.&lt;br /&gt;  */&lt;br /&gt;  public function registerTempLoader(mc:MovieClip):Void&lt;br /&gt;  {&lt;br /&gt;      loader = mc;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ method : cacheImage&lt;br /&gt;      @ arguments : String path , float Width, float Height;&lt;br /&gt;      @ access : Public&lt;br /&gt;      @ returns : BitmapData.&lt;br /&gt;      @ description : When a path is passed into the argument along with the width and height&lt;br /&gt;                     loads the image and returns the cached image as a BitmapData.&lt;br /&gt;  */&lt;br /&gt;  public function cacheImage(path:String,w:Number,h:Number):BitmapData&lt;br /&gt;  {&lt;br /&gt;      var index:Number = isCached(path);&lt;br /&gt;      if( index &lt; 0)&lt;br /&gt;      {&lt;br /&gt;          var obj:Object = new Object();&lt;br /&gt;          var mc:MovieClip  = loader.createEmptyMovieClip('loader'+__paths.length,__paths.length);&lt;br /&gt;          obj.path = path;&lt;br /&gt;          obj.bdata = new BitmapData((w==undefined)?100:w,(h==undefined)?100:h,false,0xcc33ff);&lt;br /&gt;          mc.loader = new MovieClipLoader();&lt;br /&gt;          mc.loader.addListener(this);&lt;br /&gt;          mc.loader.loadClip(path,mc.createEmptyMovieClip('loader',0));&lt;br /&gt;          mc.index = __paths.length;&lt;br /&gt;          __paths.push(obj);&lt;br /&gt;          return obj.bdata;&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;          return __paths[index].bdata;&lt;br /&gt;      }&lt;br /&gt;   &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ method : isCached&lt;br /&gt;      @ arguments : String path;&lt;br /&gt;      @ returns : Number.&lt;br /&gt;      @ access : Private&lt;br /&gt;      @ description : When a path is passed into the argument checks from the&lt;br /&gt;                      __paths array if the path is already loaded returns the&lt;br /&gt;                      index of the path in the array else returns -1.&lt;br /&gt;  */&lt;br /&gt;  private function isCached(path:String):Number&lt;br /&gt;  {&lt;br /&gt;      for(var i:Number=0;i&lt;__paths.length;i++)&lt;br /&gt;      {&lt;br /&gt;          if(__paths[i].path == path)&lt;br /&gt;          {&lt;br /&gt;              return i;&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;      return -1;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;      @ method : onLoadInit&lt;br /&gt;      @ arguments : target MovieClip;&lt;br /&gt;      @ returns : Nothing.&lt;br /&gt;      @ access : Private&lt;br /&gt;      @ description : When an image loads successfully its parent get drawn using BitmapData.&lt;br /&gt;  */&lt;br /&gt;  private function onLoadInit(target:MovieClip):Void&lt;br /&gt;  {&lt;br /&gt;      __paths[target._parent.index].bdata.draw(target._parent);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Okay, the class is written but how do we use it ??? Nice Question !&lt;br /&gt;&lt;br /&gt;i had developed a image gallery using this class believe me. i will paste the actionscript that exists in the timeline of the stage as given below. But before that have two things ready in the library. one is a macromedia scrollpane and the next is create two empty movieclips with one having a linkage name "thumbHolder" and the other empty movieclip does not require any linkage ids.&lt;br /&gt;&lt;br /&gt;Now drag the ScrollPane to the stage and name it "$spane" with the content path in the parameters field as "thumbHolder". Now drag the empty movieClip without any linkage id to the stage and name it "$main".&lt;br /&gt;&lt;br /&gt;Then paste the below actions on the first frame of the Stage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Instance of the ImageCache Class.&lt;br /&gt;var iCache:ImageCache = new ImageCache();&lt;br /&gt;&lt;br /&gt;//Temporary images holder.&lt;br /&gt;var imageHolder:MovieClip = this.createEmptyMovieClip('tempImageHolder',0);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//The thumbnal images holder&lt;br /&gt;var galleryHolder:MovieClip = $spane.spContentHolder.createEmptyMovieClip('thumbNailholder',1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//The main picture holder.&lt;br /&gt;var mainPicture:MovieClip = $main.createEmptyMovieClip('mainLoader',0);&lt;br /&gt;&lt;br /&gt;var width:Number = 360;//Width value - change at your will.&lt;br /&gt;&lt;br /&gt;var height:Number = 480;//Height value - change at your will.&lt;br /&gt;&lt;br /&gt;//The below function is the one that starts to cache images.&lt;br /&gt;function cacheImages():Void&lt;br /&gt;{&lt;br /&gt;   var ratio:Number = 360/480;&lt;br /&gt;   var thumbHeight:Number = 480/4;&lt;br /&gt;   var thumbHolder:MovieClip = galleryHolder.createEmptyMovieClip('holder',0);&lt;br /&gt;   for(var i:Number=0;i&lt;19;i++)&lt;br /&gt;   {&lt;br /&gt;       var index:Number = 787 + i;&lt;br /&gt;       var path:String = 'images/SP_A0'+index+'.jpg';//Change this value to your custom image path&lt;br /&gt;       var thumb:MovieClip = thumbHolder.createEmptyMovieClip('gal'+i,i);&lt;br /&gt;       thumb.createEmptyMovieClip('loader',0).attachBitmap(iCache.cacheImage(path,360,480),0);&lt;br /&gt;       thumb.loader._width = ratio * thumbHeight;&lt;br /&gt;       thumb.loader._height = thumbHeight;&lt;br /&gt;       thumb._y = (thumbHeight+5) * i;&lt;br /&gt;       thumb.path = path;&lt;br /&gt;       thumb.onPress = function()&lt;br /&gt;       {&lt;br /&gt;           mainPicture.attachBitmap(iCache.cacheImage(this.path,360,480),0);&lt;br /&gt;           //mainPicture.createEmptyMovieClip('loader',0).loadMovie(this.path);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   $spane.redraw(1);&lt;br /&gt;}&lt;br /&gt;imageHolder._visible = false;//setting the visiblity of the tempimages holder to false.&lt;br /&gt;&lt;br /&gt;imageHolder._x = 100000;//setting the distance of the tempimages holder to a large one so we cannot see it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;iCache.registerTempLoader(imageHolder);//REgsitering the tempImage Holder as the loader for caching images.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cacheImages();//Start Caching Images.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So having restarted my blogging with the BitmapData class makes me feel a bit enthus !!!!&lt;br /&gt;&lt;br /&gt;Thanks for reading.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-8837782086393478603?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/8837782086393478603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=8837782086393478603' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/8837782086393478603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/8837782086393478603'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2007/02/bitmapdata.html' title='BitmapData.........'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-116062663384578962</id><published>2006-10-11T21:15:00.000-07:00</published><updated>2006-10-11T21:20:59.950-07:00</updated><title type='text'>My Flash Kit submissions</title><content type='html'>&lt;a href="http://www.flashkit.com/movies/3D/3d_Wiref-Ashok_Sr-11596/index.php"&gt;Wireframe Engine :&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flashkit.com/movies/3D/Engines/3D_Globe-Srinivas-11290/index.php"&gt;3d GLobe :&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flashkit.com/movies/3D/3D_Analo-Ashok_Sr-11297/index.php"&gt;3d Clock :&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-116062663384578962?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/116062663384578962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=116062663384578962' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/116062663384578962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/116062663384578962'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2006/10/my-flash-kit-submissions.html' title='My Flash Kit submissions'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-115889196969568093</id><published>2006-09-21T18:51:00.000-07:00</published><updated>2006-09-21T19:33:55.020-07:00</updated><title type='text'>CHAPTER 1</title><content type='html'>The start of the day was really nice with the orange ball whose surface temperature known to be 5800&lt;a href="http://www.nineplanets.org/help.html#kelvin"&gt;K&lt;/a&gt;  just shooting up in the sky. Was really nice to see him on the rise. So had my quick breakfast and was making my way to work.&lt;br /&gt;&lt;br /&gt;Soon after i landed i opened flash and geared up to look at it for the rest of the day. Soon i remembered about sterday where my colleague had a problem using those absolute paths to refer the movieclips due to which the heads were rolling on the floor with our dealine coming to a deadend.&lt;br /&gt;&lt;br /&gt;I am an actionscript developer who is basically against using all those absolute paths and am comfortable using relative paths.&lt;br /&gt;&lt;br /&gt;But the problem right in front was due to the fact of utter laziness. Seems to be like the movieClip was emerging around 7-8 levels inside the stage. (like _level0.instance1.instance2.instance3.instance4.instance5.instance6.mc);.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;here we had to make a function call that resides in the level0 but were unable to coz the movie that we are publishing is just one of the swfs that gets loaded in another swf. and this might change sometime in the future. As i had faced all these scenarios 2 years before itself the experience helped me and i decided on that fine day that i will never use any absolute scoping but only relative mapping at any cost.&lt;br /&gt;&lt;br /&gt;Now here is what i did to solve this problem. The movieclip instance from where i needed to call the function was a subchild of order 7 in a main instance on the stage called "$holder". So if we need to access the stage's timeline variables or functions we need to probably call like this&lt;br /&gt;&lt;br /&gt;this._parent._parent._parent._parent._parent._parent._parent._parent.funcXYZ();&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;_level0.funcXYZ();&lt;br /&gt;&lt;br /&gt;As i said earlier it is my principle that i will not use the second method(absolute pathing method).&lt;br /&gt;&lt;br /&gt;So would i use the first method &gt;???? NO !&lt;br /&gt;&lt;br /&gt;Better i will device a prototype such that i will be able to use it to handle all the similar problems.&lt;br /&gt;&lt;br /&gt;The solution was like this. But before that i had laid a simple rule that the last parent MC i.e., on the stage timeline will have an instance name and no other subparents inside it will have .&lt;br /&gt;&lt;br /&gt;cool ? let's get back to the prototype.&lt;br /&gt;&lt;br /&gt;MovieClip.prototype.findTheParent = function(whoseNameIs:String):MovieClip&lt;br /&gt;{&lt;br /&gt; var mc:MovieClip = this;&lt;br /&gt; while(mc._name != whoseNameIs)&lt;br /&gt; {&lt;br /&gt;     mc = mc._parent;&lt;br /&gt; }&lt;br /&gt; return mc;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So now coming to the part where this helped actual scenario being implemented,  it was like using this way.....&lt;br /&gt;&lt;br /&gt;this.findTheParent("$holder")._parent.funcXYZ();&lt;br /&gt;&lt;br /&gt;instead of the below already above mentioned METHODS !@!!!!!!!&lt;br /&gt;{&lt;br /&gt; this._parent._parent._parent._parent._parent._parent._parent._parent.funcXYZ();&lt;br /&gt;&lt;br /&gt; or&lt;br /&gt;&lt;br /&gt; _level0.funcXYZ();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps you all !. But sure it helped me!&lt;br /&gt;&lt;br /&gt;ReGaRdS,&lt;br /&gt;&lt;br /&gt;Ashok Srinivasan.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6548/1585/1600/ashok_2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/6548/1585/200/ashok_2.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-115889196969568093?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/115889196969568093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=115889196969568093' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/115889196969568093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/115889196969568093'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2006/09/chapter-1.html' title='CHAPTER 1'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-34775174.post-115880908263644077</id><published>2006-09-20T19:54:00.000-07:00</published><updated>2006-09-21T18:49:40.750-07:00</updated><title type='text'>Prologue !</title><content type='html'>The Title that sounds to be the start of some drama or story will most probably does not have a epilogue for this world of ActionScript is so vast that it will not drain and chances are that it may not have a epilogue. (whew : it was just an opinion).&lt;br /&gt;&lt;br /&gt;As this is the first time i am starting to blog and also wondering what to  post (This is what  has been  making me not a blooger all this time i.e., "First Time").&lt;br /&gt;&lt;br /&gt;i hereby start with a tip on the essence of Mathematics in programming.&lt;br /&gt;&lt;br /&gt;Imagine you have a MovieClip , a Button and a Boolean variable. Now when the button is clicked we will set the bool to true or false respectively. Based on the Boolean value we need to set the alpha state of the button to 30(if false) or 100(if true)  respectively.&lt;br /&gt;&lt;br /&gt;Yeah i know what you are thinking. Just set a if and else condition that will control the alpha of the button. But dont tell me it is the only way we always need to do it.&lt;br /&gt;&lt;br /&gt;To make things clear we will start it with the general way of Scripting.&lt;br /&gt;&lt;br /&gt;Intially the MovieClip alpha is at 100.&lt;br /&gt;&lt;br /&gt;//Actions on the timeLine&lt;br /&gt;&lt;br /&gt;var bool:Boolean = true;&lt;br /&gt;&lt;br /&gt;function setAlphaState()&lt;br /&gt;{&lt;br /&gt;  if(bool)&lt;br /&gt;  {&lt;br /&gt;      mc._alpha = 100;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;      mc._alpha  = 30;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;//Actions on the button()&lt;br /&gt;&lt;br /&gt;on(press)&lt;br /&gt;{&lt;br /&gt;  bool = !bool;&lt;br /&gt;  setAlphaState();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;But again the same setAlphaState function can be written as below thereby reducing the processing.&lt;br /&gt;&lt;br /&gt;function setAlphaState()&lt;br /&gt;{&lt;br /&gt;  if(!bool)&lt;br /&gt;  {&lt;br /&gt;      mc._alpha = 30;&lt;br /&gt;     return;&lt;br /&gt;  }&lt;br /&gt;  mc._alpha = 100;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hence there are lot of ways that might emerge to write this piece of process using if and else conditions.&lt;br /&gt;&lt;br /&gt;Imagine doing this mathematically,&lt;br /&gt;&lt;br /&gt;function setAlphaState()&lt;br /&gt;{&lt;br /&gt;  mc._alpha = (Number(bool) *(100-30)) +30 ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Dont you think the above way will work ????? Try it and check it out.&lt;br /&gt;&lt;br /&gt;Basically i am a guy who believes that using these if and else conditions actually make your application weak.&lt;br /&gt;&lt;br /&gt;The Reason : When a scenario has to dealt with and if we are goin to use our head to analyse the situation we tend to miss out some micro situations and may not present these conditions in the if else part and hence as a result our programs tends to fail at a point.&lt;br /&gt;&lt;br /&gt;But on the contrary when we analyze the scenario and get a Mathematical part that can govern the scenario and deal it in the natural way then there are less chances than that of if else way for failing.&lt;br /&gt;&lt;br /&gt;Hence this way my blog starts with a note to why we need to use Mathematical methods to deal with scenarios than using wasting time to analyze the micro macro sub scenarios and write it on our own. (This cannot be applied all the time but should implement when we actually can )&lt;br /&gt;&lt;br /&gt;Hope my first blog was not sounding so stupid for any advanced readers reading this and neither very advanced to those beginners also reading this.&lt;br /&gt;&lt;br /&gt;ReGaRdS,&lt;br /&gt;Ashok Srinivasan.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6548/1585/1600/ashok_1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger/6548/1585/320/ashok_1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/34775174-115880908263644077?l=actionscript2actionscript.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://actionscript2actionscript.blogspot.com/feeds/115880908263644077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=34775174&amp;postID=115880908263644077' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/115880908263644077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34775174/posts/default/115880908263644077'/><link rel='alternate' type='text/html' href='http://actionscript2actionscript.blogspot.com/2006/09/prologue.html' title='Prologue !'/><author><name>Ashok Srinivasan</name><uri>http://www.blogger.com/profile/15083505667707904888</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
