Tips.PHP: Removing empty strings, NULL, FALSE, and negative numbers from Array

Often we need to remove empty elements from our array. For example when we split a string with space, we can get the words and also blank strings when there are two or more spaces put together. We can use array_filter function for rescue. When we call array_filter with out passing the filter function it removes all values that evaluate to...

Read More

Tips.PHP: Securing ViewSource.php

I’m in the process of creating Usage examples for the brand new version of RESTler. Take a look at the work in progress version here (I would love to hear your thoughts). One of the nice features in that is the ability to see the source code. I’m using a getsource.php which will return the source code of any php file when the relative path is passed as a query parameter. It is...

Read More

Enabling Run Mode Trace in Flex Builder 2.

As you know trace messages are shown only in Debug Mode in Flex Builder. You can follow the steps shown below to see the trace output in Flex Builder all the time. Open Window > Preferences… menu Select General > Editors > File Associations in the Tree Add *.swf as the New File Type Select the newly added *.swf file type and Add “Internal Web Browser” as the...

Read More

Building a XML Editor using Flex 2.

I’m making a XML Editor which can help playing around with E4X and manipulate the XML. Which will be hosted as an online service here and will also be available as a Apollo application later. Here is the alpha version of it. I welcome feature requests and suggestions, kindly post them as comments to this post. The sample XML displayed will give you a clue of what’s coming next ...

Read More

MXML Quick Reference.

Here is a Flex 2 application which helps to quickly refer to MXML tags and and its attributes. I have plans to integrate it with the Flex 2 SDK help files and make it an Apollo application. I will improve it further and make it available here as online...

Read More

Adding an icon to all items in the List Component.

List component does not have a default icon. Easy way to add one is to add a Icon function which is very similar to the one we use with Flash v2 components. Only difference is instead of string we need to return a class reference to the image [Embed (source = 'res/image_link.png')] [Bindable] public var image_ico : Class; private function...

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

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

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. 12345678function removeBOM($str=''){   if(<a href="http://www.php.net/strpos">strpos</a>($str, "»")==1)$str=<a...

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

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

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

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...

Read More

TextField.onScroller().

It is an Event handler; invoked when one of the text field scroll properties changes. When the scroll properties can change? Either when the text of the text field changes or when the size of the text field is altered. It fires the onScroller event and updates the maxscroll, and maxhscroll properly when text is changed. But when we dynamically change the size (using _width, and _height) It is...

Read More

ActionScript Highlighter Version 2 Released!

Hi Everyone! I’m happy to announce the launch of Actionscipt highligther v2. I’ve fixed many of bugs in the previous version (hope I fixed all). Now this new version fully supports Actionscript 2.0 and uses CSS styles to color the keywords so you can easily change it to your favorite colors. Help me by finding the bugs and list them all in the comments. Have a look at it...

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

__bytecode__ and its use

Robin Debreuil mentioned about it in his nice new blog(Welcome Robin!) and further discussed in FlashCoders mailinglist. Using __bytecode(“SomeByteCodeHere”); in your actionscript you can inject some bytecode into swf (It will be inserted at compile time). It can be used to compactly represent some actionscript and hide the code behind in your FLA. But the swf produced is no...

Read More

Extended Textfield to get pixel coordinates of characters

Converting x,y position in a text field into index and vice versa is very useful. Flash Coders with Director background already know the advantage. With this we can create text rollovers, place emoticons and pictures in line with the Textfield. I came to know about it through one of the FlashCoders email, Eric Westra has created a component which extends the Textfield to have the following...

Read More

Unicode escape notations generator.

As I mentioned already, for using Unicode characters in the FLA file the only way is to use notations. Here I have made an application which can convert the typed string into the escape sequence. Once I add some more functionality to it I will add to the services in this website, until then use the application...

Read More

Links disabled in guest book due to porno links by spammers

I lately noticed that some of the spammers started putting dummy comments with a link to a porno site in my guest book. It is very hard to track because some of the site names does not relate to s-e-x. To avoid such problems I’ve disabled showing links on my guest book.

Read More

ActionScript based 3D Engine by Robin Kohli

Take a look at Robin Kohli’s 3D engine at his website. You can draw 3d Shapes and save them right there. He has given download for the source as well.

Read More

Bi-Lingual Guest book version 2

I’ve released the second version of my Tamil & English Guestbook. Many people asked me what is so special in enabling Tamil typing using flash. It is basically a transliteration engine that works in the background to convert typed english character to their equivalent Tamil words. Say for example typing ‘King’ produces the exact Tamil word that can be read as King in...

Read More

Improved ActionScript() Tracing

The objective of my .toStrong code and ActionScript() function is to generate the actionscript from any object with which we should be able to recreate the object again. My String.toString Prototype does manage the /n and /r properly(thanks to Rob for pointing this to me through his comment). Now I’ve fixed it. Have a look at it here. [UPDATE] included the ActionScript 3 version as well...

Read More

Now on Linux Server

Finally I changed my ISP. I had problems with my previous ISP, they often go offline for about a weeks time without notice Since I’ve shifted to Linux now all my links are case sensitive. If you find any broken link or missing swf please add a comment here I will rectify it ASAP.

Read More

Getting Older…

Today is my Birthday! Not much of celebrations. This time my wife is with me that is the difference. As many people do, I’m also thinking of taking resolutions. I will be more focused in choosing my field. Also I will dedicate some of my time to keep this blog updated frequently.

Read More

Team Macromedia Volunteer!

Last year I was selected as a Team Macromedia Volunteer for Flash. But I kept quiet waiting for my profile to be featured in Macromedia site. Today my name is included in the list and my profile is also featured on the Macromedia site. Let me share the joy with you all ...

Read More

I will be back soon!

You might have noticed the lack of posts in my blog. It is because I came to india for my sister’s marriage. Another good news is I will bring my wife when I’m back to Singapore. I missed her for about an year. (she was in India while I was in Singapore)

Read More

New Quickviewer Section added

After little improvement, my quick blog viewer application now available as a new section in my blog, take a look at it here. It is not yet complete as per my plan. I will keep on improving it

Read More