<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>actionscript-30 &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/actionscript-30/</link>
	<description>Feed of posts on WordPress.com tagged "actionscript-30"</description>
	<pubDate>Fri, 05 Sep 2008 13:07:35 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[San Diego Flash User's Group meeting tomorrow night]]></title>
<link>http://chrisgriffith.wordpress.com/?p=112</link>
<pubDate>Wed, 03 Sep 2008 02:46:48 +0000</pubDate>
<dc:creator>Chris Griffith</dc:creator>
<guid>http://chrisgriffith.wordpress.com/?p=112</guid>
<description><![CDATA[Just a reminder that tomorrow night is our monthly meeting. We plan to recap the recent 360|Flex con]]></description>
<content:encoded><![CDATA[<p>Just a reminder that tomorrow night is our monthly meeting. We plan to recap the recent 360&#124;Flex conference and the Flash Forward conference, plan out the upgrades to the website, and most importantly next month's social outing. Demos and Q&#38;A will follow. Hope to see you at the Veoh Network's offices @ 7.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[AS3 Buttons - Event Listeners]]></title>
<link>http://chemicaluser.wordpress.com/?p=15</link>
<pubDate>Tue, 02 Sep 2008 19:07:31 +0000</pubDate>
<dc:creator>chemicaluser</dc:creator>
<guid>http://chemicaluser.wordpress.com/?p=15</guid>
<description><![CDATA[Starting out with the basic introductory tutorial on EventListeners. This was introduced in AS3, and]]></description>
<content:encoded><![CDATA[<p>Starting out with the basic introductory tutorial on <strong>EventListeners</strong>. This was introduced in AS3, and the simplest way I can explain this is as events that trigger the actions you write, setting properties and calling methods. A simple example is a button. You would add an event listener to "listen" or look for when the mouse is clicked and once it "hears" that the button has been clicked, the desired action then takes place. For example the action may be changing the alpha property of an object on the stage to lets say 50%, or going to frame 2 of the movie. Note that basic Flash CS3 knowledge is required (flash navigations, creating movie clips, etc.).</p>
<p>To start of, we are going to create a new Flash AS3 document with 2 layers. The first layers will be called actions, and as the title suggests all of your actions will be entered on that layer. The next layer we are going to create a simple rectagle movie clip, with the instance name "myButton". This movie clip will act as our button. In this example all we are going to do is once the button is clicked we are going to go and play frame 2 of our movie. Frame 2 will contain an image. </p>
<p>This is what your movie Should look like so far. You will notice 2 layers with 2 frames, with actions in both of the frames. This is frame 1<br />
<a href="http://chemicaluser.files.wordpress.com/2008/09/11.jpg"><img src="http://chemicaluser.wordpress.com/files/2008/09/11.jpg?w=300" alt="" width="300" height="167" class="alignnone size-medium wp-image-19" /></a></p>
<p>The ActionScript on <strong>frame 1 </strong>should look like this.</p>
<p><strong>myButton.buttonMode = true; </strong><br />
This code simply makes your movie clip(myButton) a button, it also ads the handcurser once the mouse is rolled over the button.</p>
<p><strong>myButton.addEventListener(MouseEvent.CLICK, f_myButton_click);</strong><br />
This line is the event handler and the easiest way to read the line is ... we are adding an event listener to the button "myButton". The event that we are listening for is a MouseEvent and the .CLICK represents that the event that we are listening for is a mouse click. Once the button has been clicked we are then going to go and run function f_myButton_click. Now if you are unsure of what functions are... think if it as blocks of code which are executed only when called. Note that you can name your functions whatever you want as long as they are not already taken by flash. I personally always start my functions with f_ </p>
<p><strong>function f_myButton_click (evt:MouseEvent) : void {<br />
	gotoAndPlay (2);<br />
}</strong><br />
This next line is the actual function f_myButton_click. Functions always begin with the word function which is followed by the function name (again, it can be anything). The next part identifies what action is actually triggering the function, in this case it is a MouseEvent. The :void part simply says that there is no value being returned to flash. The function executes the code gotoAndPlay (2)... which says go and play frame 2. If you are using frame labels you can replace (2) with ("framelabel").</p>
<p><strong>stop(); </strong><br />
This stops the movie at the current frame. And that is all the code for frame 1</p>
<p>And this is <strong>frame 2</strong>. As you can see it just has an image on the timeline.<br />
<a href="http://chemicaluser.files.wordpress.com/2008/09/2.jpg"><img src="http://chemicaluser.wordpress.com/files/2008/09/2.jpg?w=300" alt="" width="300" height="163" class="alignnone size-medium wp-image-21" /></a><br />
Frame 2 consists of an image on the stage and in the actions layers there is only<br />
<strong>stop();</strong><br />
Again this is saying stop the movie here. If you did not write the stop(); statement you movie will simply loop between frame 1 and frame 2. (As you probably know already).</p>
<p>You can download the source code here<br />
<a href="http://majakovacevic.ca/tutorials/eventsample.zip">EventSample</a></p>
<p>Good Luck. </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[]]></title>
<link>http://chemicaluser.wordpress.com/?p=9</link>
<pubDate>Mon, 01 Sep 2008 23:32:23 +0000</pubDate>
<dc:creator>chemicaluser</dc:creator>
<guid>http://chemicaluser.wordpress.com/?p=9</guid>
<description><![CDATA[So I have decided to start an ActionScript blog. I recently switched to 3.0 and I think I am in love]]></description>
<content:encoded><![CDATA[<p>So I have decided to start an ActionScript blog. I recently switched to 3.0 and I think I am in love. While it is certainly much different then 2.0 I defintily like it much more, it is far more powerful. I will post some tutorials and links to other websites, which I found very useful. Feel free to use / modify the code in any way that you like, but keen in mind if you actually want to learn the conceps and what you are writing I suggest not copy and pasting to code. Learning is the fun part, and like everything in life it requires some time and patiance.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[AS3 - calling myFunction() on main timeline from loaded SWF]]></title>
<link>http://flexcomps.wordpress.com/?p=94</link>
<pubDate>Mon, 01 Sep 2008 14:46:26 +0000</pubDate>
<dc:creator>Yogesh Puri</dc:creator>
<guid>http://flexcomps.wordpress.com/?p=94</guid>
<description><![CDATA[The post is about loading an external swf in a main swf file with some function on main timeline and]]></description>
<content:encoded><![CDATA[<p>The post is about loading an external swf in a main swf file with some function on main timeline and calling those functions from loaded swf file.</p>
<p>Now the problem is when you try to compile the external swf file with any reference to the main timeline using parent.parent or loader.parent etc. it gives error in compilation time due to the behaviour of concrete classes i.e. MovieClip, Sprite, DisplayObject so how to make a call on parent timeline where there is no direct reference. Following is one of the approach i have found quickly. It is a tricky way to do this. What you need to do is typecast the parent of loader as an Object which is a dynamic class and then call the method which gets compiled without any error. Following is the statement for the same<br />
<code>if(this.parent.parent != null){<br />
var parentObj:Object = this.parent.parent as Object;<br />
parentObj.traceMe()<br />
}</code></p>
<p>You can download the sample files from <a href="http://www.flexcomps.com/experiments/As3TimelineMethodcalling.zip">here </a>. Kindly let me know if you found any other approach</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Flash 10, Part 4 of testing drawTriangles, Old-school Tunnels]]></title>
<link>http://pixelero.wordpress.com/?p=113</link>
<pubDate>Sun, 31 Aug 2008 11:59:11 +0000</pubDate>
<dc:creator>pixelero</dc:creator>
<guid>http://pixelero.wordpress.com/?p=113</guid>
<description><![CDATA[Some old-school tunnel -effects with Flash 10 Astro, based on graphics.drawTriangles - you&#8217;ll ]]></description>
<content:encoded><![CDATA[<p>Some old-school tunnel -effects with Flash 10 Astro, based on graphics.drawTriangles - you'll need <a href="http://labs.adobe.com/technologies/flashplayer10/">the beta release of Flash Player 10</a> for these demos to show correctly:</p>
<p><a href="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelDemo.html" target="tunnel">Image tunnel:<br />
<img src="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelDemo.jpg" border="0" alt="" /></a><br />
<a href="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelTest3.html" target="tunnel">Vortex of Neon PerlinNoise:<br />
<img src="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelTest03.jpg" border="0" alt="" /></a><br />
<a href="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelTest.html" target="tunnel">Vortex of smoking pixels:<br />
<img src="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelTest.jpg" border="0" alt="" /></a><br />
(<a href="http://www.petrileskinen.fi/Actionscript/Tunnel/SmokingPixels.html" target="smoking">SmokingPixels in 2D</a> and <a href="http://www.petrileskinen.fi/Actionscript/Tunnel/SmokingPixels.as" target="smoking">source</a>. yes, probably nothing you haven't already seen in all the particle-demos around the net, just that the 3D-effect adds so much to it)</p>
<p>Sources for <a href="http://www.petrileskinen.fi/Actionscript/Tunnel/Tunnel.as" target="tunnel">class 'Tunnel'</a> and <a href="http://www.petrileskinen.fi/Actionscript/Tunnel/TunnelDemo.as" target="tunnel">TunnelDemo</a>. As a principle it's a cone and we're taking a look inside of it, bended by adding a polynome to x,y-coords. As a 3D model it's a relatively simple with no actual need for sorting the faces in z-direction, so it runs pretty fast and smoothly - I think.</p>
<p>Edit - September 2nd: <a href="http://www.petrileskinen.fi/Actionscript/Tunnel/Tunnel.as" target="tunnel">Tunnel.as</a> updated with usage of PerspectiveProjection and Utils3D.projectVectors - although the maths for projection in the earlier version were as simple as x2 = x*radius/z; y2 = y*radius/z; .</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[TypeComparison FilterFunction Implementation]]></title>
<link>http://dopenhagen.wordpress.com/2008/08/28/typecomparison-filterfunction-implementation/</link>
<pubDate>Thu, 28 Aug 2008 22:11:06 +0000</pubDate>
<dc:creator>Peter Andreas Molgaard</dc:creator>
<guid>http://dopenhagen.wordpress.com/2008/08/28/typecomparison-filterfunction-implementation/</guid>
<description><![CDATA[When applying a filterFunction to a collection the code can get a little slightly messy. Finding tha]]></description>
<content:encoded><![CDATA[<p>When applying a filterFunction to a collection the code can get a little slightly messy. Finding that I many times want to filter a collection containing objects of different types by the type of object and in order to reduce the mess, I have created a small class which encapsulates this filterfunction. I wish Function was not declared Final… all the cool things what would be made possible then :-)
</p>
<p>Anyways… while we are waiting for true reflection to find its way into our midst, here is a small implementation resembling a helper class that does the job nicely.
</p>
<p> <br />
 </p>
<p><a href="http://petermolgaard.com/projects/TypeCompareFunction.zip">Download source here</a>
	</p>
<p>     <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#3f5fbf;">/**</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#3f5fbf;">* Copyright(c) 2008 HelloGroup A/S, some rights reserved.</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#3f5fbf;">* Your reuse is governed by the Creative Commons Attribution 3.0 Denmark License</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#3f5fbf;">**/</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#9900cc;"><strong>package</strong></span><span style="color:black;"> com.hello.collections</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">{</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">    </span><span style="color:#0033ff;"><strong>public</strong></span><span style="color:black;"><br />
			</span><span style="color:#9900cc;"><strong>class</strong></span><span style="color:black;"> TypeCompareFunction</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">    {</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        </span><span style="color:#0033ff;"><strong>public</strong></span><span style="color:black;"><br />
			</span><span style="color:#6699cc;"><strong>var</strong></span><span style="color:black;"> type:Class;</span><br />
		</span>
	</p>
<p>          <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        </span><span style="color:#0033ff;"><strong>public</strong></span><span style="color:black;"><br />
			</span><span style="color:#339966;"><strong>function</strong></span><span style="color:black;"> TypeCompareFunction( type:Class )</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        {</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">            </span><span style="color:#0033ff;"><strong>super</strong></span><span style="color:black;">();</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">            </span><span style="color:#0033ff;"><strong>this</strong></span><span style="color:black;">.type = type;</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        }</span><br />
		</span>
	</p>
<p>          <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        </span><span style="color:#0033ff;"><strong>public</strong></span><span style="color:black;"><br />
			</span><span style="color:#339966;"><strong>function</strong></span><span style="color:black;"> getFunction() : Function</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        {</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">            </span><span style="color:#0033ff;"><strong>return</strong></span><span style="color:black;"> compare;</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        }</span><br />
		</span>
	</p>
<p>          <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        </span><span style="color:#0033ff;"><strong>private</strong></span><span style="color:black;"><br />
			</span><span style="color:#339966;"><strong>function</strong></span><span style="color:black;"> compare( item:Object ) : Boolean</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        {</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">            </span><span style="color:#0033ff;"><strong>return</strong></span><span style="color:black;"> item </span><span style="color:#0033ff;"><strong>is</strong></span><span style="color:black;"> type; </span></span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">        }</span><br />
		</span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">    }</span><br />
		</span>
	</p>
<p><span style="color:black;font-family:Courier New;font-size:10pt;">}</span> 
</p>
<p>   <br />
 </p>
<p>An example of its use could be as below…
</p>
<p>   <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#6699cc;"><strong>var</strong></span><span style="color:black;"> collection:ArrayCollection = </span><span style="color:#0033ff;"><strong>new</strong></span><span style="color:black;"> ArrayCollection(); </span></span>
	</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:black;">collection.filterFunction = </span><span style="color:#0033ff;"><strong>new</strong></span><span style="color:black;"> TypeCompareFunction( aClass ).getFunction();</span><br />
		</span>
	</p>
<p><span style="color:#009900;font-family:Courier New;font-size:10pt;"><em>// Add some items of different type. </em></span>
	</p>
<p><span style="color:black;font-family:Courier New;font-size:10pt;">collection.refresh(); </span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Pixel Bender: Blur with Linear Focus]]></title>
<link>http://pixelero.wordpress.com/?p=85</link>
<pubDate>Thu, 28 Aug 2008 08:39:06 +0000</pubDate>
<dc:creator>pixelero</dc:creator>
<guid>http://pixelero.wordpress.com/?p=85</guid>
<description><![CDATA[An old effect in photography I wanted to check out as a custom shader for Flash 10 Astro - beta vers]]></description>
<content:encoded><![CDATA[<p>An old effect in photography I wanted to check out as a custom shader for Flash 10 Astro - beta version needed for this demo to show correctly:<br />
<a href="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/BlurDemo.html" target="blurDemo"><img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/BlurSample01.png" border="0" alt="blurring sample" /></a><br />
<a href="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/FocusingLinearBlur.pbj" target="blurDemo">pixel bender -bytecode</a><br />
<a href="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/FocusingLinearBlur.pbk" target="blurDemo">pixel bender -source</a><br />
<a href="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/LinearBlurFilter.as" target="blurDemo">LinearBlurFilter.as</a></p>
<p>It works with three parameters: one float3 for line equation where the picture appears sharp (coefs like in Ax+By+C=0, in the demo there's two dragable blue blocks to modify that), two scales for the blur radius, in parallel and perpendicular direction at the distance of 100 pixels from the line: try setting either one to a very low value like &#60;2.0 for a more dynamic effect:<br />
<img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/BlurParameters.png" alt="" /></p>
<p>The current pixel bender version has some limitations in looping, I ended up using the shader in a recursive way in combination with actionscript. One single shader counts the blurring only by four sampled points: for a better quality - see parameter 'quality' in <a href="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/LinearBlurFilter.as" target="blurDemo">LinearBlurFilter.as</a>- the principle is to add the same shader several times, like <em>this.filters = [ shader1, shader2, ...]</em> . Original image and blurrings with 4, 16 and 64 samples - with 1,2 or 3 shaders: I'm glad the efficiency increases exponentally:</p>
<p><img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/blurMethod00.png" alt="" width="64" /> <img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/blurMethod01.png" alt="" width="64" /> <img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/blurMethod02.png" alt="" width="64" /> <img src="http://www.petrileskinen.fi/Actionscript/FocusingLinearBlur/blurMethod03.png" alt="" width="64" /></p>
<p>an example for using code:</p>
<pre>package {
    import LinearBlurFilter;
    import flash.events.Event;
    import flash.display.*;
    public class BlurExample extends Sprite {

        [Embed(source='someImage.jpg')] // url to any bitmap
        public var MyPhoto:Class;

        public var myPhoto:Bitmap;
        public var linearBlurFilter:LinearBlurFilter;

        public function BlurExample():void {
            var lineEquation:Array = [0.707,-0.707,-6.0];
            var uScale:Number = 10.0;
            var vScale:Number = 5.0;
            var quality:int = 3;

            linearBlurFilter = new LinearBlurFilter(	lineEquation,
                    uScale,
                    vScale,
                    quality
                    );
            //	add listener to do something when bytecode gets loaded
            linearBlurFilter.addEventListener(Event.COMPLETE, shaderLoaded);

            myPhoto = new MyPhoto();
            addChild(myPhoto);
        }

        private function shaderLoaded(e:Event):void {
            //	add filters
            myPhoto.filters = linearBlurFilter.filters;
            linearBlurFilter.removeEventListener(Event.COMPLETE, shaderLoaded);
        }
    }
}</pre>
<p>For further information: <a href="http://flickr.com/groups/technique/discuss/7240/#comment40358">Example in photography. The old large scale cameras had the possibilities to adjust the 'plane of sharp focus'<br />
<img src="http://www.flickr.com/photos/1419574_7ed45af213_m.jpg" alt="" /></a><br />
<br>See also <a href="http://lensbaby.com/" target="lensbabies" />Lensbabies</a>.</p>
<p>Off topic: <a href="http://www.verostko.com/" target="verostko">Art of Roman Verostko.<br><img src="http://www.verostko.com/images/cyberflowers/duet-red-small.jpg" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Programming]]></title>
<link>http://mymultitouch.wordpress.com/?p=19</link>
<pubDate>Wed, 27 Aug 2008 04:26:32 +0000</pubDate>
<dc:creator>rbedi100</dc:creator>
<guid>http://mymultitouch.wordpress.com/?p=19</guid>
<description><![CDATA[All right&#8230;now that I have hardware that works (to some degree, anyways), I am focusing on the ]]></description>
<content:encoded><![CDATA[<p>All right...now that I have hardware that works (to some degree, anyways), I am focusing on the software side of things. The language that I first settled on learning and using to program multi touch applications was ActionScript 3.0, and I started reading up on it and reading tutorials. This wasn't working out too well for me for a variety of reasons, namely that I couldn't get Flash Develop (I refuse to spend $500 for Flash CS3, or any software, for that matter) to run successfully on my computer.</p>
<p>So, I started looking into C++, and I found several IDEs which worked on my computer and were nice to use. I grabbed a copy of C++ for Dummies (Stephen Davis, 5th edition), and started reading. It is a well written book, but not without its errors, some of which are acknowledged on the author's website errata page. I have programmed in BASIC before, so some of reading I did in the early chapters was familiar to me and easy to understand. I am chugging along in the book-haven't reached graphical object oriented programming yet, but I am getting there.</p>
<p>The two IDEs which I liked best were Dev-C++ (Bloodshed, recommended by Davis in C++ for Dummies) and Microsoft Visual C++ Express 2008. Both have their upsides and downsides-Dev C++ seems to be a more lightweight, easy to use environment, but Visual C++ is more polished. Anyways, I am working with both of them, but primarily Dev-C++. While the last release of this software was in 2005, this doesn't seem to be a problem for me.</p>
<p>Some screenshots of the two:</p>
[gallery]
]]></content:encoded>
</item>
<item>
<title><![CDATA[Flashserver install: OS X (Tiger)]]></title>
<link>http://creativedge.wordpress.com/?p=32</link>
<pubDate>Sat, 23 Aug 2008 06:50:31 +0000</pubDate>
<dc:creator>Robin Leboe</dc:creator>
<guid>http://creativedge.wordpress.com/?p=32</guid>
<description><![CDATA[After downloading the latest version of Flashserver and expanding the archive I placed the flashserv]]></description>
<content:encoded><![CDATA[<p>After downloading the latest version of <a title="Flashserver download" href="http://www.nullmedium.de/dev/flashserver/" target="_blank">Flashserver</a> and expanding the archive I placed the <em>flashserver.mxo</em> object in the max-startup folder of the Applications/MaxMSP4.6 directory. This is not per the manual, which directs you to place the file in the Application Support folder. I also placed the <em>flashserver.help</em> file in the max-help folder as directed. So far so good!</p>
<p>After loading up a new Max patch I created an Object Box and scrolled through the list to find the Flashserver object type and set the port parameter to 5150 (arbitrary - even crazy! - but above 1024 to avoid collisions with OS ports). I also specified 1 connection out of a possible 256.</p>
[caption id="attachment_45" align="aligncenter" width="290" caption="Uber basic Max/MSP 4.6 patch for Flash communication"]<img src="http://creativedge.wordpress.com/files/2008/08/max_patch_1a.png" alt="Uber basic Max/MSP 4.6 patch for Flash communication" width="290" height="261" class="size-full wp-image-45" />[/caption]
<p>On the Flash side, I specified the FlashserverConnect class as the Document class and made sure that the port parameter specified in the class was also set to 5150. Here's the class:</p>
<blockquote><p>package {</p>
<p style="padding-left:30px;">import flash.display.Sprite;<br />
import flash.events.Event;<br />
import flash.events.DataEvent;<br />
import flash.events.IOErrorEvent;<br />
import flash.events.ProgressEvent;<br />
import flash.net.XMLSocket;<br />
import flash.events.IEventDispatcher;</p>
<p style="padding-left:30px;">// FlashserverConnect must extend Sprite to serve as Document class in CS3<br />
public class FlashserverConnect extends Sprite {</p>
<p style="padding-left:60px;">private var host:String = "localhost";<br />
private var port:uint = 5150; // LAPD code for crazy person (!?)<br />
private var socket:XMLSocket; // Create socket<br />
private var val:String = "Hello from Flash"; // initial value for testing<br />
private var header:String = "val";<br />
private var maxData:* = header + " "+ val + ";"</p>
<p style="padding-left:60px;">public function FlashserverConnect() {</p>
<p style="padding-left:60px;">socket = new XMLSocket();<br />
configureListeners(socket);<br />
socket.connect(host, port);<br />
send(maxData);<br />
}</p>
<p style="padding-left:60px;">public function send(data:Object):void {</p>
<p style="padding-left:60px;">trace("sending "+data);<br />
socket.send(data);<br />
}</p>
<p style="padding-left:60px;">private function configureListeners(dispatcher:IEventDispatcher):void {</p>
<p style="padding-left:60px;">dispatcher.addEventListener(Event.CLOSE, closeHandler, false, 0, true);<br />
dispatcher.addEventListener(Event.CONNECT, connectHandler, false, 0, true);<br />
dispatcher.addEventListener(DataEvent.DATA, dataHandler, false, 0, true);<br />
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);<br />
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler, false, 0, true);<br />
}</p>
<p style="padding-left:60px;">private function closeHandler(event:Event):void {</p>
<p style="padding-left:60px;">trace(event.type + "Handler: Closed");<br />
}</p>
<p style="padding-left:60px;">private function connectHandler(event:Event):void {</p>
<p style="padding-left:60px;">trace(event.type + "Handler: Connected");<br />
}</p>
<p style="padding-left:60px;">private function dataHandler(event:DataEvent):void {</p>
<p style="padding-left:60px;">trace("data received" + event);<br />
}</p>
<p style="padding-left:60px;">private function ioErrorHandler(event:IOErrorEvent):void {</p>
<p style="padding-left:60px;">trace(event.type + "Handler  " + event.text);<br />
}</p>
<p style="padding-left:60px;">private function progressHandler(event:ProgressEvent):void {</p>
<p style="padding-left:60px;">trace("progress...");<br />
}</p>
<p style="padding-left:30px;">}</p>
<p>}</p></blockquote>
<p>The next step was to test the Flash movie and view the results in Max/MXP's output panel... </p>
<p>Success! Now we can get down with some serious Max  Flash fun.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[JSFL Export Batch images to FLA/SWF]]></title>
<link>http://flexcomps.wordpress.com/?p=88</link>
<pubDate>Wed, 20 Aug 2008 06:00:15 +0000</pubDate>
<dc:creator>Yogesh Puri</dc:creator>
<guid>http://flexcomps.wordpress.com/?p=88</guid>
<description><![CDATA[This is a utility to convert bunch of images to SWFs with the same size of images. You need to place]]></description>
<content:encoded><![CDATA[<p>This is a utility to convert bunch of images to SWFs with the same size of images. You need to place the source.fla under c:\JSFL folder or you can edit the path of your fla in the JSFL file at line 35.  Download it from <a href="http://www.flexcomps.com/experiments/utilities/ExportPNG2SWF.zip">here</a>.</p>
<p>FLfile.copy("file:///C:/JSFL/source.fla",folder+'/Exported/'+tempName);</p>
<p>Also you can change the name of FLA/SWF accordingly from following lines.<br />
tempName = "Image_0"+i+".fla";<br />
tempName = "Image_"+i+".fla";</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sorting Algorithms in AS3]]></title>
<link>http://flexcomps.wordpress.com/?p=81</link>
<pubDate>Mon, 18 Aug 2008 08:17:22 +0000</pubDate>
<dc:creator>Yogesh Puri</dc:creator>
<guid>http://flexcomps.wordpress.com/?p=81</guid>
<description><![CDATA[I was studying Data Structure book last week and have converted some C based sorting Algorithms into]]></description>
<content:encoded><![CDATA[<p>I was studying Data Structure book last week and have converted some C based sorting Algorithms into AS3. The code is quite slow as compared to Flash Player's internal sorting algorithms however just for an example purpose i have written this code</p>
<p>Following are 3 algorithms those i have converted. All these 3 are not one of the fastest however Fastest ones are in queue and will be up soon</p>
<p><strong>Bubble Sort </strong>: Exchange two adjacent elements if they are out of order. Repeat until array is sorted. This is a slow algorithm.<br />
<strong>Selection Sort : </strong>Find the largest element in the array, and put it in the proper place. Repeat until array is sorted. This is also slow.<br />
<strong>Insertion Sort : </strong>Scan successive elements for out of order item, then insert the item in the proper place. Sort small array fast, big array very slowly.</p>
<p>Following is code for Bubble sort and rest you can download from <a href="http://www.flexcomps.com/experiments/Algo/Algos.zip" target="_blank">here</a></p>
<p><!--more--></p>
<p><code>package com.utils.Algo<br />
{<br />
	import flash.display.Sprite;<br />
	/**<br />
	* ...<br />
	* @author Yogesh Puri<br />
	*/<br />
	public class  BubbleSort extends Sprite<br />
	{<br />
		public function BubbleSort()//Bubble sort function<br />
		{<br />
		}<br />
		public function sort(_arr: Array)<br />
		{<br />
			var iLen:uint = _arr.length;<br />
			var i, j, temp: uint;<br />
			for(i=0;i&#60;iLen;i++) {<br />
				for(j=0;j<i>_arr[j])<br />
					{<br />
						temp =_arr[i]; //swap<br />
						_arr[i]=_arr[j];<br />
						_arr[j]=temp;<br />
					}<br />
				}<br />
			}<br />
		}<br />
		public function printElements(_arr:Array) //print array elements<br />
		{<br />
			var iLen:uint = _arr.length;<br />
			for(var i:uint=0;i&#60;iLen;i++)<br />
				trace(_arr[i]);<br />
		}<br />
 	}<br />
}<br />
</code></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Flash: TextField.htmlText and Automatic Line Breaks]]></title>
<link>http://nareshkhokhani.wordpress.com/?p=60</link>
<pubDate>Sun, 17 Aug 2008 07:58:57 +0000</pubDate>
<dc:creator>Naresh Khokhaneshiya</dc:creator>
<guid>http://nareshkhokhani.wordpress.com/?p=60</guid>
<description><![CDATA[Problem :: When you deal with TextField.htmlText don’t append any html strings directly to htmlTex]]></description>
<content:encoded><![CDATA[<p><strong>Problem</strong> :: When you deal with TextField.htmlText don’t append any html strings directly to htmlText property of TextField. Because the TextField appends “&#60;br&#62;” tag automatically before it appends any html string to htmlText property, it will set your string automatically in next line instead of the current line. This mistake is done to save memory as we don’t have to create a temporary string.</p>
<p>Example :</p>
<p>textField.htmlText = “”;                 //clear any previous texts</p>
<p>for(var i:uint = 0; i &#60; 3; i++)<br />
{<br />
var str:String = “”;<br />
str += “Hello World”;<br />
str += “&#60;br&#62;”;                    //As you’re thinking of breaking line from here<br />
textField.htmlText += str;<br />
}</p>
<p>//output would be something like following ::<br />
Hello World<br />
//This line break because of &#60;br&#62; tag<br />
Hello World         //This is an automatic line break<br />
//This line break because of &#60;br&#62; tag<br />
Hello World         //This is an automatic line break<br />
//output finished</p>
<p><strong>Possible Solution</strong> :: Create an empty string and append all the html strings to this string. When the final string is ready, assign this string to htmlText property of TextField. This will not create any unnecessary line breaks inside TextField.</p>
<p>Example :</p>
<p>textField.htmlText = “”;                 //clear any previous texts<br />
var htmlStr:String = “”;                  //Temporary empty string</p>
<p>for(var i:uint = 0; i &#60; 3; i++)<br />
{<br />
var str:String = “”;<br />
str += “Hello World”;<br />
str += “&#60;br&#62;”;                    //As you’re thinking of breaking line from here<br />
htmlStr += str;<br />
}</p>
<p>textField.htmlText = htmlStr;</p>
<p>//output would be something like following ::<br />
Hello World<br />
Hello World<br />
Hello World<br />
//output finished</p>
<p>Hope this would prevent someone from mistakes which I did :(</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ans: ActionScript 3.0 Object class Quiz]]></title>
<link>http://nareshkhokhani.wordpress.com/?p=55</link>
<pubDate>Sun, 17 Aug 2008 06:42:45 +0000</pubDate>
<dc:creator>Naresh Khokhaneshiya</dc:creator>
<guid>http://nareshkhokhani.wordpress.com/?p=55</guid>
<description><![CDATA[And here is the answer to quiz ::
undefined                            ]]></description>
<content:encoded><![CDATA[<p>And here is the answer to quiz ::</p>
<p>undefined                                   //as property 'prop1' is not defined in obj2 and we pointed obj1 to obj2</p>
<p>Khokhaneshiya                          //now we defined 'prop1' in obj1 and set value 'Khokhaneshiya'</p>
<p>//also <strong>obj2.prop1</strong> will be <strong>Khokhaneshiya</strong>... You can trace out :)</p>
<p>What you were thinking? :)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ActionScript 3.0 Object class Quiz]]></title>
<link>http://nareshkhokhani.wordpress.com/?p=46</link>
<pubDate>Fri, 15 Aug 2008 15:52:35 +0000</pubDate>
<dc:creator>Naresh Khokhaneshiya</dc:creator>
<guid>http://nareshkhokhani.wordpress.com/?p=46</guid>
<description><![CDATA[Check following code ::
var obj1:Object = new Object();
obj1.prop1 = “Naresh”;
obj1.prop2 = “K]]></description>
<content:encoded><![CDATA[<p>Check following code ::</p>
<p><em>var obj1:Object = new Object();<br />
obj1.prop1 = “Naresh”;<br />
obj1.prop2 = “Khokhaneshiya”;<br />
var obj2:Object = new Object();<br />
obj2.prop2 = “Hello world”;<br />
obj1 = obj2;<br />
trace(obj1.prop1); </em>//What will be output here<br />
<em>obj1.prop1 = “Khokhaneshiya”;<br />
trace(obj1.prop1);</em> //What will be output here</p>
<p><strong>Be honest, Don’t trace it out using Flash.</strong></p>
<p>You will have answer in following posts !</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ActionScript 3.0 Rockz!]]></title>
<link>http://xenoargento.wordpress.com/?p=173</link>
<pubDate>Fri, 15 Aug 2008 10:00:12 +0000</pubDate>
<dc:creator>rivalslayer</dc:creator>
<guid>http://xenoargento.wordpress.com/?p=173</guid>
<description><![CDATA[I was famailar with ActionScript 2.0. I knew tit bits of AS2 coding. What I didn&#8217;t know is tha]]></description>
<content:encoded><![CDATA[<p>I was famailar with ActionScript 2.0. I knew tit bits of AS2 coding. What I didn't know is that ActionScript 3.0 is something totally revamped. When I first got taste of the new ActionScript 3.0 (though not much new), I was amazed to see the language. It is no more a mere language that can be used to add interactivity in Flash movie. Adobe just pushed the limits! Now it can be used to develop Adode AIR, Flex application and Flash movies and apps. It has a bit JavaScripty tinge and DOM, which makes it sexier. Web designing no more HTML, JavaScript, PHP, MySQL etc etc. It has something more amazing, not only for the Coding buffs out there, but also the Desginers.</p>
<p>I found my role as a technology taster in the world of technology. I hope to the web change a lot with all these new great technologies coming up.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Mapping Talk from August San Diego Flash User Group Meeting]]></title>
<link>http://chrisgriffith.wordpress.com/?p=90</link>
<pubDate>Thu, 14 Aug 2008 16:39:58 +0000</pubDate>
<dc:creator>Chris Griffith</dc:creator>
<guid>http://chrisgriffith.wordpress.com/?p=90</guid>
<description><![CDATA[
At the AugustSan Diego Flash User&#8217;s Group meeting, I gave a presentation on mapping solutions]]></description>
<content:encoded><![CDATA[<p><a href="http://chrisgriffith.files.wordpress.com/2008/08/mappingtalk.pdf"><img class="aligncenter size-medium wp-image-91" src="http://chrisgriffith.wordpress.com/files/2008/08/slide01.jpg?w=300" alt="" width="300" height="225" /></a></p>
<p>At the August<a href="http://sdfug.org">San Diego Flash User's Group</a> meeting, I gave a <a href="http://chrisgriffith.files.wordpress.com/2008/08/mappingtalk.pdf">presentation</a> on mapping solutions that are available for use in the Flash Platform. I want to say thanks to Zach Graves at Yahoo! who helped with some of the finer points of the Yahoo! solution. The slides are very visual, but there is some sample code tucked away in the deck. The main take away, was there are several great solutions available to Flash developers. </p>
<p>Some of the key points are: what is the map coverage of the interested area. This is an area of concern of an app I am developing. Adobe AIR support is also something to be aware of in picking your map solution.</p>
<p>One nice surprise was learning about the globe feature in the Mapquest 5.3 api.  </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Tiled Background on custom event]]></title>
<link>http://flexgalleries.wordpress.com/?p=14</link>
<pubDate>Mon, 11 Aug 2008 18:41:28 +0000</pubDate>
<dc:creator>Flexgalleries.com</dc:creator>
<guid>http://flexgalleries.wordpress.com/?p=14</guid>
<description><![CDATA[Hello Friends
We were looking for tiled background in our project. We saw many posting related to ti]]></description>
<content:encoded><![CDATA[<p>Hello Friends</p>
<p>We were looking for tiled background in our project. We saw many posting related to tiled background but those posting didnot solve our purpose. The reason was all those examples set tiled backgroun on application initialize. But our requirement was to set tiled background on some custom event. Here we are posting a demo appliaction. This demo application is based on solution we developed in our project. We hope this will help you too.</p>
<p><a href="http://www.flexgalleries.com/components/flex/tiledbackground/tiledbackground.html">Click to see examle working</a><br />
<a href="http://www.flexgalleries.com/code/flex/TiledBackground.rar">Click to download code</a></p>
<p>Thanks<br />
<a href="http://www.flexgalleries.com">http://www.flexgalleries.com</a></p>
]]></content:encoded>
</item>

</channel>
</rss>
