Enhancing the Blog Reader Example.

In the Live docs you might have read about Retrieve and Display Data. Here I’ve enhanced the same MXML by the following The LinkButton hidden until the datagrid change event is fired. Enabled the Data Tips for ‘Posts’ column to show tool tips text on roll over. Made it a scalable layout by using constraint-based layout. Here is the MXML code, I’ve highlighted the changes...

Read More

Sending Arrays with offset Index.

Last time we saw the problem with sending ActionScipt 3 Associative Array. Now we let us see where associative arrays can help. Lets Make an Array with offset index in PHP: $arr =array(5=>5); in ActionScript: var arr:Array= []; arr[5]=5; Sending these arrays either way they go with the missing indices filled with null, so the PHP array comes to flash as arr=[null, null,...

Read More

Webcam Motion Detection using AS3 – Source Released.

I rewrote the webcam motion detection example in Actionscript3 using Flash 9 Alpha. You can see the demo here. As I promised earlier the FLA is ready for download here ๐Ÿ™‚

Read More

Understanding AMF0 and AS3 Array.

You might have already read about Array oddity in AMFPHP/Flex 2. AS3 Associative Arrays, when sent through AMF0 they include ‘length’ propery. But numeric index based Arrays are fine. I’ve created the following AMFPHP Service to showcase this issue. It is a simple service with a remote method that converts any given object to string and returns...

Read More

Introducing ObjectStore.

What is ObjectStore? Object Store is a service for creating, managing and accessing objects on the server. It is a light weight alternative to keeping XML data on the server. How do we compare ObjectStore with RemoteSharedObject? ObjectStore is similar to RemoteSharedObject in terms of storing data on the server, but ObjectStore does not poll (automatically refresh) data and does not fire...

Read More

Service Browser does not handle method table ‘arguments’ metadata defined as key value pairs.

While defining the method table for my ObjectStore service I noticed it. Those who use the JavaDoc style comments to generate the method table may never notice this issue. Arguments metadata can be defined as an array of strings (as created by javadoc comments) or array of array which contains argument name as the key and settings as the value. More on this at amfphp.org ServiceBroswer class...

Read More

How to load data from a remote URL?

I found that the DataLoadingTest class given in Adobe Labs ActionScript 3 Resources site was buggy and did not work. I’ve corrected the file myself and made it work. Here is the working code ๐Ÿ™‚ ActionScript3 package { import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.Event; public class DataLoadingTest { private var...

Read More

Porting XMLHighlighter class to ActionScript 3.

XMLHighlighter generates color highlighted pretty printed HTML code for the given XML document, I have ported it from ActionScript 2 to ActionScript 3. Here is what I learned during the process XML object in ActionScript 3 is different (It is ECMAScript for XML (E4X)). For backward compatibility we have XMLDocument class which is equalent to XML in Actionscript 3. In ActionScript 3 we need to...

Read More

Removing Byte Order Mark (BOM) from the given string.

Since PHP does not recognize and ignore BOM in the loaded files, I wrote the following script to find and remove the BOM from the loaded string. function removeBOM($str=''){     if(<a href="http://www.php.net/strpos">strpos</a>($str, "ยป")==1)$str=<a...

Read More