from flash to silverlight: a rosetta stone

12
From Flash to Silverlight: A Rosetta Stone Rick Barraza Experience Architect Cynergy Systems

Upload: goodfriday

Post on 12-Dec-2014

224 views

Category:

Documents


2 download

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

Page 1: From Flash to Silverlight: A Rosetta Stone

From Flash to Silverlight: A Rosetta StoneRick BarrazaExperience ArchitectCynergy Systems

Page 2: From Flash to Silverlight: A Rosetta Stone

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...

Page 3: From Flash to Silverlight: A Rosetta Stone

#1: See Bob run.

The Helvetica of Easing Equations

demo

Page 4: From Flash to Silverlight: A Rosetta Stone

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?

Page 5: From Flash to Silverlight: A Rosetta Stone

#2: To each their own.

User controls that govern themselves

demo

Page 6: From Flash to Silverlight: A Rosetta Stone

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?

Page 7: From Flash to Silverlight: A Rosetta Stone

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

demo

Page 8: From Flash to Silverlight: A Rosetta Stone

Post MortemTake away points

System.Windows.Interop.ContentLooping through the children

foreach (dot d in balls.Children)Questions?

Page 9: From Flash to Silverlight: A Rosetta Stone

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

demo

Page 10: From Flash to Silverlight: A Rosetta Stone

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?

Page 11: From Flash to Silverlight: A Rosetta Stone

© 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.

Page 12: From Flash to Silverlight: A Rosetta Stone