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 FALSE. <?php $string = "I love   Luracast...

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

Why haXe to SWC is important for Flex/Flash Developers?

I believe that haXe is the right platform for developing api’s and code libraries. Why haXe? If you use just the haXe core libraries. HaXe Can compile to Javascript by generating a single .js file Can compile to Flash 6-8 by generating a single  .swf file Can compile to Flash 9-10 / Tamarin by generating a single  .swf file generate optimized integer arithmetic autocast when reading...

Read More

Powerflasher FDT 3.O Review

FDT is an Eclipse based IDE for Actionscript coding. I heard about it a lot but never tried it on my own. When I came to know Nico Zimmerman is about to present in our FUG. I wanted to try it before that so that I can better understand the platform and raise any issues that I come across. FDT is a plugin for eclipse, so I have to install Eclipse first. Since fdt site did not specify or...

Read More

“Code Generation Techniques” – Presentation

Today I have presented on code generation techniques on the Singapore Flex User Group. Here are the important links for that presentation Eclipse Monkey Eclipse Monkey allows you to write scripts that run inside Eclipse and through DOMs are able to access and control(script) parts of the Eclipse Platform. Overview Eclipse Monkey Scripting Information Eclipse Monkey Exchange Action Script 3...

Read More

“Flex Production Techniques” – Presentation

Today I presented in the Flexcamp on Flex Production Techniques. I showcased ThumSUB for the very first time Here are the slides for that presentation [slideshare id=913928&doc=flexproductiontechniques-1231869298036794-1&w=425]

Read More

Webcam Motion Detection using AS3.

Some time back Guy Watson wrote an article in the developer center called Webcam Motion Detection: Using the BitmapData API in Flash 8. He later made a better version of it and included that source in the zip file. I went through that code and completely rewrote it in ActionScript 3. Here is the demo. This one of course requires a webcam and flash 9 player to play around. Once I clean up the...

Read More

Aral Balkan on Application Development & Architecture for the Flash Platform.

3dsense Media School people have brought in Aral Balkan to Singapore. He will be giving us a speech coming Sunday. Look at http://pixelreloaded.com/ for more details. Even if you haven’t registered for the event, do come over. On the spot registration will be available, and I will also be there Thanks to 3dsense guys, I met with Aral Balkan and we talked a lot. It was great talking to...

Read More

Background becomes black when defining depthColors style for Tree Component.

It used to work fine before (in Flex 2.0). Now with Flex 2.0.1, it renders as shown below when we define depthColors attribute for Tree Component depthColors="[0xFFFFFF, 0xF2F6F7, 0xEDF5F7, 0xE8F0F2, 0xD3E2E6]" If I find any workaround I will update this post. If you know a workaround please post it as a...

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

Trace from anywhere, a Flex based Tracer Panel.

Here is an Flex application that generates mm.cfg according to your OS (XP, Vista, Mac)and shows the standard trace() outputs in real time (well! there is a slight delay). I love to replicate the features of the IDE using Flash itself. It all started with my flash 6 reference panel made with flash 6 Here is how this tracer works Here it is to test it yourself...

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

Designing a Search Field .

Utilizing the available application space effectively is one of the important things we need to consider when designing an user interface. Olden search interfaces had two parts text input field and a search button. Then the “search”/”find”/”go” text is replaced with a lens icon. Now a days this lens icon is embedded inside the input text itself. If you want...

Read More

Setting up Flex 2 SDK on Fedora Core 6 – Part 1 – Installing Flash Player 9.

This Visual Guide can help an average windows user to setup flex 2 SDK and start building flex applications in the Linux platform. Part 1 shows how to install both standalone and plugin version of the flash 9 player. Stay tuned for...

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

Free SWF to XAML Converter.

This should interest any one who wants to get into WPF (Windows Presentation Foundation). What interests me is Michael Swanson’s interview in which he explains SWF file format internals.

Read More

My ‘Core 2 Duo’/Dell Story.

About six months back I bought a dell Inspiron 9400 laptop with 17″ Wide-Aspect screen with the resolution 1920×1200, 2GB Ram, 2GHz Core Duo Processor with complete cover for one year. I felt the power of it and was very happy. Not even a month had passed, suddenly the display failed. I was given two options Get a replacement for the entire machine, but have to wait for a...

Read More

Shockwave-india.com moved to another server.

Last week I moved the site to another server. During this time I’ve lost few comments added to the blog, and also some emails. If any of you sent a mail to me or left a comment and couldn’t find it there, please send it again. Sorry for the trouble

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

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

Solution for using relative paths in swfs to load data.

Only starting from Flash 9 and Actionscript 3 we can reliably use relative path to load data. Let me explain the problem. say for example we have an swf file named ‘Slide.swf’ in a folder ‘Slide001′ folder which loads ‘data.xml’ using the following statement my_xml=new XML(); my_xml.onLoad=function(success){ //process the xml...

Read More