<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Miguel Moraleda &#187; Actionscript 3</title>
	<atom:link href="http://as3.miguelmoraleda.com/category/actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://as3.miguelmoraleda.com</link>
	<description>Unity3D &#38; Actionscript examples, resources, source code, etc</description>
	<lastBuildDate>Fri, 16 Apr 2010 12:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Working with Flash Media Server at Influxis hosting</title>
		<link>http://as3.miguelmoraleda.com/2010/02/15/working-with-flash-media-server-at-influxis-hosting/</link>
		<comments>http://as3.miguelmoraleda.com/2010/02/15/working-with-flash-media-server-at-influxis-hosting/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 13:32:46 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=346</guid>
		<description><![CDATA[Flash Media Server (FMS) is a proprietary data and media server from Adobe Systems (originally a Macromedia product). This server works with the Flash Player runtime to create media driven, multiuser RIAs (Rich Internet Applications). The server uses ActionScript 1, an ECMAScript based scripting language, for server-side logic. Prior to version 2, it was known [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://www.influxis.com/" target="_blank"><img src="http://as3.miguelmoraleda.com/wp-content/uploads/2010/02/influxis.png" alt="influxis" title="influxis" width="183" height="183" class="alignnone size-full wp-image-347" /></a></center></p>
<blockquote><p>Flash Media Server (FMS) is a proprietary data and media server from Adobe Systems (originally a Macromedia product). This server works with the Flash Player runtime to create media driven, multiuser RIAs (Rich Internet Applications). The server uses ActionScript 1, an ECMAScript based scripting language, for server-side logic. Prior to version 2, it was known as Flash Communication Server.<br />
Flash Media Server is a hub, Flash based applications connect to the hub using Real Time Messaging Protocol (RTMP). The server can send and receive data to and from the connected users with live web FLV player installed. Connected clients can make Remote procedure calls (RPC) on the server-side and the server can call methods on specific clients. A SharedObject can be used to synchronize complicated data structures and call remote methods on multiple clients in one go by having clients subscribe to a shared object. Standard ActionScript objects are transported across the NetConnection using the Action Message Format (AMF) which is handled transparently by the server and flash client.<br />
The server also allows users to receive and publish net streams. When viewing a net stream the user can either create their own to view a remotely stored Flash Video (FLV) or the server can instantiate a net stream and play a video on it, the latter method means that every user will be at the same point in the video when they subscribe to it as they are all viewing the same stream.</p></blockquote>
<p>The FMS streams video, audio and data files in real time for Flash based interactive applications.</p>
<p><a href="http://influxis.com/" target="_blank">Influxis</a> is a specialist in Adobe Flash Media Interactive Server 3.5 (FMS or FMIS). FMS powers interactive Flash applications including on-demand and live video broadcasts, real time communications, interactive classroom environments, multi-user collaboration, multi-player gaming, audio streaming, live data streaming, and more.</p>
<p>Our services include hosting, pre-built applications, and FMS user resources, which make Flash Media Server affordable and easy to begin working with immediately.</p>
<h4>Top Ten Reasons To Choose Influxis (from his website)</h4>
<ul>
<li><strong>FMS Experts:</strong> Influxis is the only FMS specialist in the market, and supported by an internal team of professional Flash experts and developers.</li>
<li><strong>Adobe Partnership:</strong> Influxis is privy to the latest Adobe information, beta programs, and among the first to market new FMS products.</li>
<li><strong>Pricing Tiers:</strong> Influxis offers pricing plans to accommodate all levels, from small scale experimental to a full dedicated server network for the most robust applications.</li>
<li><strong>Pre-built Applications:</strong> Influxis has built an entire library of customizable applications for your use. All come with .FLA files, and come with URL&#8217;s for easy linking or you can embed the code directly into your website. Or an easy file download and upload to your website. All designed to get you started fast.</li>
<li><strong>We&#8217;re Developers Too:</strong> Our staff are all full-time FMS developers &#8211; we understand. We offer help with minor modifications to your applications. Also find a bevy of resources available including Influxis Labs, FAQ&#8217;s, Forums, Tutorials, and our own in-house developer staff.</li>
<li><strong>Customer Service:</strong> Influxis strives to go the extra mile and provide friendly and knowledgeable staff to assist you whether it is just getting started or resolving an issue.</li>
<li><strong>Easy to Use &#038; Get Started Immediately:</strong> Your Influxis account is activated immediately upon sign up, and the Influxis Wizard file manager makes it easy to organize your files, upload new applications, and you have complete control over your account settings.</li>
<li><strong>Worldwide Network:</strong> Influxis has an international network (US and European locations) for fast delivery and streaming to all reaches of the world. We also can integrate our specialized Flash Media Interactive Server network with any third party CDN with our hybrid FMS/CDN solution.</li>
<li><strong>No Contracts:</strong> Month-to-month service provides you flexibility for short-term projects and advertising campaigns. Event pricing is also available.</li>
<li><strong>Customers Trust Us:</strong> Customers include Fortune 500 companies, world-class universities, advertising agencies, government services, professional sports, developers, and many more who entrust us to host their FMS applications.</li>
</ul>
<p>I would like to add a point in this list, something I value so much about <a href="http://influxis.com/" target="_blank">Influxis</a>, it is they are one of the biggest sponsors in all flash scene, they are present if not all, in the majority of events related to this sector.<br />
Well all this by way of introduction, here I leave 2 examples using FMS, the first is a pre-built application that offers <a href="http://influxis.com/" target="_blank"> Influxis </a>, is a simple chat but set in a 3D scene. The second example is made by my, it is a example of SharedObject, this is the simplest way to keep customers connected between them, are very useful and easy to use. I am currently developing an interactive whiteboard, I hope to have it soon.<br />
Last but not least, I would like to speak about my experience using Influxis. I didn&#8217;t know nothing about FMS, but start with it was very easy. The control panel of Influxis was very helpful to start with FMS, is very simple to handle the server with it (load-unload project, create new projects, setup domains to work with your apps, etc), algo is very nice to have the pre-built applications to see what you can do or directly to use it. Besides the disposition of the support team is remarkable, it is a pleasure to engage with them, so that others say to recommend <a href="http://influxis.com/" target="_blank">Influxis</a> and hosting solution for their projects with FMS, have very flexible prices, so I find it very handy for all (plans from $6 a month). Look at his website and see what I&#8217;m talking about.</p>
<h4>Pre-Builded App Massiva3D</h4>
<p><a href="http://miguelmoraleda.com/examples/massiva3D/" target="_blank"><img src="http://as3.miguelmoraleda.com/wp-content/uploads/2010/02/massiva3D.jpg" alt="massiva3D, 3D chat app" title="massiva3D" width="500" height="318" class="aligncenter size-full wp-image-375" /></a></p>
<h4>SharedObject example</h4>
<p>Open the example 2 times clicking the image, then drag the logos and you will see how update both windows.<br />
<a href="http://miguelmoraleda.com/examples/FMSExample/" target="_blank"><img src="http://as3.miguelmoraleda.com/wp-content/uploads/2010/02/fmsExample.jpg" alt="SharedObject Example" title="fmsExample" width="500" height="374" class="aligncenter size-full wp-image-368" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2010/02/15/working-with-flash-media-server-at-influxis-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with HYPE</title>
		<link>http://as3.miguelmoraleda.com/2010/02/12/getting-started-with-hype/</link>
		<comments>http://as3.miguelmoraleda.com/2010/02/12/getting-started-with-hype/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 18:08:49 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[HYPE]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=315</guid>
		<description><![CDATA[What is HYPE? HYPE is a creative coding framework built on top of ActionScript 3. A major goal of HYPE is to allow newcomers to Flash and ActionScript to creatively play and express themselves while they are learning how to program. To get started, the user needs only the most basic knowledge of programming – [...]]]></description>
			<content:encoded><![CDATA[<h4>What is HYPE?</h4>
<blockquote><p>HYPE is a creative coding framework built on top of ActionScript 3. A major goal of HYPE is to allow newcomers to Flash and ActionScript to creatively play and express themselves while they are learning how to program.</p>
<p>To get started, the user needs only the most basic knowledge of programming – variables, conditionals, loops, and functions, for example.</p>
<p>As the user learns more about programming they can extend HYPE and thus grow their skills, while at the same time inspiring the next generation.</p>
<p>Now, that&#8217;s not to say HYPE is just for people who are new to programming. Instead, HYPE is for anyone, regardless of skill, who wants to play with code. Fundamentally, the point of HYPE is to make Flash fun again. We made HYPE to help bring back the playfulness that once defined our community.</p></blockquote>
<h4>Download and setup</h4>
<p>The first thing you have to do is <a href="http://github.com/hype/hype/zipball/v1.1.1">download</a> the source from the <a href="http://hype.joshuadavis.com/">HYPE web site</a> or directly <a href="http://github.com/hype/hype/zipball/v1.1.1">click here</a>. Also you can download the lib from <a href="http://github.com/hype/hype"> github</a>.</p>
<p>To use the HYPE in our projects we have two ways to setup the library, the first way is using the MXP file that you can install into your Flash IDE using &#8220;Adobe Extension Manager CS4&#8243;, I never use this way, for this reason I recommend you read the <a href="http://hype.joshuadavis.com/installation/">installation page in the HYPE web</a>. The second way (I use) is to set the path to the HYPE source in the source paths of Flash IDE (edit &#8211; preference &#8211; actionscript &#8211; Actionscript 3.0 settings). Now you are ready to start with HYPE.</p>
<h4>Fast class description</h4>
<ul>
<li><strong>BitmapCanvas</strong>: Captures a specifed target DisplayObject to a bitmap and displays it.</li>
<li><strong>FilterRhythm</strong>: Rhythm to continuously apply a set of filters to a BitmapData instance.</li>
<li><strong>DirectionalVibration</strong>: Vibrates a property in an directional manner.</li>
<li><strong>ColorPool</strong>: Colorist that applies colors from a specified pool.</li>
<li><strong>GridLayout</strong>: Layout that produces a simple grid.</li>
<li><strong>ObjectPool</strong>: Creates and manages pools of objects.</li>
<li><strong>Oscillator</strong>: Oscillates a property with a specifed wave function.</li>
<li><strong>ShapeLayout</strong>: Layout that produces random points all of which are on a specified shape.</li>
<li><strong>SoundAnalyzer</strong>: Analyzes sound frequency data and aggregates the resulting data.</li>
<li><strong>Swarm</strong>: Makes the target object chase after a point.</li>
<li><strong>MouseFollow</strong>: Makes the target track the mouse.</li>
<li><strong>SimpleBallistic</strong>: Moves an object in a simplified ballistic path.</li>
</ul>
<h4>Demo</h4>
<p>
		<span class="flash">
		<object width="400" height="350">
			<param name="movie" value="http://www.miguelmoraleda.com/examples/hype/Main.swf"></param>
			<param name="allowFullScreen" value="true"></param>
			<param name="allowscriptaccess" value="always"></param>
			<embed src="http://www.miguelmoraleda.com/examples/hype/Main.swf" type="application/x-shockwave-flash"allowscriptaccess="always" allowfullscreen="true" width="400" height="350"></embed>
		</object>
		</span>
		<br />
<a href="http://www.miguelmoraleda.com/examples/HypeExample.rar">DOWNLOAD EXAMPLE</a><br />
<a href="http://www.miguelmoraleda.com/examples/hype/">VIEW EXAMPLE OUT OF THIS WEB</a></p>
<h4>Links about it</h4>
<p><a href="http://stranskydesign.com/blog/hello-hype-what-is-hype-the-flash-as3-framework/">http://stranskydesign.com/blog/hello-hype-what-is-hype-the-flash-as3-framework/</a><br />
<a href="http://thesven.com/?tag=hype">http://thesven.com/?tag=hype</a><br />
<a href="http://www.georgiefurst.co.uk/blog/?p=254">http://www.georgiefurst.co.uk/blog/?p=254</a><br />
<a href="http://active.tutsplus.com/tutorials/workflow/introduction-to-the-hype-actionscript-3-0-framework/?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed:+Flashtuts+(Activetuts%2B)">http://active.tutsplus.com/tutorials/workflow/introduction-to-the-hype-actionscript-3-0-framework/?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed:+Flashtuts+(Activetuts%2B)</a></p>
<p><a href="http://www.vimeo.com/channels/hype">Video channel at Vimeo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2010/02/12/getting-started-with-hype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protecting your SWF with secureSWF</title>
		<link>http://as3.miguelmoraleda.com/2010/02/08/protecting-your-swf-with-secureswf/</link>
		<comments>http://as3.miguelmoraleda.com/2010/02/08/protecting-your-swf-with-secureswf/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 15:31:15 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=255</guid>
		<description><![CDATA[I’ve been worried about this topic for a long time now, especially when I work as freelancer. Because every time I demo a project to a clients, I always fear they will decompile the SWF and disappear. I might be paranoid, but not too far from reality. Fortunately I’ve never had any problems like this, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kindisoft.com/"><img class="alignleft size-full wp-image-263" title="secureswf-150" src="http://as3.miguelmoraleda.com/wp-content/uploads/2010/02/secureswf-150.jpg" alt="secureSWF" width="150" height="175" /></a><br />
I’ve been worried about this topic for a long time now, especially when I work as freelancer.  Because every time I demo a project to a clients, I always fear they will decompile the SWF and disappear. I might be paranoid, but not too far from reality. Fortunately I’ve never had any problems like this, but I still prefer to be protected. Besides, these attacks are used for other purposes such as intellectual property theft, search for security flaws and exploits, and so on. It is also a very important issue when your application is of commercial value, as it is even more tempting to get the full benefit in a gruesome way.<br />
Anyone with a copy of a Flash decompiler such as ASV or Sothink Decompiler can look at your ActionScript code. Suddenly, your licensing code, copy protection mechanisms, and proprietary logic are available for all to see – whether it’s legal or not. Anyone can use the details of your software for whatever reason they like. They can search for security flaws to exploit, steal unique ideas, crack programs, etc.</p>
<p>ActionScript is very easy to decompile. There are over 22 decompilers today. This is not a design flaw in the language; it’s a reality of all <a href="http://en.wikipedia.org/wiki/Interpreted_language">interpreted language</a> such as Java, .NET, etc.</p>
<p>The encryption of the SWF (more like the <a href="http://en.wikipedia.org/wiki/Obfuscation"> code obfuscation</a>) is to make the code difficult to understand. It’s noteworthy that it’s not actual encryption.</p>
<p>Despite all the protection it gives us, the <a href="http://en.wikipedia.org/wiki/Obfuscation">obfuscation code</a> is still vulnerable to illegal redistribution; anyone can download the SWF and republish it. To solve this issue, <a href="http://www.kindisoft.com/"> secureSWF</a> has a protective system of domains (the movie will only work on the list of domains we specify) and also an encrypted loader (generates a separate swf to load our movie, assigns an encrypted name to the swf and decrypt it at runtime making it harder to download our swf), the grace of this protects us from attackers or SWF rippers grabbers.</p>
<p>secureSWF is the most sophisticated ActionScript obfuscation, code protection, and SWF encryption solution for Adobe’s Flash and Flex.<br />
It provides state-of-the-art techniques to stop Flash decompilers, prevent illegal copying and redistribution, and help you increase your Flash application’s security.<br />
<br/></p>
<h4>What secureSWF&#8217;s SWF Encryption Does</h4>
<p><br/></p>
<li><strong>Control Flow Obfuscation</strong></li>
<p>Changes possible areas of the code flow that doesn’t affect the way the application runs. It also inserts extra control flow statements in certain areas of the code to make decompilation virtually impossible.</p>
<li><strong>Dynamic Code Wrapping</strong></li>
<p>Dynamically wraps up the ActionScript byte-code blocks in SWF files to make finding entry points of the code very difficult for Flash decompilers. This will usually crash the decompiler.</p>
<li><strong>Statement-level Randomization</strong></li>
<p>Will randomly restructure the sequence of the byte-code instructions that the decompiler uses to reform a complete ActionScript statement. It removes all the possible links between the compiled byte-code and the ActionScript source code making decompiling a very difficult process.</p>
<li><strong>String Encryption</strong></li>
<p>Will replace sensitive literal strings in your code with a function call that gets the string from an encrypted byte array.<br />
<br/></p>
<h4>The Information secureSWF Removes</h4>
<p><br/></p>
<li>Packages (and internal namespaces for AS3)</li>
<li>Classes</li>
<li>Functions (getters and setters as well)</li>
<li>Variables (local and global variables for AS1 and AS2)</li>
<li>Handles Inheritance and Polymorphism</li>
<li>Dynamic Variables (even the ones done by AS2 eval)</li>
<li>Removes Function Parameters Names</li>
<li>Frame Labels</li>
<li>Symbol Instance Names</li>
<li>Button Names</li>
<li>Textfield Names</li>
<li>Edit Textfield Variables</li>
<li>SWF Metadata</li>
<li>ActionScript 3 Metadata</li>
<p><br/></p>
<h3><a href="http://www.kindisoft.com/secureSWF/getting-started.php">Getting Started secureSWF</a></h3>
<p><br/></p>
<h3><a href="http://www.kindisoft.com/secureSWF/help/v3.4/">secureSWF Manual</a></h3>
<p><br/></p>
<h4>Demo</h4>
<p><br/><br />
Only to show you the result of the <a href="http://www.kindisoft.com/">secureSWF</a> encryption I wrote this basic class.<br />
<br/></p>
<h5>Before</h5>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageAlign</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageQuality</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">StageScaleMode</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _draw:Sprite;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			configStage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			createDraw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			testFor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> testFor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">10</span>; i++<span style="color: #66cc66;">&#41;</span> 
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createDraw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_draw = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			addChild<span style="color: #66cc66;">&#40;</span>_draw<span style="color: #66cc66;">&#41;</span>;
			_draw.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0xff0000<span style="color: #66cc66;">&#41;</span>;
			_draw.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
			_draw.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> configStage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">quality</span> = StageQuality.<span style="color: #006600;">BEST</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span> = StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h5>After</h5>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #b1b100;">do</span> <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">Object</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #b1b100;">do</span><span style="color: #66cc66;">&#40;</span>  <span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> _local_1:boolen;
			<span style="color: #000000; font-weight: bold;">var</span> _local_2 = false<span style="color: #66cc66;">&lt;</span>NULL<span style="color: #66cc66;">&amp;</span>param2;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2<span style="color: #66cc66;">&amp;&amp;</span>_local_1 <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2 <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span>.<span style="color: #b1b100;">break</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2 <span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">this</span>.<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2<span style="color: #66cc66;">&amp;&amp;</span>_local_2 <span style="color: #66cc66;">&#41;</span>
					<span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">this</span>. <span style="color: #b1b100;">do</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #66cc66;">&#125;</span>
					<span style="color: #b1b100;">return</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>  <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> _local_1:boolen;
			<span style="color: #000000; font-weight: bold;">var</span> _local_2 = ^===<span style="color: #66cc66;">&lt;</span>-^false++;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_1 <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				 <span style="color: #b1b100;">case</span> = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2<span style="color: #66cc66;">&amp;&amp;</span>this <span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
				<span style="color: #66cc66;">&#125;</span>
				addChild<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>. <span style="color: #b1b100;">case</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2<span style="color: #66cc66;">&amp;&amp;</span>_local_1 <span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">this</span>. <span style="color: #b1b100;">case</span>.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">16711680</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_1 <span style="color: #66cc66;">&#41;</span>
					<span style="color: #66cc66;">&#123;</span>
						_local_2 = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span>;
						drawRect<span style="color: #66cc66;">&#40;</span>,<span style="color: #0066CC;">this</span> <span style="color: #0066CC;">instanceof</span> <span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">100</span>,<span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
						<span style="color: #0066CC;">this</span>. <span style="color: #b1b100;">case</span>.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">return</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span>  <span style="color: #b1b100;">case</span>:Sprite;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #b1b100;">break</span><span style="color: #66cc66;">&#40;</span>  <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> _local_1:boolen;
			<span style="color: #000000; font-weight: bold;">var</span> _local_2:<span style="color: #0066CC;">Object</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2 <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> _local_2 <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">quality</span> = StageQuality.<span style="color: #006600;">BEST</span>;
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">||</span>this <span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span> = StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">return</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span>  <span style="color: #b1b100;">do</span><span style="color: #66cc66;">&#40;</span>  <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> _local_2 = <span style="color: #000000; font-weight: bold;">true</span> as param2<span style="color: #66cc66;">&gt;</span>=param2;
			<span style="color: #000000; font-weight: bold;">var</span> _local_3:boolen;
			<span style="color: #000000; font-weight: bold;">var</span> _local_1:<span style="color: #0066CC;">int</span>;
			<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> _local_1<span style="color: #66cc66;">&lt;</span><span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">return</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><br/><br />
You can see, the result is very crazy, but the code executes exactly the same as the original. For this example I used the standard encryption preset (among other presets), but with more security settings my decompiler crashed. Very nice!!<br />
Well, this example is the end of my post. I hope you like it. Any comment or suggestions will be welcomed.</p>
<p>Sponsored by <a href="http://www.kindisoft.com/"> secureSWF</a></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2010/02/08/protecting-your-swf-with-secureswf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Point in Polygon with actionscript 3</title>
		<link>http://as3.miguelmoraleda.com/2009/10/28/point-in-polygon-with-actionscript-3punto-dentro-de-un-poligono-con-actionscript-3/</link>
		<comments>http://as3.miguelmoraleda.com/2009/10/28/point-in-polygon-with-actionscript-3punto-dentro-de-un-poligono-con-actionscript-3/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 13:36:58 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=221</guid>
		<description><![CDATA[Testing whether a point is inside a polygon is a basic operation in computer graphics. Here a example of how to do that in a very simple way. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [...]]]></description>
			<content:encoded><![CDATA[<p> Testing whether a point is inside a polygon is a basic operation in computer graphics. Here a example of how to do that in a very simple way.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> insidePolygon<span style="color: #66cc66;">&#40;</span>pointList:<span style="color: #0066CC;">Array</span>, p:Point<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> counter:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>;
	<span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>;
	<span style="color: #000000; font-weight: bold;">var</span> xinters:<span style="color: #0066CC;">Number</span>;
	<span style="color: #000000; font-weight: bold;">var</span> p1:PointTest;
	<span style="color: #000000; font-weight: bold;">var</span> p2:PointTest;
	<span style="color: #000000; font-weight: bold;">var</span> n:<span style="color: #0066CC;">int</span> = pointList.<span style="color: #0066CC;">length</span>;
&nbsp;
	p1 = pointList<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i = <span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&lt;</span>= n; i++<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		p2 = pointList<span style="color: #66cc66;">&#91;</span>i <span style="color: #66cc66;">%</span> n<span style="color: #66cc66;">&#93;</span>;
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>p.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span>p1.<span style="color: #006600;">y</span>, p2.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>p.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&lt;</span>= <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">max</span><span style="color: #66cc66;">&#40;</span>p1.<span style="color: #006600;">y</span>, p2.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>p.<span style="color: #006600;">x</span> <span style="color: #66cc66;">&lt;</span>= <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">max</span><span style="color: #66cc66;">&#40;</span>p1.<span style="color: #006600;">x</span>, p2.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>p1.<span style="color: #006600;">y</span> <span style="color: #66cc66;">!</span>= p2.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
						xinters = <span style="color: #66cc66;">&#40;</span>p.<span style="color: #006600;">y</span> - p1.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #006600;">x</span> - p1.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #66cc66;">&#40;</span>p2.<span style="color: #006600;">y</span> - p1.<span style="color: #006600;">y</span><span style="color: #66cc66;">&#41;</span> + p1.<span style="color: #006600;">x</span>;
						<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>p1.<span style="color: #006600;">x</span> == p2.<span style="color: #006600;">x</span> <span style="color: #66cc66;">||</span> p.<span style="color: #006600;">x</span> <span style="color: #66cc66;">&lt;</span>= xinters<span style="color: #66cc66;">&#41;</span>
							counter++;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
		p1 = p2;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>counter <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">2</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://www.miguelmoraleda.com/examples/pointPolygon">DEMO</a><br />
<a href="http://www.miguelmoraleda.com/examples/PointPolygon.rar">SOURCE</a><br />
<a href="http://erich.realtimerendering.com/ptinpoly/">Reference</a></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/10/28/point-in-polygon-with-actionscript-3punto-dentro-de-un-poligono-con-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tutorial Actionscript 3 &#8211; How To Google Maps API</title>
		<link>http://as3.miguelmoraleda.com/2009/07/19/tutorial-actionscript-3-how-to-google-maps-api/</link>
		<comments>http://as3.miguelmoraleda.com/2009/07/19/tutorial-actionscript-3-how-to-google-maps-api/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 18:28:31 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=168</guid>
		<description><![CDATA[The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. The API provides a number of utilities for manipulating maps (just like on the http://maps.google.com web page) and adding content to the map through a variety of services, allowing you to create robust maps applications on your website. In [...]]]></description>
			<content:encoded><![CDATA[<p>The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. The API provides a number of utilities for manipulating maps (just like on the http://maps.google.com web page) and adding content to the map through a variety of services, allowing you to create robust maps applications on your website.</p>
<p>In this post I will explain how to use the Google Maps API.</p>
<p>1.- The first thing that you need is to get your API KEY<br />
Go to <a href="http://code.google.com/apis/maps/signup.html">http://code.google.com/apis/maps/signup.html</a></p>
<p>After read and accept the terms and conditions and give your domain name. You will get your key.</p>
<p><img class="aligncenter size-full wp-image-169" title="googleMaps" src="http://as4.miguelmoraleda.com/wp-content/uploads/2009/07/googleMaps.jpg" alt="googleMaps" width="573" height="258" /></p>
<p>2.- The next step is download the library kit of google maps for actionscript and flex.<br />
To download the kit <a href="http://maps.googleapis.com/maps/flash/release/sdk.zip">CLICK HERE</a><br />
The kit contains 2 .swc files with the library.</p>
<p>3.- With the key and api we are ready to start with the code. Create a new project and config the library path to read the swc file downloaded. In your Flash IDE press edit-preferences-actionscript- actionscript 3 and add the folder with your swc files.</p>
<p>4.- THE CODE.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _map:Map = <span style="color: #000000; font-weight: bold;">new</span> Map<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_map.<span style="color: #0066CC;">key</span> = <span style="color: #ff0000;">&quot;ACA DEBEN PONER SU KEY&quot;</span>;
_map.<span style="color: #0066CC;">language</span> = <span style="color: #ff0000;">&quot;es&quot;</span>;
_map.<span style="color: #006600;">setSize</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>, <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
_map.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MapEvent.<span style="color: #006600;">MAP_READY</span>, onMapReady<span style="color: #66cc66;">&#41;</span>;
_map.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">50</span>;
addChild<span style="color: #66cc66;">&#40;</span>_map<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onMapReady<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	_map.<span style="color: #006600;">setCenter</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LatLng<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">40.736072</span>, -<span style="color: #cc66cc;">73.992062</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">14</span>, MapType.<span style="color: #006600;">NORMAL_MAP_TYPE</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>With this simple code we have our example working.</p>
<p><a href="http://www.miguelmoraleda.com/examples/googleMaps"><img src="http://as3.miguelmoraleda.com/wp-content/uploads/2009/07/googleMaps1.jpg" alt="googleMaps" title="googleMaps" width="700" height="334" class="alignnone size-full wp-image-184" /></a></p>
<p>I hope this post help you to understand how works the google maps API. Any question or suggestions are welcome</p>
<p><a href="http://www.miguelmoraleda.com/examples/googleMaps">VIEW EXAMPLE</a><br />
<a href="http://www.miguelmoraleda.com/examples/GoogleMapsExample.rar">DOWNLOAD EXAMPLE</a></p>
<p><br><script type="text/javascript"><!--
google_ad_client = "pub-8685425838841676";
google_ad_slot = "6019231894";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/07/19/tutorial-actionscript-3-how-to-google-maps-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial actionscript3 &#8211; Loading sound and play as loop</title>
		<link>http://as3.miguelmoraleda.com/2009/07/10/tutorial-actionscript3-loading-sound-and-play-as-loop/</link>
		<comments>http://as3.miguelmoraleda.com/2009/07/10/tutorial-actionscript3-loading-sound-and-play-as-loop/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 20:33:16 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=163</guid>
		<description><![CDATA[DOWNLOAD EXAMPLE package &#123; import flash.display.Sprite; import flash.events.Event; import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; &#160; /** * This class load a sound and play it in loop. * @author http://www.miguelmoraleda.com */ public class Main extends Sprite &#123; private var soundFactory:Sound; private var song:SoundChannel; &#160; public function Main&#40;&#41; &#123; super&#40;&#41;; &#160; loadSound&#40;&#34;sound.mp3&#34;&#41;; &#125; &#160; /** * [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.miguelmoraleda.com/examples/LoadingSoundandPlayLoop.rar">DOWNLOAD EXAMPLE</a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #0066CC;">Sound</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundChannel</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * This class load a sound and play it in loop.
	 * @author http://www.miguelmoraleda.com
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> soundFactory:<span style="color: #0066CC;">Sound</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> song:SoundChannel;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">loadSound</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;sound.mp3&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Load the sound
		 * @param	url
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">loadSound</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">url</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> request:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>;
            soundFactory = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Sound</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            soundFactory.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, completeHandler<span style="color: #66cc66;">&#41;</span>;
            soundFactory.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>request<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * When sound is loaded, play it.
		 * @param	e
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> completeHandler<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			soundFactory.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, completeHandler<span style="color: #66cc66;">&#41;</span>;
			playSound<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Play the sound and add listener to sound complete.
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> playSound<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
            song = soundFactory.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			song.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, soundCompleteHandler<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * when the sound is finish play again.
		 * @param	e
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> soundCompleteHandler<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			song.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, soundCompleteHandler<span style="color: #66cc66;">&#41;</span>;
			playSound<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><br><script type="text/javascript"><!--
google_ad_client = "pub-8685425838841676";
google_ad_slot = "6019231894";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/07/10/tutorial-actionscript3-loading-sound-and-play-as-loop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Augmented Reality &#8211; levelHead v1.0, 3-cube speedrun</title>
		<link>http://as3.miguelmoraleda.com/2009/05/23/augmented-reality-levelhead-v10-3-cube-speedrunrealidad-aumentada-levelhead-v10-3-cube-speedrun/</link>
		<comments>http://as3.miguelmoraleda.com/2009/05/23/augmented-reality-levelhead-v10-3-cube-speedrunrealidad-aumentada-levelhead-v10-3-cube-speedrun/#comments</comments>
		<pubDate>Sat, 23 May 2009 18:46:01 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=157</guid>
		<description><![CDATA[www.youtube.com/watch?v=dsb76pva4s4 Read more about the project here: http://julianoliver.com/levelhead]]></description>
			<content:encoded><![CDATA[<p><span class="youtube">
<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/dsb76pva4s4?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" />
<param name="allowFullScreen" value="true" />
<embed wmode="opaque" src="http://www.youtube.com/v/dsb76pva4s4?color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;rel=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="355"></embed>
<param name="wmode" value="opaque" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=dsb76pva4s4">www.youtube.com/watch?v=dsb76pva4s4</a></p></p>
<p>Read more about the project here:<br />
<a href="http://julianoliver.com/levelhead">http://julianoliver.com/levelhead</a></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/05/23/augmented-reality-levelhead-v10-3-cube-speedrunrealidad-aumentada-levelhead-v10-3-cube-speedrun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial Actionscript 3 &#8211; How to use a webcam on Flash</title>
		<link>http://as3.miguelmoraleda.com/2009/04/18/tutorial-actionscript-3-how-to-use-webcam-on-flash-camara-we/</link>
		<comments>http://as3.miguelmoraleda.com/2009/04/18/tutorial-actionscript-3-how-to-use-webcam-on-flash-camara-we/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 19:27:59 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=107</guid>
		<description><![CDATA[Use the webcam in flash is very easy. You need a Video instance and Camera instance. 1 2 3 4 5 6 7 8 9 10 //Create a video instance video = new Video&#40;640, 480&#41;; //Get the camera reference. camara = Camera.getCamera&#40;&#41;; //setMode need 3 params, width, height and frame rate. //Optianally you can set [...]]]></description>
			<content:encoded><![CDATA[<p>Use the webcam in flash is very easy. You need a Video instance and Camera instance.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//Create a video instance</span>
<span style="color: #0066CC;">video</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Video</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">640</span>, <span style="color: #cc66cc;">480</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//Get the camera reference.</span>
camara = <span style="color: #0066CC;">Camera</span>.<span style="color: #006600;">getCamera</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//setMode need 3 params, width, height and frame rate.</span>
<span style="color: #808080; font-style: italic;">//Optianally you can set a boolean value at the end for the 	favorArea.</span>
camara.<span style="color: #0066CC;">setMode</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">640</span>, <span style="color: #cc66cc;">480</span>, <span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//put the camera in the video instance</span>
<span style="color: #0066CC;">video</span>.<span style="color: #006600;">attachCamera</span><span style="color: #66cc66;">&#40;</span>camara<span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">video</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p><a href="http://www.miguelmoraleda.com/examples/webcamExample/">VIEW EXAMPLE</a><br />
<a href="http://www.miguelmoraleda.com/examples/webcamExample.rar">DOWNLOAD EXAMPLE</a><br />
<br><script type="text/javascript"><!--
google_ad_client = "pub-8685425838841676";
google_ad_slot = "6019231894";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br></p>
]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/04/18/tutorial-actionscript-3-how-to-use-webcam-on-flash-camara-we/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Actionscript 3 &#8211; arguments of each function</title>
		<link>http://as3.miguelmoraleda.com/2009/03/28/actionscript-3-arguments-atributo-arguments-dentro-de-cualquier-funcion-functio/</link>
		<comments>http://as3.miguelmoraleda.com/2009/03/28/actionscript-3-arguments-atributo-arguments-dentro-de-cualquier-funcion-functio/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 23:32:21 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=94</guid>
		<description><![CDATA[An arguments object is used to store and access a function&#8217;s arguments. Within a function&#8217;s body, you can access its arguments object by using the local arguments variable. The arguments are stored as array elements: the first is accessed as arguments[0], the second as arguments[1], and so on. The arguments.length property indicates the number of [...]]]></description>
			<content:encoded><![CDATA[<p>An arguments object is used to store and access a function&#8217;s arguments. Within a function&#8217;s body, you can access its arguments object by using the local arguments variable. The arguments are stored as array elements: the first is accessed as arguments[0], the second as arguments[1], and so on. The arguments.length property indicates the number of arguments passed to the function. There may be a different number of arguments passed than the function declares.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ArgumentsExample <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ArgumentsExample<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                println<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Hello World&quot;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> println<span style="color: #66cc66;">&#40;</span>str:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">arguments</span>.<span style="color: #0066CC;">callee</span> == <span style="color: #0066CC;">this</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// true</span>
            <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">arguments</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span>;                 <span style="color: #808080; font-style: italic;">// 1</span>
            <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">arguments</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;                     <span style="color: #808080; font-style: italic;">// Hello World</span>
            <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>str<span style="color: #66cc66;">&#41;</span>;                                <span style="color: #808080; font-style: italic;">// Hello World</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/03/28/actionscript-3-arguments-atributo-arguments-dentro-de-cualquier-funcion-functio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial Actionscript 3 &#8211; Dynamic params in a function</title>
		<link>http://as3.miguelmoraleda.com/2009/03/28/tutorial-actionscript-3-dynamic-arguments-in-a-functio-funcion-con-parametros-o-argumentos-dinamicos/</link>
		<comments>http://as3.miguelmoraleda.com/2009/03/28/tutorial-actionscript-3-dynamic-arguments-in-a-functio-funcion-con-parametros-o-argumentos-dinamicos/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 23:20:37 +0000</pubDate>
		<dc:creator>miguelMoraleda</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>

		<guid isPermaLink="false">http://as3.miguelmoraleda.com/?p=91</guid>
		<description><![CDATA[If you want to create a function, but don&#8217;t know how many arguments you will get. This is your option. private function testDynamicArguments&#40;...args&#41;:void &#123; trace&#40;&#34;Get: &#34; + args + &#34;array lenght: &#34; + args.length&#41;; &#125;]]></description>
			<content:encoded><![CDATA[<p>If you want to create a function, but don&#8217;t know how many arguments you will get. This is your option.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> testDynamicArguments<span style="color: #66cc66;">&#40;</span>...<span style="color: #006600;">args</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Get: &quot;</span> + args + <span style="color: #ff0000;">&quot;array lenght: &quot;</span> + args.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://as3.miguelmoraleda.com/2009/03/28/tutorial-actionscript-3-dynamic-arguments-in-a-functio-funcion-con-parametros-o-argumentos-dinamicos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

