ActionScript 3.0 : Common Errors - Number 5000

Over the weekend, I was rushing for some project of mine coding some AS3 package and I kept getting errors that goes like … “Error 5000 : The Class “xxx” must subclass “flash.display.MovieClip” since it is linked to a library symbol of that type” ; as much as I love AS3.0, it is frustrating sometimes to encounter error which didn’t help users to locate or fix the bug. I hope things will be better in the upcoming CS4.

 

Two possible situation as listed below.

 

1. Forget to import flash.display.* which is necessary for all display objects on stage.

Flash Actionscript IDE does not debug or trace for errors on real time coding so, most of the time the programmers will forget what’s happening.

 

2. Do not add function Brackets for Class

This is very common but surprisingly this is the most common mistake I do every time I script a package document class. Note: This error is hard to spot as the class is very near to the method functions. Just remember the syntax no function like brackets for class. e.g. like samples below :-

 

package{
//REMEMBER : Add import associated with the display.
import flash.display.*        
 
//REMEMBER : class does not have () like method functions.
      public class docClass extends MovieClip{
	      public function docClass(){
		     trace("Class Loaded Successfully");
	      }
      }
}

IPOD Touch Tips and Tricks : Need More Generic Album Art

Just last month, I was rushing to compile my favourite 80’s song and later I noticed all the albums does not have an album art for it. How do I create a generic album art? Simple - there’s actually a lot of sample album art inside your iTunes installation folder. All you need to do is to browse the folder called X:\Program Files\iTunes\iTunes.Resources (Where X is the drive you installed your iTunes into) and take a look at the sample of graphical generic album art you get.

To fit the album art into your compilation, first start iTunes and open up your playlist. Shift click and select all the songs you wanted to compiled as one album under one album art for e.g. My Classical Collection 2008. Simply edit one of the selected album in the playlist (while songs are selected, rename just one and all the selected file album will be renamed accordingly). Next you may want to assign an album art for it by dragging images from the folder which I’ve mentioned to the album artwork section in ITunes located at the left hand corner.

 

genre-classical genre-hiphop 

genre-blues genre-classicT

genre-world genre-soundtrack

ActionScript 3.0: Tweener Class Adobe Class fl.transitions.*

Hmmm, interesting. I was playing around with Adobe tweening classes just last week. These tweening classes are the default ones found in CS3 (Note this is not the open source ones, as listed in this post here)

Here are the sample tweener class of motion tween-y and fade effect in action. (we are going to move the movieClip up and down and with the fade effect altogether).


Read the rest of this entry »

ActionScript 3.0 : Getting Data from Uncached Dynamic XML

Today’s tutorial is a bit complex, but it solved a lot of issues faced by flash developer in AS3.

We will be touching on various subjects such as: -

  1. Creating xml schema of your own.
  2. Easier way of doing xml data retrieval AS3 style.
  3. Loads the xml data into Listbox class.

NOTE : Listbox or List is a component in Flash so, it needs a separate import and special event Listener for that. You will get an error if you try to apply regular addEventListener like MouseEvent to it.

See the working sample below.


Read the rest of this entry »

Aptana IDE Customization : Programming with Dark Theme

Normally editor such as notepad, editplus, notepad++, visual studio, devstudio and many more. They came with light theme by default, which means utilizing white as the background and the syntax as the colored ones. Have you ever seen a dark theme before?

 A dark theme looks like a classical o/s prompt command or linux terminal. I found a wonderful color customization from Boris Popoff that day, regarding the customization of color template for dark theme for Aptana IDE. After using Aptana IDE for quite some time, I find dark theme suits my vision better, cause I always thinks that white background on the lcd monitor can be way too bright. Well that’s just my field of vision.

 

For those who are new to Aptana IDE - Free javascript IDE can read my review here

 

php_small

 

The font used for this is MS-Consolas. When tweaked your IDE will look like the picture above.

To download this color customization template for Aptana IDE check out http://gueschla.com/labs/green-chaud/.