jump to navigation

Set movieclip default properties in flash June 26, 2008

Posted by sdpurtill in : Flash, ActionScript , add a comment

I had to write a function to reset any movieclip in Flash. It’s very simple — you have an array with all the default properties you want to have in the reset. Then you pass any movieclip to the setDefaultProperties function to set the defaults. Now whenever you want to reset the movieclip, just pass it as the first parameter to resetMovieClip.

Done.


var aDefaultProps:Array = new Array('_width', '_height', '_x', '_y', '_alpha');


function setDefaultProperties(mMovieClip:MovieClip):Void {
  for(sProperty in aDefaultProps) {
    mMovieClip['default' + aDefaultProps[sProperty]] = mMovieClip[aDefaultProps[sProperty]];
  }
}


function resetMovieClip(mMovieClip:MovieClip):Void {
  for(sProperty in mMovieClip) {
    if (sProperty.substr(0, 8) == 'default_') {
      mMovieClip[sProperty.substr(7)] = mMovieClip[sProperty];
    }
  }
}

The greatest Flash site ever made January 10, 2007

Posted by sdpurtill in : Flash, ActionScript , add a comment

For two years now, this site has topped my all time greatest-Flash-sites list. Yes, it was even built before Flash 8’s alpha channel.

And I am still amazed every time I go to it.

Solve this December 6, 2006

Posted by sdpurtill in : Life, ActionScript , add a comment

And you’re a GENIUS…. Well, not really.

var age:Number = 17;
age++;
trace(age);

Hahahaha… I miss Flash.

Anyways, if you didn’t get it, I’m OFFICIALLY 18 years old.

:D

Soft Launch of 1221 Youth October 6, 2006

Posted by sdpurtill in : Flash, ActionScript , add a comment

Ladies and gentlemen… 8 months in the making… [drumroll]

The new 1221 site is here! 1221youth.com

I am still adding content, but it has a large backend so that any admin can go in and add anything they want, at anytime, anywhere.

Check out the pics on Flickr

Coding for 1221 is DONE!!! September 15, 2006

Posted by sdpurtill in : Flash, ActionScript , add a comment

I have just written the last hundred lines of code for the site… And I am

FINISHED

And now I’m headed off to In N Out to get a Cheeseburger animal style, Fries, and a water with lemons to celebrate. Yee yee yee!

My list of the best Flash books ever September 1, 2006

Posted by sdpurtill in : Books, Flash, ActionScript , add a comment

It’s nearly impossible to find a list of Flash books for developers trying to learn it; but here is a compilation of my favorites over the last four years.

  1. ActionScript for Flash MX: The Definitive Guide (Colin Moock) – this book was written for MX, but is the ultimate language reference. He is working on an update for Flash 9 and ActionScript 3.0
  2. Essential ActionScript 2.0 (Colin Moock)
  3. Object Oriented ActionScript (Peter Elst and Todd Yard)
  4. Design Patterns – Elements of Reusable Object-Oriented Software (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides)
  5. Flash Remoting: The Definitive Guide (Tom Muck)
  6. Programming Flash Communication Server (Brian Lesser)

I tried to put it in order. There you go.