Silverlight vs Flash: Kaleidoscope Silverlight vs Flash: Mathematical Locus
Sep 17

This is a very simple rotator with flip effect. You may further customize it by modifying the scaleY and rotation as well.

Personally, I really like making image rotator since I always got many ideas on the transition effect. I hope I can implement as many as possible.

Comparison

Flash implementation: 50 minutes (Implemented First)
Silverlight implementation: 30 minutes
What’s the difference?

  • Remove Children: removeChildAt [AS3] vs Children.RemoveAt[C#]

Source codes

Flash

Silverlight

Remove Children: removeChildAt [AS3] vs Children.RemoveAt[C#]

In AS3, you have to be very carefully about null object, especially adding/removing object to the child. Otherwise, you may got into error troubles.

// AS3
// Create a triangle mask
var sprite:Sprite = new Sprite();
// ok
addChild(sprite);	

// also ok, the sprite will be added to the end of the display list
addChild(sprite); 

// will throw an error
addChild(null);	

// ok
removeChild(sprite);

// will throw an error
removeChild(sprite);	

// the best practise
if(sprite && contains(sprite){
	removeChild(spirte);
}

// remove all child
while(numChildren > 0){
	removeChildAt(0);
}

In C#, it will only throw exception for Add operation. On the other hand, the Remove function will only return a flag indicating whether the action is successful.

// C#
Rectangle rectangle = new Rectangle();

Children.Add(rectangle);

// throw an ArgumentNullException
Children.Add(rectangle);

// throw an ArgumentNullException
Children.Add(null);

// return true
Children.Remove(rectangle);

// return false
Children.Remove(null);

// remove all child
while(Children.Count > 0){
	Children.RemoveAt(0);
}

Shares and Enjoy~

Did you like this post?

Subscribe here:  

11 Responses to “Flash vs Silverlight: Flip Rotator”

  1. Silverlight Cream for September 16, 2008 -- #369 Says:

    [...] Flash vs Silverlight: Flip Rotator [...]

  2. Silverlight: 3D Image Rotator Beta using Kit3D Says:

    [...] (This sample is similar to my previous post “Flip Rotator“. You may take a look as [...]

  3. marco Says:

    no comment

  4. New Silverlight Image Rotators · News Says:

    [...] Flip Rotator [...]

  5. brenda Says:

    Nice posts. Keep it up.

  6. paul Says:

    If I wanted to substitute canvasses made with Expression Blend instead of jpgs, I would delete
    private String[] IMAGES = { “images/image1.jpg”, “images/image2.jpg”, “images/image3.jpg” };

    But I am not sure how to finish the substitution. Any suggestions?

  7. mujtaba Says:

    how can i use these sample on my .aspx page?

  8. Tyree Bundick Says:

    Often the top practises are trivial and very easy to implement in business or even lifestyle, on the other hand occasionally issues usually are a bit more difficult and have to have qualified assistance.

  9. depression treatment Says:

    Thank you for this put up, I’ve been at all times looking for this convenient articels all over the place but could not discover complete information provided here. thank you. and I’ll just reference some of you phrases .

  10. Flash vs Silverlight Gallery « Tam Quang Blog Says:

    [...] Flash Silverlight Download [...]

  11. Flip Your Text|Flip Text|Upside Down Writing Says:

    It?s really a nice and helpful piece of information. I am glad that you simply shared this helpful info with us. Please stay us up to date like this. Thank you for sharing.

Leave a Reply