<?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-3066682645752351171</id><updated>2012-02-16T12:30:54.080-06:00</updated><category term='images'/><category term='packages'/><category term='xml'/><category term='flash'/><category term='url'/><category term='beer'/><category term='URLLoader'/><category term='proxy'/><category term='net'/><category term='news'/><category term='asinmotion'/><category term='listeners'/><category term='events'/><category term='oop'/><category term='releaseOutside'/><category term='e'/><category term='general'/><category term='utils'/><category term='boagworld'/><category term='flex'/><category term='cs3'/><category term='swx'/><category term='accessibility'/><category term='timer'/><category term='namespace'/><category term='tips'/><category term='texteditor'/><category term='animation'/><category term='e4x'/><category term='flash.net'/><category term='classes'/><category term='skins'/><category term='sIFR'/><category term='standards'/><category term='URLRequest'/><category term='components'/><category term='review'/><category term='ide'/><title type='text'>Dot AS</title><subtitle type='html'>Tutorials and guides to help you join the world of Actionscript 3 and object oriented design.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3066682645752351171.post-1412198190594202276</id><published>2007-07-10T15:57:00.000-06:00</published><updated>2007-07-10T15:59:57.362-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>return</title><content type='html'>So to say I've been lax in posting would be an understatement. I just haven't had much actionscript development to do at work and I program all ruby at home. However I do have an exciting development coming down the line. In the vein of Aral's SWX I have a mini-framework I am working on to make xml easier. I am also going to continue my xml tutorials shortly and hopefully syndicate them to actionscript.org.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-1412198190594202276?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/1412198190594202276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=1412198190594202276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/1412198190594202276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/1412198190594202276'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/07/return.html' title='return'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2525597908875722337</id><published>2007-06-11T15:51:00.000-06:00</published><updated>2007-06-11T16:02:47.113-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='e4x'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>Navigating XML with E4X</title><content type='html'>So last time we learned to load xml from an external source. Now we're going to learn how to handle it in as3 with e4x. E4x is neat. It basically allows you to navigate the xml as if it were a native flash object (part of the reason I don't get &lt;a href="http://swxformat.org/"&gt;SWX&lt;/a&gt;). So lets start with out previous example:&lt;br /&gt;&lt;blockquote&gt;import flash.net.*&lt;br /&gt;&lt;br /&gt;var sourceURL:String = "http://www.minorleaguebaseball.com/gen/stats/xml/clubs/482/schedule.xml";&lt;br /&gt;&lt;br /&gt;function loadXML(path:String):void {&lt;br /&gt;   var request:URLRequest = new URLRequest(path);&lt;br /&gt;   var xmlLoader:URLLoader = new URLLoader();&lt;br /&gt;   xmlLoader.addEventListener('complete', dataLoaded);&lt;br /&gt;   xmlLoader.load(request);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function dataLoaded(e:Event):void {&lt;br /&gt;   trace(e.target.data);&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;Now if you look at the result of the trace you'll see that there are basically a bunch of team nodes with team nodes nested in them. This is the main data we need. Now in order to get this data all we need to do is the following (note: since the first part won't change we'll only be dealing with the data loaded function from here on):&lt;br /&gt;function dataLoaded(e:Event):void {&lt;br /&gt;    var boxScore:XML = new XML(e.target.data)&lt;br /&gt;    for each(var game in boxscore.game){&lt;br /&gt;        trace(game)&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will out put each game individually. E4X uses the familiar dot syntax to access xml. If you only want to get a child node of an object, the game, you use a single dot. However if you wanted to get the descendant node, the team, you would use two dots (e.g. boxscore..team). I think that may be it for now. I want to keep these lessons short and sweet. Next I'll cover getting attributes and child/descendant nodes with odd characters(hyphens and whatnot) We'll also begin to flesh out the boxscore app be creating classes for the games and the teams.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2525597908875722337?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2525597908875722337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2525597908875722337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2525597908875722337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2525597908875722337'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/06/navigating-xml-with-e4x.html' title='Navigating XML with E4X'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-572238499117689255</id><published>2007-06-06T17:03:00.000-06:00</published><updated>2007-06-06T17:19:46.495-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='URLRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='flash.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='URLLoader'/><title type='text'>Simple XML Loader</title><content type='html'>In my work I deal a lot with xml and have become proficient at getting data. I also write scrapers for another project on working on. The result of this is I am going to start a series covering how to handle xml in flash. First we'll deal with loading the xml. For the example I will use a real example for a project I did to create a box score for each game for a minor league team. The feed can be found &lt;a href="http://www.minorleaguebaseball.com/gen/stats/xml/clubs/482/schedule.xml"&gt;here&lt;/a&gt;.  So feel free to play around with it. To load the xml you'll need the  flash.net library. So lets start our skeleton project. Just a note, 482 is the team id, changing it will get you a schedule for a different team.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;import flash.net.*&lt;br /&gt;&lt;br /&gt;var sourceURL:String = "http://www.minorleaguebaseball.com/gen/stats/xml/clubs/482/schedule.xml";&lt;br /&gt;&lt;br /&gt;function loadXML(path:String):void{&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;So in order to load the XML we need two classes: URLRequest and URLLoader. Whenever you're doing anything with any url, you'll need URLRequest. So the basic plan is to create a URLRequest object and then pass it to URLLoader. Next we add an event listener to the loader for the complete event and then we load the url. The final result is shown below.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;import flash.net.*&lt;br /&gt;&lt;br /&gt;var sourceURL:String = "http://www.minorleaguebaseball.com/gen/stats/xml/clubs/482/schedule.xml";&lt;br /&gt;&lt;br /&gt;function loadXML(path:String):void {&lt;br /&gt;    var request:URLRequest = new URLRequest(path);&lt;br /&gt;    var xmlLoader:URLLoader = new URLLoader();&lt;br /&gt;    xmlLoader.addEventListener('complete', dataLoaded);&lt;br /&gt;    xmlLoader.load(request);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function dataLoaded(e:Event):void {&lt;br /&gt;    trace(e.target.data);&lt;br /&gt;}&lt;/blockquote&gt;This is just a quick and dirty example. It merely reads the xml, it doesn't pass an variables to it. Also this includes no error checking. All that stuff will be covered later. Another less readable version of the first function could be:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; function loadXML(path:String):void {&lt;br /&gt;    var xmlLoader:URLLoader = new URLLoader();&lt;br /&gt;    xmlLoader.addEventListener('complete', dataLoaded);&lt;br /&gt;    xmlLoader.load(new URLRequest(path));&lt;br /&gt; }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Granted it only saves you a line, but I've seen a lot of people use URLRequest that way. I prefer the first method as I think its a bit more readable. Next I'll cover how to read the xml once you get it. Ta-ta for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-572238499117689255?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/572238499117689255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=572238499117689255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/572238499117689255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/572238499117689255'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/06/simple-xml-loader.html' title='Simple XML Loader'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-4212533873404716618</id><published>2007-05-25T12:46:00.000-06:00</published><updated>2007-05-25T12:51:16.339-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asinmotion'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='animation'/><title type='text'>New addition to asinmotion</title><content type='html'>The other day I was developing a component for our cms. I ran into a problem where I needed to execute an animation in one scope, but in another scope I needed to run it's animation in conjuction with a series of others. What did I do? Added a new feature to ASinMotion, append. With this you can string together different animation, as of now, they must be the same type, either parallel or queue, but I plan on changing that. I also want to run the animations not only in reverse order, but completely in reverse e.g. run it from the end position back to its origin. I hopefully will get that done next week. If you have questions about ASinMotion post a comment or a message on the Google Code site.&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/asinmotion/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-4212533873404716618?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/4212533873404716618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=4212533873404716618' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4212533873404716618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4212533873404716618'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/05/new-addition-to-asinmotion.html' title='New addition to asinmotion'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-3609304299346644281</id><published>2007-05-23T13:46:00.000-06:00</published><updated>2007-05-23T13:49:53.353-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asinmotion'/><category scheme='http://www.blogger.com/atom/ns#' term='animation'/><title type='text'>ASinMotion</title><content type='html'>I just created a google code project for my animation framework in as3. I wrote it before cs3 came out, but I still don't like having to write xml to animate, it's many more lines of code.&lt;br /&gt;&lt;br /&gt;Check it our &lt;a href="http://code.google.com/p/asinmotion/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-3609304299346644281?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/3609304299346644281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=3609304299346644281' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3609304299346644281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3609304299346644281'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/05/asinmotion.html' title='ASinMotion'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-5091534751622749954</id><published>2007-05-22T12:30:00.000-06:00</published><updated>2007-05-25T13:38:19.831-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='skins'/><category scheme='http://www.blogger.com/atom/ns#' term='components'/><title type='text'>Runtime skinning of components</title><content type='html'>One awesome new feature in Flash CS3 is the ability to skin components at runtime. This is great because at work I develop flash components for a cms system (&lt;a href="http://www.infinityprosports.com/"&gt;my work&lt;/a&gt;). Since they are included in many different sites the colors have to be configurable at runtime in order to fit with the site. Before I had to create my own components which was very tedious, especially since a solution already exists. Now that that's done, how do you do it? First create a component. The use setStyle method. The first argument is the skin you want to replace. This varies for each component but can be found in the livedocs &lt;a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/package-detail.html"&gt;here&lt;/a&gt;. The next argument is the skin to replace the current skin. Since the second argument just has a type of Class that leaves it wide open to what you can use. Enjoy!&lt;br /&gt;&lt;br /&gt;edit:Fixed the link.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-5091534751622749954?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/5091534751622749954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=5091534751622749954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5091534751622749954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5091534751622749954'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/05/runtime-skinning-of-components.html' title='Runtime skinning of components'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-5035224142207892524</id><published>2007-04-24T14:41:00.000-06:00</published><updated>2007-05-23T13:50:09.109-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='releaseOutside'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>ReleaseOutside replacement</title><content type='html'>I was recently trying to figure out how to replace the releaseOutside as2 event in as3. In most cases you can just add the listener to the stage since you usually don't care where the mouse was released, just that it was released. If you specifically need to know the mouse was released outside the object, you can use the method senocular illustrates &lt;a href="http://www.kirupa.com/forum/showthread.php?p=1948182#post1948182"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-5035224142207892524?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/5035224142207892524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=5035224142207892524' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5035224142207892524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5035224142207892524'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/releaseoutside-replacement.html' title='ReleaseOutside replacement'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-3668252805713038910</id><published>2007-04-24T14:06:00.000-06:00</published><updated>2007-05-23T13:53:57.154-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cs3'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><title type='text'>Flash CS3 is out!</title><content type='html'>Unless you lived in a cave, you should know that last week Flash CS3 was finally released. I have not gotten to play with it yet, but am trying to convince my work into upgrading. I am really excited about the Flex Kit that they released which allows you to easily author Flex components in Flash, which is great. The weakness I always saw in Flash was that you had to absolutely position everything, which added many lines of code and became very repetitive. Flex conquered that problem but was too rigid in its creating of components. The integration of the two technologies is very exciting. Another great CS3 feature is the ability to create an animation in flash and then have it export the code to as3. I mean really, thats ridiculously cool. One of the people who helped implement was none other than THE Robert Penner. In case you haven't heard of him, his easing equations are pretty much used by every codebased animation package in flash. This is all very exciting and I'll post a review once I have time to play.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-3668252805713038910?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/3668252805713038910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=3668252805713038910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3668252805713038910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3668252805713038910'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/flash-cs3-is-out.html' title='Flash CS3 is out!'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-4478428791309681115</id><published>2007-04-17T14:58:00.000-06:00</published><updated>2007-05-23T13:50:22.816-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='timer'/><category scheme='http://www.blogger.com/atom/ns#' term='utils'/><title type='text'>Timer Class</title><content type='html'>One of my favorite things about as3 is the new Timer class.  If you've ever done much coding in actionscript 1 or actionscript 2 then you've had to deal with setInterval. While this was a huge step forward, there we're a lot of issues. The new evolved form of this is the Timer class. The time class allows to to start a timer, either for a set number of intervals or indefinately, and then set a delay and execute a method on the 'timer' event, which is fired after each delay, as well as the 'timerComplete', which is fired after the set number of intervals. The first and most obvious use of this is for an animation framework. What really makes this great is in the method called by the timer event can access the current count in the method as well as the total interval count in order to track progress. Here's some code showing a simple setup.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;import flash.util.Timer;&lt;br /&gt;var delay:Number = 1000;//delay in milliseconds&lt;br /&gt;var intervals:Number = 10;//number of interval, if not given defaults to zero&lt;br /&gt;var counter:Timer = new Timer (delay,intervals);&lt;br /&gt;counter.addEventListener('timer',iteration);&lt;br /&gt;counter.addEventListener('timerComplete',finished);&lt;br /&gt;function iteration(e:TimerEvent):void{&lt;br /&gt;   var progress:Number = e.target.currentCount/e.target.repeatCount;&lt;br /&gt;   trace(progress+" percent done")&lt;br /&gt;}&lt;br /&gt;function finished(e:TimerEvent):void{&lt;br /&gt;   trace('Done');&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;More info here: &lt;a href="http://livedocs.adobe.com/flex/201/langref/flash/utils/Timer.html"&gt;http://livedocs.adobe.com/flex/201/langref/flash/utils/Timer.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-4478428791309681115?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/4478428791309681115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=4478428791309681115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4478428791309681115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4478428791309681115'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/timer-class.html' title='Timer Class'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2866091084313663540</id><published>2007-04-12T13:28:00.000-06:00</published><updated>2007-05-23T13:53:20.423-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='beer'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Best Beers in America</title><content type='html'>Severely off topic, but I love beer. The way most people enjoy a fine meal is the way I enjoy a good beer. So when I found a list of the &lt;a href="http://www.mensjournal.com/feature/0610/bestbeer.html"&gt;25 Best Beers in America&lt;/a&gt; it just had to be mentioned. I've had the Dogfish IPA and Sam Adams Black Lager, which I love. The rest I'm determined to try, just gotta find them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2866091084313663540?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2866091084313663540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2866091084313663540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2866091084313663540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2866091084313663540'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/best-beers-in-america.html' title='Best Beers in America'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2914820970585960276</id><published>2007-04-10T12:14:00.000-06:00</published><updated>2007-05-23T13:53:07.378-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><title type='text'>Flex</title><content type='html'>So I am really starting to get into Flex. The idea sounds promising. I hated how in flash apps, half of my code was just dedicated to the dynamic positioning of objects, flex seems to solve this. I hope to get my hands dirty with flex pretty soon. Still have lots more reading to do before I have something to show, hopefully work will get me the books pretty soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2914820970585960276?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2914820970585960276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2914820970585960276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2914820970585960276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2914820970585960276'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/flex.html' title='Flex'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-4848119942211593774</id><published>2007-04-06T07:33:00.000-06:00</published><updated>2007-04-06T07:40:14.299-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swx'/><category scheme='http://www.blogger.com/atom/ns#' term='boagworld'/><title type='text'>SWX, huh?</title><content type='html'>One thing I have a huge weakness for is Boagworld. I spend many many hours a world listening to Paul and Marcus ramble on and it makes me smile. Anyways through &lt;a href="http://www.boagworld.com/"&gt;boagworld&lt;/a&gt; I learned about Aral Balkan and through his blog I learned about &lt;a href="http://www.swxformat.org"&gt;SWX&lt;/a&gt;. Now my biggest problem with SWX is I just don't really see where it fits in. Granted, I haven't had much of a chance to play with it, but it seems like the what it accomplished could be done through XML, which I love, or flashvars. Who knows, I may become a convert, but right now I have other things I'm trying to learn.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-4848119942211593774?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/4848119942211593774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=4848119942211593774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4848119942211593774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4848119942211593774'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/swx-huh.html' title='SWX, huh?'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-7096893269904751789</id><published>2007-04-05T13:50:00.000-06:00</published><updated>2007-05-23T13:50:32.773-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='images'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Loading images in as3</title><content type='html'>This one is short because I'm behind at work. To load an image in as3 you use the Loader class which is part of flash.display. You first need to create an URLRequest object and then pass the object to loader. The neat thing about loader is that it acts as a psuedo proxy class to where you can attach it to the stage and set its properties before the image is loaded. However if you need to perform some event after it is loaded you'll need to add a listener to contentLoaderInfo property of the loader class and not the loader itself. Here's some sample code.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;import flash.display.*;&lt;br /&gt;import flash.net.URLRequest;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt; var rect:Shape = new Shape();&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;rect.graphics.beginFill(0xFFFFFF);&lt;br /&gt;rect.graphics.drawRect(0, 0, 100, 100);&lt;br /&gt;rect.graphics.endFill();&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;addChild(rect);&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;var ldr:Loader = new Loader();&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;ldr.mask = rect;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;var url:String = "http://www.unknown.example.com/content.swf";&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;var urlReq:URLRequest = new URLRequest(url);&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;ldr.load(urlReq);&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;addChild(ldr);&lt;/blockquote&gt;One important note, if you are loading the image from another server (i.e. a mashup) you'll need to load a policy file to manipulate it. This is done by creating a loader context object and passing the policy file to Securtiy.loadPolicyFile.Next you have to pass the loaderContext as a second argument of the load method of the loader class.&lt;br /&gt;&lt;blockquote&gt;Security.loadPolicyFile("http://www.unknown.example.com/crossdomain.xml")&lt;br /&gt;var context:LoaderContext = new LoaderContext(true)&lt;br /&gt;ldr.load(urlReq,context)&lt;/blockquote&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-7096893269904751789?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/7096893269904751789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=7096893269904751789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/7096893269904751789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/7096893269904751789'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/loading-images-in-as3.html' title='Loading images in as3'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-6396402919707818123</id><published>2007-04-03T14:37:00.000-06:00</published><updated>2007-05-23T13:53:43.257-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Sorry for the delay</title><content type='html'>I found this thread (http://www.kirupa.com/forum/showthread.php?t=223798). This was started by Senocular, whom I have much respect for, and has many AS3 tips and hints.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-6396402919707818123?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/6396402919707818123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=6396402919707818123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/6396402919707818123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/6396402919707818123'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/04/sorry-for-delay.html' title='Sorry for the delay'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-1365294270644506783</id><published>2007-03-19T22:55:00.000-06:00</published><updated>2007-03-19T23:01:05.215-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='accessibility'/><category scheme='http://www.blogger.com/atom/ns#' term='sIFR'/><title type='text'>sIFR</title><content type='html'>One great example of using flash to enhance a website while still making it accessible is Scalable Inman Flash Replacement, or sIFR. The basic principle is that screen readers need the text to be there, but plain text is ugly and you have limited fonts. While image replacement is an option, this would require to you make an image every time the text changes. Enter flash. sIFR uses a combination of javascript and flash to dynamically replace and render text on your webpage. Also since its just the same tiny flash movie being loaded, it actually will load faster than if you were to create images for each text block. Here's the &lt;a href="http://www.mikeindustries.com/sifr/"&gt;webpage&lt;/a&gt; with more information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-1365294270644506783?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/1365294270644506783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=1365294270644506783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/1365294270644506783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/1365294270644506783'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/sifr.html' title='sIFR'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-6832947259758915229</id><published>2007-03-19T22:49:00.001-06:00</published><updated>2007-03-19T22:52:01.130-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='accessibility'/><category scheme='http://www.blogger.com/atom/ns#' term='standards'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Flash and Web Standards</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Now you can be the best flash developer in the world, but unless you have you head around some of the other aspects of web development, you'll lose out on a lot of jobs. Web standards is about making web site accessible to all browsers and all people. To do this you separate content, design, and action. Here's an &lt;a href="http://www.alistapart.com/articles/semanticflash"&gt;article&lt;/a&gt; on a list apart about using flash in web design.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-6832947259758915229?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/6832947259758915229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/6832947259758915229'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/flash-and-web-standards.html' title='Flash and Web Standards'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2789098509165258703</id><published>2007-03-19T11:36:00.001-06:00</published><updated>2007-05-23T13:51:07.148-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Proxy Classes</title><content type='html'>If you've never read a book about design patterns, you should. If you have, you're probably familiar with the proxy class. Basically a proxy class acts as a middleman between two pieces of code. How does this apply to AS3? If you do anything really cool with Flash then you will end up deal with some external data. Since you can't act on the data until it is loaded, but its often a pain to delay the code, a proxy class is a great candidate. For example, an image. You want to load the image, set its position, size, etc. but you can't do anything til it is loaded. If you write a proxy class you can tell it to load the image as well as set its properties. It will merely store these variables until the image is loaded and then it will enact all the properties on the images. If you've worked much with external data, you can see how handy this is. This may be short and leave you with a lot of questions, but I am going somewhere with this over the next couple of posts, so be patient.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2789098509165258703?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2789098509165258703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2789098509165258703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2789098509165258703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2789098509165258703'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/proxy-classes_19.html' title='Proxy Classes'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-5365420247603200490</id><published>2007-03-09T07:02:00.000-06:00</published><updated>2007-05-23T13:52:13.391-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Advanced ActionScript 3 with Design Patterns (review)</title><content type='html'>I'm about halfway through with this book and enjoying it so far.(By the way, this is the one from abode and not the O'reilly one) The writing manages to cover the subject without being too formal. There are also tons of examples. I am one of those people that learn from examples or by doing. You could give me 10 pages of explanation, but a simple example will be more effect for me. Being a self taught programmer, its nice to learn some of the more formal programming, like design patterns and object oriented design. I probably wouldn't recommend this book as an introduction to programming or maybe not even to AS3, but if your familiar with both, this book is a great way to get your head around design patterns.&lt;br /&gt;&lt;br /&gt;There's also a review over on Actionscript.org &lt;a href="http://www.actionscript.org/resources/articles/539/1/Review---Advanced-ActionScript-3-with-Design-Patterns/Page1.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-5365420247603200490?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/5365420247603200490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=5365420247603200490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5365420247603200490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/5365420247603200490'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/design-patterns-with-actionscript-3.html' title='Advanced ActionScript 3 with Design Patterns (review)'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-7237459287268149509</id><published>2007-03-08T20:04:00.000-06:00</published><updated>2007-05-23T13:52:30.669-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='url'/><category scheme='http://www.blogger.com/atom/ns#' term='net'/><title type='text'>Link to a url</title><content type='html'>I'm going on vacation so this will be it til wednesday. Today we cover linking to a url. It's pretty straightforward.&lt;br /&gt;&lt;blockquote&gt;import flash.net.*;&lt;br /&gt;&lt;br /&gt;var url:URLRequest = new URLRequest(url goes here)&lt;br /&gt;navigateToURL(url)&lt;/blockquote&gt;&lt;br /&gt;Tada! That's it. The url request object is used in pretty much all external communication in flash. So learn to love it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-7237459287268149509?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/7237459287268149509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=7237459287268149509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/7237459287268149509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/7237459287268149509'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/link-to-url.html' title='Link to a url'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-3595070351773689136</id><published>2007-03-07T21:40:00.000-06:00</published><updated>2007-05-23T13:52:57.871-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ide'/><category scheme='http://www.blogger.com/atom/ns#' term='texteditor'/><category scheme='http://www.blogger.com/atom/ns#' term='e'/><title type='text'>A proper text editor</title><content type='html'>If you've been around for a while and active in the programming community, you've heard of Textmate. It is pretty much the de facto programming IDE for the Mac. For a long time there was nothing even close to it on the Windows. The along came &lt;a href="http://www.e-texteditor.com/"&gt;E&lt;/a&gt;. While E is different than Textmate, it still incorporates a lot of the same great features. One thing I'm excited about, but haven't had time to figure out yet is the built in subversion and cvs support. If that's greek to you, I'll go over it in another post. Anyways E is all the buzz about the blogosphere, I've seen it mentioned in no fewer than 3 blogs I subscribe to. So what's so great about it? First, built in support for textmate bundles. What is a bundle? A bundle inculdes code snippets, as well as code commands. While the current Actionscript bundle has not been updated for AS3, it doesn't take much to convert it over. For example I wrote a snippet where I type pkg and then hit tab and it types out:&lt;br /&gt;&lt;blockquote&gt;package {&lt;br /&gt;   class {&lt;br /&gt;   }&lt;br /&gt;}&lt;/blockquote&gt;Also if you hit shift+enter, it will type out the basic structure for a function. The possibilities of what you can do are endless. Besides the bundles other neat features are multiple selections or column selections. It's very configurable and extendable. It's still in beta right now, so check it out while its free. Even when it is out it will only be about $35 which is a bargain for an IDE. Most others I've looked at have been in the $200 range. Brian out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-3595070351773689136?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/3595070351773689136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=3595070351773689136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3595070351773689136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/3595070351773689136'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/proper-text-editor.html' title='A proper text editor'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-4654190536173851154</id><published>2007-03-06T00:56:00.000-06:00</published><updated>2007-05-23T13:51:23.841-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packages'/><category scheme='http://www.blogger.com/atom/ns#' term='namespace'/><category scheme='http://www.blogger.com/atom/ns#' term='classes'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>Custom Class</title><content type='html'>So in as2 you had to create a class in a file with the same name. i.e. MyButton is in MyButton.as. This is the same in as2. The differences are in the namespaces. In as2 a namespace was declared in the class definition:&lt;br /&gt;&lt;blockquote&gt;class com.example.MyClass{&lt;br /&gt;}&lt;/blockquote&gt;An important thing to note is for the namespace to be valid the class would have to be in example folder which was in the com folder. In as3 its done like this.&lt;br /&gt;&lt;blockquote&gt;package com.example{&lt;br /&gt;   public class MyClass{&lt;br /&gt;   }&lt;br /&gt;}&lt;/blockquote&gt;Also in as3 you can have multiple classes in one file, but only one public class. So you can have private class in the package, or declare a class outside the package definition that will only be available to the code in that file. That's all for today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-4654190536173851154?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/4654190536173851154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=4654190536173851154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4654190536173851154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/4654190536173851154'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/custom-class.html' title='Custom Class'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2417078172449461650</id><published>2007-03-04T21:25:00.000-06:00</published><updated>2007-05-23T13:52:00.562-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='listeners'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>Events</title><content type='html'>One of the biggest changes to the Actionscript language is the way events are handled. I am still having trouble getting used to it. I learn best by example so here goes. In as1/as2 you could write code for an event by doing this:&lt;br /&gt;&lt;blockquote&gt;mybutton1.onClick = function(){&lt;br /&gt;  .....code goes here&lt;br /&gt;}&lt;/blockquote&gt;This no longer works in as3. All functions tied to events have to added through the &lt;span style="font-style: italic;"&gt;addEventListener&lt;/span&gt; command.  Before I show an example, let's talk about why this is better. Since you are adding a listener to a function rather than declaring a function for an event, you can have multiple functions listen for one event. Also it allows you better house keeping because you can add and remove functions for events rather than just using this&lt;br /&gt;&lt;blockquote&gt;mybutton1.onClick = null;&lt;/blockquote&gt;So now to the code. Here's the example, I'll break it down after wards.&lt;br /&gt;&lt;blockquote&gt;mybutton1.addEventListener('click',myFunc)&lt;br /&gt;&lt;br /&gt;function myFunc(e:MouseEvent){&lt;br /&gt;}&lt;/blockquote&gt;Now ideally all this would be in a class, but I'll get to that later. First you have an object, make sure it can recieve the event you're trying to attach. For instance, the bitmap object cannot recieve click events. Now you can either use the string 'click', or the event constant, in this case, MouseEvent.CLICK. Then you declare a function. It is &lt;span style="font-style: italic;"&gt;absolutely necessary&lt;/span&gt; that the one and only variable received by the function is an event of the appropriate type or generic event type. I have had many errors popup because I forgot this. Also in order to use events you must import the flash.events.* library either the whole thing or just a specific class in it. See &lt;a href="http://livedocs.adobe.com/flex/201/langref/flash/events/package-detail.html"&gt;here&lt;/a&gt; for the events library. To remove an event you just calls removeEventListener with the exact same arguments. That's all there is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2417078172449461650?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2417078172449461650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2417078172449461650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2417078172449461650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2417078172449461650'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/events.html' title='Events'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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-3066682645752351171.post-2284002167993197069</id><published>2007-03-04T21:17:00.000-06:00</published><updated>2007-05-23T13:51:45.451-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Intro</title><content type='html'>So this is my first post. I always had tried to create a blog in the past, but the biggest problem was I lacked focus. That resulted in lackadaisical posting and no real theme to attract a demographic. So what do I plan to do with this blog? Well as of the release of Flex Builder2 and Flash Player 9 Alpha. Actionscript has evolved into a legit programming language with a true object oriented structure, which is awesome. The downside? A lot of people had hacked together Actionscript code in the past and are now lost. So I want to educate you about AS3, while at the same time teaching you a bit about programming as a whole. So post may just be code snippets with a brief explanation. Others may be links to articles I think would be worth your time. I'll just have to see how the mood strikes me. One thing I will say, I am not going to post pure fluff posts, just to post. If there are design concepts (MVC, Singleton, DRY) or philosophies (extreme programming, getting real) that you want to know let me know. If there's something you could do in as1 or as2, but can't figure out how to do in as3 let me know. This is my way of giving back. At the same time I may not know the answer, I'm learning to and by no way profess to be an expert. I hope you enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3066682645752351171-2284002167993197069?l=dotas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotas.blogspot.com/feeds/2284002167993197069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3066682645752351171&amp;postID=2284002167993197069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2284002167993197069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3066682645752351171/posts/default/2284002167993197069'/><link rel='alternate' type='text/html' href='http://dotas.blogspot.com/2007/03/intro.html' title='Intro'/><author><name>William Brian Smith</name><uri>http://www.blogger.com/profile/05693942854343589678</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></feed>
