Creating a Talking Application in Flash.

Here I will show how to create a light weight talking application in flash. It is one of the Examples I showed in the Singapore User Group Session. Our task is fairly simple, Creating an audio file (preferably MP3) with all the words we want our application to speak. Using that audio in a movieclip as a streaming audio and placing frame labels(to another empty layer) to split the whole audio...

Read More

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

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

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

Using XMLShortcuts Example.

XML Shortcuts helps to access the XMLNodes with ease. You may read my previous post which compares the XMLShortcuts with XPath from XFactor Studio, XML to Object Prototype, and XMLNode easy access by tatsuo kato Here is a example file, that shows how you can use XMLShortcuts in your MTASC projects. class XMLShortcutsExample {         function...

Read More

Generating Unique Random Number for Flash Lite 1 and 1.1.

Generating Unique random number for Flash Lite 1.1 is tricky because of the Flash 4 style syntax. I’ve made a sample application which shows how this can be achieved. Here is the SWF showcasing this You can download the FLA from...

Read More

XML Shortcuts V2 released

Here you can download the second version of XMLShortcuts component which helps to access XMLNodes easily. Refer to Online Help document below for more info   <a href=”/HelpPanel/?target=XMLShortcuts” target=”_blank”>XMLShortcuts Online...

Read More

XML and V2 Tree Example 5 – Limit by Depth.

Lets explore how we can hide nodes beyond the predefined depth from rendering in tree. Before hiding the text nodes, the tree looks like this (as per Example 1) with this XML Start with a blank FLA, add a tree component to stage, name it “tree”, add a text area component name it “textArea” Write the following in the first frame ...

Read More

XML and V2 Tree Example 4 – Hiding Text Nodes.

Lets explore how we can hide text nodes from rendering in tree. Before hiding the text nodes, the tree looks like this (as per Example 1) with this XML Start with a blank FLA, add a tree component to stage, name it “tree”, add a text area component name it “textArea” Write the following in the first frame <pre>import...

Read More

XML and V2 Tree Example 3: Tree Search.

Lets enhance the last example by adding search functionality. We need a function that will return the matching nodes as an array. The following function does that for us. Add it to the timeline. <span style="color: #993300;">function</span> isMatch (s, s2) {         <span style="color:...

Read More

XML and V2 Tree Example 2: Open/Close All.

Lets enhance the last example by adding two buttons to open and close all tree nodes Add the following code to the first frame function openOrCloseAll (x, open:Boolean) {         if (tree.getIsBranch (x)) {                 tree.setIsOpen (x, open, false, false);    ...

Read More

XML and V2 Tree Example 1.

Rendering XML using Tree component is very simple, because in Flash MX 2004, V2 Tree component is based on XML. Lets explore the possible ways to visualize sample.xml in the coming examples. Create a new document in Flash MX 04, drag and drop a tree component and name it as “tree” Write the following code in the first frame import mx.controls.Tree; var tree:Tree; var...

Read More

Comparing components version 1 and 2: PushButton

The purpose of showing this is two fold. One is to show difference in the properties and methods exposed by the Push Button component in V1 and V2. Second is to show case how easy and useful it is to use my ActionScript() function to see what’s inside a component. I just dragged and dropped a push button on stage and named it as “_btn” then used the following code to...

Read More

Easy way to highlight the links in flash dynamic text

Yet another transformTags() example. You all know that links in flash text won’t highlight with blue color and underline as it does in browser. If you want to highlight all the links in your dynamic text box you may use the following object as the format object to transformTags to achieve the results as shown below. ActionScript 1.0 ...

Read More

Creating a Talking Application in Flash

Here I will show how to create a light weight talking application in flash. It is one of the Examples I showed in the Singapore User Group Session. Our task is fairly simple, Creating an audio file (preferably MP3) with all the words we want our application to speak. Using that audio in a movieclip as a streaming audio and placing frame labels(to another empty layer) to split the whole audio...

Read More

Creating Dynamic Chart with Flash Charting Components.

Here is the dynamic chart example from my Singapore User group Seminar. <ul>     <li>Create a text file with the following text and name it <em>chartData1.txt</em>.  I'm using &amp;name= value&amp; syntax instead of usual  name1=value1&amp;name2=value2 for better readability (LoadVars will  ignore the extra '&amp;'...

Read More

DataGrid Component Example.

Finally I received the Macromedia MX Developer Resource Kit today! I’m right now playing with the DataGrid component. The following example is just to show how simple it is to use the data grid component. I’ve created it by dragging and dropping a data grid component and naming it as my_dg. adding a dynamic text box and naming it as my_txt adding the following actionscript in frame...

Read More

Dynamic Tree using FTree Component and .tab file

Here I am going to explain how we can build a dynamic tree using FTree Component that comes with Flash UI Components Set 2. Hierarchical nature of XML makes it more suitable for building Tree Views But I have decided to use simple tab file (Tab delimited text file) which contains the path to build the tree like “root/branch/branchof the branch” and the URL in each line. Take a look at...

Read More