Dec 04

It has been more than a month that I didn’t post a new image transition effect. That’s because it’s hard to figure out a nice idea.

Therefore, if you have any good suggestion on Image Transition, please let me know.

The images used in the applications are created by me via the Facebook Application Pencake Ecard.

Vote for this sample

Flash is Better? (254 votes)
Silverlight is Better! (278 votes)

Comparison

Flash implementation: 30 minutes (Implemented First)
Silverlight implementation: 30 minutes

Source codes

Flash

Silverlight

Sep 29

Text Effect is a very common feature for many online application. Today, I am going to introduce you a simple, but also beautiful, text effect application. It’s time to decorate your application!

Vote for this sample

Flash is Better! (310 votes)
Silverlight is Better? (271 votes)

Comparison

Flash implementation: 70 minutes (Implemented First)
Silverlight implementation: 80 minutes
What’s the difference?

  • String to ASCII Code: charCodeAt [AS3] vs Convert.ToInt16 [C#]

Source codes

Flash

Silverlight

String to ASCII Code: charCodeAt [AS3] vs Convert.ToInt16 [C#]

When you are working with text, you shouldn’t miss out the following following codes which convert a string value and ASCII code.

// AS3
var text:String = "Testing";

// Get the ASCII code for the character "T"
text.charCodeAt(0)

// Get the string value of the ASCII code 80
var char:String = String.fromCharCode(10);

In C#, you can achieve the same result by using the System.Convert Class.

// C#
String text = "Testing";

// Get the ASCII code for the character "T"
Convert.ToInt16(text.ToCharArray()[0]));

// Get the string value of the ASCII code 80
String char = Convert.ToChar(80).ToString();
Sep 19

Carousel is a very hot effect among Flash and Silverlight. Although there are many readily available Carousel Class on the web, you may still want to explore the Mathematics behind. That is! Here is an example for your reference.

I will add a drill down effect to extend the functionality of the Carousel.

Vote for this sample

Flash is Better? (550 votes)
Silverlight is Better? (550 votes)

Comparison

Flash implementation: 20 minutes
Silverlight implementation: 40 minutes (Implemented First)
What’s the difference?

  • Development IDE: FDT - Flash Development Tools [AS3] vs Visual Studio 2008  [C#]

Source codes

Flash

Silverlight

Development IDE: FDT - Flash Development Tools [AS3] vs Visual Studio 2008  [C#]

Today, I am going to talk about my working environment.

If you are Flash Developer, I think you will understand that it’s completely impossible to use Flash 9 as your coding tool. You will just like working as if using Notepad. Anyway, I am currently using a Eclipse plug-in FDT as my primary Development Tool. The reason I choose this one is because it has a very good library management and also the code completion feature.

Of course, Flex also provide the same features. However, Flex is an extensive tool which always takes up a lot of computer resources. Hence, the speed is much slower.

image

For Silverlight, I think you don’t have much choice other than using Visual Studio 2008. But you may not know that I did not use Blend for creating any of the samples in this Blog. The reason is very simple. I still haven’t installed the Blend.

image027

Sep 04

A stunning effect with a laser orbiting around the mouse! In this example, it demonstrated the difference in dispatching Event between AS3 and C#.

It included both Flash and Silverlight versions with complete source codes.

Comparison

Flash implementation: 45 minutes 
Silverlight implementation: 1 hour 
What’s the difference?

  • Event Dispatch: dispatchEvent(Event.COMPLETE) [AS3] vs EventHandler Completed [C#]

Source codes

Flash

Silverlight

dispatchEvent(Event.COMPLETE) [AS3] vs EventHandler Completed [C#]

In AS3, dispatching an event is easy and you can dispatch an event with any name you like. It enables you to manage the state of the object easily. However, you Class will go messy if you didn’t manage it well. Besides, bubbling an event is very simple, too.

// AS3
// add the event handler
this.addEventListener("ANY_EVENT_NAME", on_complete);

// dispatch the event (using any Event Name you like)
dispatchEvent(new Event("ANY_EVENT_NAME"));

// event handler
function on_complete(e:Event):void{
	// do something here
}

// bubbling event, the event will bubble up through the
// display object tree list until it reach the root
dispatchEvent(new Event("ANY_EVENT_NAME", true));

While in C#, the style is different than that in AS3. If you want to define your own event, you have to define the EventHandler variable first. For event bubbling, it is much more complicated than AS3. (I need to study this more before talking about this.)

// C#
// eefine the event
public event EventHandler Completed;

// add the event handler
Completed += new EventHandler(this_Completed);

// dispatch the event
Completed(this, new EventArgs());

// event handler
void this_Completed(object sender, EventArgs e)
{
	// do something here
}