from flash to silverlight: a rosetta stone

Post on 12-Dec-2014

224 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Come learn how Cynergy Systems has been translating skills in Flash/Flex development to Microsoft Silverlight 2 with an eye for great design. Learn how to create custom animation techniques, apply popular Flash tricks to Silverlight, and more.

TRANSCRIPT

From Flash to Silverlight: A Rosetta StoneRick BarrazaExperience ArchitectCynergy Systems

Lost in TranslationTag based animations vs. Procedural Code

What we’re going to go overWe will start where tag based animations end.Dynamically creating visual elements.How to manipulate them with C# as painlessly as possible.

We’re going to jump straight into code...

#1: See Bob run.

The Helvetica of Easing Equations

demo

Post MortemTake away points

Using a dynamic storyboards as your onEnterFrame

If ( count++ < killSwitch) sb.Begin();Using a UserControl as a MovieClip

Adding that X and Y property is a life saver.

The Easing Equationbob.X += (mouse.X – bob.X)*.12;

Questions?

#2: To each their own.

User controls that govern themselves

demo

Post MortemTake away points

There is no removeMovieClip() equivalent from inside the userConrol.

(this.Parent as Canvas).Children.Remove(this);

Pro’s and Con’s of this approachLook into registering events up to the parentQuestions?

#3: One function to rule them all.An alternate approach to group animations

demo

Post MortemTake away points

System.Windows.Interop.ContentLooping through the children

foreach (dot d in balls.Children)Questions?

#4: Where did my Downloader go?Recent changes in loading images

demo

Post MortemTake away points

WebClient and the BitmapImageSkip the WebClient for fast and easy

Uri URI = new Uri(fileName, UriKind.Relative);BitmapImage bi = new BitmapImage(URI);

Questions?

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

top related