Archive for the 'ActionScript' Category

Speeding up your code with the Bitwise Operator (&)

Tuesday, March 28th, 2006

While building a Flash game, I wrote some code to alternate through squares on a grid system and it seemed rather slow. My code made use of the % (modulo) operator and, thinking that was the cause, I went in search of a better solution. I blew the dust off the Bitwise operator (&) and researched what it actually does. As it turns out, this little bit of programming’s past can be quite handy.

Comments & corrections are always welcome and if you have any similiar tricks to share, I’d love to hear about them.

Du You?

Sunday, January 29th, 2006

I built this popular game in Flash 8 for a brain exercise before I had ever actually played it. I did no research and when I completed the code, I played it once to test it out. I can see how it could become very addictive.

Holiday Greetings & Games

Monday, December 19th, 2005

This has been one crazy Fall work-wise, so I apologize for the scarcity of posts, but I do have a few holiday treats for you.

From my day job at Cronin and Company, we’ve got Cronin’s “Grab Bag of Goodness.” As with most internal projects, this was a major rush job. I take no credit for the design (which was handed to me with no wiggle room), but when it comes to the CSS and DOM Scripting, that I’ll proudly take credit for. Use the code “9301” to get in. Of particular note in this piece:

  • Taking a page from Dan’s Bulletproof Logos, most all of the text is in (shock) images. Toss in the text as an alt attribute and with images and CSS off, you’re still golden. As this was a one-off, sIFR seemed like overkill.
  • Ooh, check out that marquee. Brings back memories, doesn’t it. Well, this one’s a little different. The markup is an ul and each item is a li. CSS makes it all display: inline; and then JavaScript keeps reducing the margin-left of the first li by 2px until the absolute value of it’s margin-left is greater than the li’s width. That li is then plucked from the front of the list and appended to the end. Though I am not a big fan of scrolling marquees, this was a pretty fun experiment.
  • Those animated icons you can click to make a donation are actually form controls. Originally, I had made them into custom submit inputs, but Safari’s inability to customize certain form controls made me abandon that element in favor of button. It’s a great effect too (IMHO).

Then there’s the Easy Designs holiday card. I will spare the commentary on this one with the exception of giving major props to Dave for building the game in a day. I’m pretty darn proud of it, especially since we pretty much went from concept to execution in a matter of days (yeah, procrastination’s a bitch). If you’re interested, you can see a rough approximation of the email that went out (our first Campaign Monitor mailing) or simply play the game.

Dave’s Work Draws a Crowd

Tuesday, November 29th, 2005

I just saw a copy of the latest issue of DMNews and Dave’s hard work garnered the Wadsworth Atheneum a feature story and Cronin and Company some major kudos. Here’s an excerpt from the article:

An online campaign initiated by the 161-year-old museum and developed by Glastonbury, CT, ad agency Cronin and Company Inc. doubled visits to the site at www.wadsworthatheneum.org. Components included a SurrealPainter Web tool, banner ads and the seeding of blogs.

Central to the campaign is the tool at www.wadsworthatheneum.org/painter. Visitors through Dec. 18 can choose from various colorful backgrounds and objects, then flip, copy, layer or scale them. Once completed, the online artwork can be titled, printed, published and e-mailed to family and friends.

Be sure to make your own surrealist painting, while you still can.

Today’s chosen site: Canadian Pharmacy

Macromedia Overload

Monday, October 17th, 2005

Ever think you just can’t keep up with all the new technologies, scripts, applications, etc.? Truck loads of reading on the “new” best practices? You work all day, most the night, and on weekends. You’re spouse is ready to kill you, but, like being hooked on a very powerful drug, you just can’t stop… Ahhhh. I could go on, but I am sure a lot of you know where I am coming from.

Ahem, anyway, to my point. Macromedia just recently launched Flash 8 with a boat-load of new ActionScript features that are very exciting. I am torn between my daily PHP, CSS, HTML, SQL duties, contemplating getting into Rails, reading another chapter of my Flash Math Creativity book and staying up late learning the new Flash stuff and then Macromedia deals the final blow. This looks totally amazing and I can’t wait to get my hands on it.

I am gonna OD for sure and self combust. Nighty night.