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

XML Shortcuts V2.2 MTASC Edition released

Now XMLShortcuts meets MTASC 🙂 I received many requests to make XMLShortcuts available for MTASC (Motion Twin Action Script Compiler). I could not do it with my busy schedule so far, but finally here it is Download package consists of XMLShortcuts.as, an example and help files <a href=”/HelpPanel/?target=XMLShortcuts_MTASC_Edition” target=”_blank”>XMLShortcuts...

Read More

Counting number of words in a String.

Here is a simple code to get the word count. To ease up the process, I do not count the words that are not separated by space For Example “Mr.Arul” will still be counted as one word. but it makes sure whitespace is not counted as words Here is the code function wordcount(txt) {         if (!isNaN(txt+" 0"))...

Read More

String.isWhite and String.getWordCount().

This is the same word count function that I showed in the previous post presented in the good old way of adding more properties and methods through the prototype. String object is extened to have isWhite read only property and getWordCount method. String.prototype.addProperty('isWhite', function () {         return !isNaN(this+'...

Read More

Easy way to Randomize an Array.

Here is the sample code to shuffle the contents of an array // Here is a simple function for randomizing the array function randomsort(a, b) {         return Math.random()&gt;.5 ? -1 : 1; } //usage example var arr = [1, 2, 3, 4, 5]; arr.sort(randomsort); trace(arr); //traces 4,3,1,5,2

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

including Actionscript 1 files in Actionscript 2 Project.

When we are including an AS1 file in an Fla which has to be published as AS2, we need to be careful in naming the include file. There shouldn’t be any object initialized in _global which has the same name as the include file. Say for example, I had a include file called Security.As and inside that had _global.Security=new Object(). When I published I got the following ...

Read More

Is Running in Flash IDE?

When testing my application in IDE, I wanted to use some hard coded test data instead of Every time loading the dynamic data. System.capabilities.isDebugger is the boolean property which is true when we are testing in IDE or special Debug Player. Here is the sample code that I’ve used <pre>if (!System.capabilities.isDebugger) {    ...

Read More

XML Shortcuts V2.2 released.

Release Notes Version 2.2 is a minor update for fixing a bug and performance fine tuning. Revision History Version 2.1 Fixed the following issues. – Both Pro and Lite versions create an unwanted variable ‘s’ in _level0 – In Pro, even after loading another XML. Some of the shortcuts still point to the old nodes. Version 2.2 Performance improvement in Pro component You can...

Read More

XML Shortcuts V2 approved by Macromedia.

XML Shortcuts component is tested and approved by Macromedia. Now you can download it from Macromedia Exchange

Read More

Porting Flash MX 2004 Help Panel to the Web

It all started like this. I’ve created a Flash MX 04 component, with proper documentation. When I wanted to talk about that component on the web, I had to re-format the help document to put it on the web. Then I decided to make a flash page that renders the table of contents properly using the same ‘help_toc.xml’ which is used by the help panel. It can be useful to anyone...

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

XMLShortcuts Version 2 coming soon.

I’m already working on version 2 of this XMLNode easy access component. It will give better performance than the previous version. It will have two components, XMLShortcuts Lite and XMLShortcuts Pro. Both provide the same functionality. XMLShortcuts Lite is optimized for file size & memory, it is recommended for Small Projects. XMLShortcuts Pro is optimized for processor &...

Read More

XML Shortcuts component released.

The XMLShortcuts component enables shortcut access to All XML nodes. Biggest advantage of using XML shortcuts is it can be easily added to existing projects with out any modification. Simply drag and drop the component from components window to the stage and then delete it from stage (let it stay in the library). Available Shortcuts: Property Description childNode Get the first child...

Read More

XML Shortcut – Accessing XMLNode easily as a Object

If you hate accessing XMLNodes using myXML.firstChild.childNodes[3] approach, there are already couple of other approaches to deal with. Before getting to know my new approach lets examine the other possibilities.   What do you think? Will XML Shortcuts component be of any use to you? Express your views in the comments, based on the demand I will release the...

Read More

Added a new section – ActionScript2.

To better organize my blog, I’ve added a new section called actionscript2, all the AS2 class files will be placed here for download. I will also convert some of my as1 functions into as2 class files and place them here

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

ColorSyntax Extractor now generates XML for Flash based Syntax Highlighter .

I’ve modified my Color Syntax Extractor to include XML for Igor’s Flash Syntax Highlighter, which is a flash based synctax highlighter for actionscript. You can download the tool from here!...

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

Where Flash MX 2004 fails to render Unicode.

Unicode text includes bidirectional text, text that requires contextual shaping, and text with combining characters. Unicode text cannot be rendered with traditional one-code-point to one-glyph rendering; it requires analysis and processing of runs of text. Currently Flash MX04 is able to render Unicode text properly with system fonts, but when we embed the font, the pre processing that is...

Read More

New RIA Interface for my blog.

Quick Blog Viewer v3 is a Flash based RIA for my blog. Now you can keep track of the posts easily, find out what is new since your last visit, flag your favorite posts. It’s interface should explain how. Check it out at blog/quickview Don’t forget to right click on the grid after selecting something 😉

Read More

Quick Blog Viewer version 3.0 released.

I’m very happy to launch Quick Blog Viewer version 3.0, It is Mail Client kind of interface for my blog. It is also a show case of what we can do in flash using XML, localSharedObject, Flash MX 04 Components, and CellRenderer API. Have a look and Kindly pass on your comments.

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

I’m back again.

I always thought I will be more productive (on my blog) when I’m alone. But I’m wrong this time. I couldn’t do much when my family was away. Now they are back and I’m also back in this blog 🙂 Meanwhile my comment boxes were spamed. So I’ve disabled them. What ever you post on the comments box wont appear on the comments but it will be received by me as email....

Read More

Actionscript Syntax Highlighting with SE|PY Editor v.1.0.5.4.

SE|PY has become my favorite actionscript editor these days. It’s default color highlighting scheme is very different from Flash IDE. So I’ve modified it to syntax highlight similar to my actionscript highlighting service 2 and exported the settings using File > Import/Export > Export Settings for your convenience. You may download SEPY_ColorStyle.tar.gz and import it into SEPY...

Read More

PriorityQueue Class

Brandan Hall wrote the PriorityQueue (pQueue) class in “Object Oriented Programming with ActionScript” published by New Riders. I’ve converted that class to ActionScript 2 which you may download from here.

Read More

Actionscript for XML pretty printing and color highlighting . XMLHighlighter class

XMLHighlighter class Availability Flash Player 6 (copy the XMLHighlighter class actionscript file to the same folder as the FLA or to the class path). Description Use the methods and properties of the XMLHighlighter class to generate the html code to generate color highlighted pretty printed XML Method summary for the XMLHighlighter...

Read More

XML pretty printing and color highlighting .

We used to build many Flash Applications which exports data as XML. How about pretty printing it with colors? Before writing my own code I searched to find any existing code and found this code written by Evgeniy Potapenko in prototype. It does the basic pretty printing part, but it had few problems in handling the text nodes. It adds tabs before text nodes and unlike the native .toString()...

Read More