Archive for the 'Flash' Category


Sunday, August 17th, 2008

Ladies and Gentlemen, We Have a Brand New POP Site

It's important to find some time to focus on yourself, look at your brand, think about how well you're telling your story.

We did that at POP. We have a new website as a result.

A great many people worked vigorously to make this happen and I thank them for their extraordinary efforts.

POP Homepage - Target

POP Homepage - Target

POP Homepage - Amazon

POP Homepage - Amazon

POP Homepage - Nintendo

POP Homepage - Nintendo

POP / Work

POP / Work

POP / Work / Brown-Forman

POP / Work / Brown-Forman

POP / Careers / Flash / ActionScript Developer

POP / Careers / Flash / ActionScript Developer

Posted in Design, Flash, Portfolio




Thursday, July 24th, 2008

10 Essential Adobe Flash Links

Adobe Flash Player Version Penetration

Worldwide Ubiquity of Adobe Flash Player by Version

http://www.adobe.com/products/player_census/flashplayer/version_penetration.html


Adobe Flash Player Version Check

You need to know what version you're running, and so do your testers. Sharing this link is an easy way to get people to upgrade.

Under "Adobe Flash Player" roll over "About"

About Flash Player

http://www.adobe.com/shockwave/welcome/


Archived Flash Players Available for Testing Purposes

You can download archived Adobe Flash Players from the Adobe website. The archived versions are available specifically for Flash developers who are assessing their sites from the perspective of users with earlier versions of Flash Player.

http://www.adobe.com/go/tn_14266


ActionScriptCheatSheet

Adobe Flex Language Reference Cheatsheets. Adobe AIR Language Reference Cheatsheets. ActionScript 3.0 Language Reference Cheatsheets. Papervision3D API Cheatsheets.

http://www.actionscriptcheatsheet.com/


SWFObject

SWFObject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file.

http://code.google.com/p/swfobject/


SWFAddress

SWFAddress is a small, but powerful library that provides deep linking for Flash and Ajax.

http://www.asual.com/swfaddress/


TweenLite

A Lightweight (3K) and FAST Tweening Engine

http://blog.greensock.com/tweenliteas3/


Lee Brimelow's The Flash Blog

Lee is a Platform Evangelist at Adobe focusing on the Flash, Flex, and AIR developer communities, and his site is required reading.

http://theflashblog.com/


[ draw.logic ]

draw.logic is a great blog to help you keep up with actionscript-related releases and issues.

http://drawlogic.com/


... and ActionscriptAPIs

ActionScriptAPIs is an up to date resource tracking AS3 and AS2 application programming interfaces for Flash/Flex/AIR designers and programmers... and it's mine. I've been wanting to set this up for a while and thanks to Godaddy, Tumblr and a few spare hours another tiny site is born.

http://actionscriptapis.com/


Posted in Flash, Notes




Thursday, July 10th, 2008

Ubisoft’s Brothers in Arms - Hell’s Highway

We launched the complete Brothers in Arms - Hell's Highway site for Ubisoft and Gearbox a few days ago and the response has been extremely positive. The team at POP focused on creating a rich and deep experience that conveys a reverence for the actual event BIA-HH is based on, 1944's Operation Market Garden.

One special section to note is the Timeline; a piece of premium content you don't typically see in a gaming site. Our Operation Market Garden Timeline covers each day of the operation with detailed descriptions, images from John Antal's book, maps, and exclusive historical video.

Brothers in Arms - Hell's Highway

Story Section

Brothers in Arms - Hell's Highway

Weapons

Brothers in Arms - Hell's Highway

Characters

Brothers in Arms - Hell's Highway

Characters Detail

Brothers in Arms - Hell's Highway

Timeline

Brothers in Arms - Hell's Highway

Timeline Exclusive Video

Posted in Design, Flash, Portfolio




Thursday, February 28th, 2008

FWA Site of the Day: Professor Layton and the Curious Village

Professor Layton and the Curious Village

I'm proud to announce that Professor Layton and the Curious Village has won the FWA Site Of The Day Award for February 28th, 2008.

Many thanks to the FWA judges, the fine folks at Nintendo, and the entire POP team.

FWA (Favourite Website Awards) is an industry recognised award program, established in 2000, showcasing websites who use cutting edge technology, together with inspirational ideas, that lead the way for future generations.





Saturday, December 29th, 2007

Papervision 2.0 BorgEffects - Flash Version

Papervision 2.0 BorgEffects Flash Version

Yesterday I snagged Andy Zupko's super-amazing BorgEffects download which demos his new Effects branch for Papervision 2.0. It's very exciting stuff!

Since I'm not a big-time Flex user, I converted his borgEffects.as for use in the Flash IDE and decided to make it available for download. I thought it might be helpful to those struggling with Flex to Flash conversions.

Of course, I couldn't resist making a few changes by just messing around;

randomly changing the colorTransform settings onClick

using a different texture

changing the clippingPoint

etc...

To highlight the Flex to Flash diffs, I've commented my BorgEffects_flash.as like so:

  1. // the FLEX WAY
  2. //dae.load(XML(new shipAsset()), mats);
  3. // the FLASH WAY
  4. dae.load("cube.dae", mats);

To make it all hum, you'll need the latest build from the Papervision respository and be sure to point the BorgEffects_flash.fla Actionscript 3.0 Classpath to the class files in /branches/Effects/src.

Download the source files and have fun.

EDIT: I'm not sure exactly which revision of Great White this demo used, but since 2007 I'm sure a lot has changed. Proceed with caution!

Posted in Articles, Design, Flash, Notes




Sunday, October 21st, 2007

Talking to Twitter via Actionscript 3.0

LATEST UPDATE: Twitter modified their crossdomain policy, which put an end to my flash fun... In other words, this doesn't work anymore the way I wrote it and I don't wanna spend any time updating it! *sigh*

I rewrote the myTweets AS2 flash badge using AS3 and I thought it might be a good idea to share the code and source files. (Links at the end of the post.)

I'd like to focus on a few items that caused me a few minor headaches here and there in hopes of saving others the trouble. When you can't find an answer in flash's documentation or in Moock's Essential Actionscript 3.0, google it and you'll probably find what you're looking for.

Let's get started.

Don't forget your imports

New calls requires new imports that you may not be familiar with. For example, getting an url requires code within the flash.net framework. It could be easy to overlook, so keep your eyes open. Here's my list for this project:

  1. import fl.transitions.Tween;
  2. import fl.transitions.easing.*;
  3. import flash.display.*;
  4. import flash.events.*;
  5. import flash.net.*;
  6. import flash.ui.*
  7. import flash.utils.*

Calling a function that requires an EVENT

When the stage resizes, I have an event listener attached to the stage that calls resizeHandler. The resizeHandler function appears to require an EVENT as an argument... but I want to fire it immediately when my swf loads to position my clips on the stage... and I don't want to create another event to do this. What to do?

The event listener:

  1. stage.addEventListener(Event.RESIZE, resizeHandler);

The resizeHandler function:

  1. // RESIZER
  2. private function resizeHandler(event:Event):void {
  3. //trace("resizeHandler: " + event);
  4. //trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
  5. myBtn.x = int((stage.stageWidth/2)-(myBtn.width/2));
  6. myBtn.y = int((stage.stageHeight/2)-(myBtn.height/2));
  7. textBox.x = myBtn.x;
  8. textBox.y = myBtn.y;
  9. loadImg.x = myBtn.x+300;
  10. loadImg.y = myBtn.y+102;
  11. dateTxt.x = myBtn.x+11;
  12. dateTxt.y = myBtn.y+135;
  13. };

The answers turn out to be super simple. I just pass null as an argument and resizeHandler accepts that.

  1. resizeHandler(null);

Customizing the right-click context menu

What hung me up on this one was how to attach the context menu to the stage, as opposed to an object on the stage. With all of the new syntax swirling around it's hard to know what's acceptable and what's not. Root, stage, this... In the end, line 43 did the trick. Good 'ole reliable "this."

  1. // create the context menu, remove the built-in items, add our custom items
  2. var newCM:ContextMenu = new ContextMenu();
  3. newCM.addEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuHandler);
  4. newCM.hideBuiltInItems();
  5. var link1:ContextMenuItem = new ContextMenuItem("Visit DaveCurry.net" );
  6. link1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, grabLink1);
  7. newCM.customItems.push(link1);
  8. var link2:ContextMenuItem = new ContextMenuItem("Visit Twitter");
  9. link2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, grabLink2);
  10. newCM.customItems.push(link2);
  11. this.contextMenu = newCM;
  12.  
  13. function onContextMenuHandler(event:ContextMenuEvent):void {
  14. event.target.customItems[0].enabled = true;
  15. event.target.customItems[1].enabled = true;
  16. }
  17.  
  18. // contextMenu link1
  19. function grabLink1(event:ContextMenuEvent) {
  20. var myRequest:URLRequest = new URLRequest("http://www.davecurry.net");
  21. navigateToURL(myRequest);
  22. }
  23.  
  24. // contextMenu link2
  25. function grabLink2(event:ContextMenuEvent) {
  26. var myRequest:URLRequest = new URLRequest("http://www.twitter.com");
  27. navigateToURL(myRequest);
  28. }

Using FlashVars with AS3

This one is huge. At work, we rely on FlashVars to make our projects more dynamic. When you're working with CMS and you need to tell your flash object a few things... you can't beat 'em.

Here's how I ended up coding for FlashVars in AS3. They're not as integrated as before, but we accept that and move on.

First I want to check for their existence. If found, I populate the variables with the values defined in FlashVars.

If FlashVar values are not found, I declare them in my code so my swf won't break. Breaking is no good.

  1. // sort FlashVars
  2. var keyStr:String;
  3. var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
  4. for (keyStr in paramObj) {
  5. // sort flashVars
  6. if (keyStr == "userID") { userID = String(paramObj[keyStr]); }
  7. if (keyStr == "totalTweets") { totalTweets = Number(paramObj[keyStr]); }
  8. if (keyStr == "timerTweets") { timerTweets = Number(paramObj[keyStr]); }
  9. if (keyStr == "tweetColor") { tweetColor = Number(paramObj[keyStr]); }
  10. if (keyStr == "dateColor") { dateColor = Number(paramObj[keyStr]); }
  11. }
  12.  
  13. // if no FlashVars are found - define values
  14. if (userID == null) {
  15. userID = "1905521";
  16. totalTweets = 5;
  17. timerTweets = 5;
  18. tweetColor = 0x000000;
  19. dateColor = 0x000000;
  20. }

Consuming the XML

In AS2, XML is a no-brainer. I've been using the same chunk of foolproof code forever, and now I have to think about it? No problem, it's covered.

For the XML Twitter returns, I want to loop through and grab some of the data to define a few variables with, and some of the other data I'll push into arrays.

The XML I'm hitting is this:
http://twitter.com/statuses/user_timeline/1905521.xml

Here's a chunk of that XML from the top:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <statuses type="array">
  3. <status>
  4. <created_at>Sat Oct 20 22:56:39 +0000 2007</created_at>
  5. <id>351115132</id>
  6. <text>I need to go buy the Orange Box.</text>
  7. <source>im</source>
  8. <truncated>false</truncated>
  9. <user>
  10. <id>1905521</id>
  11. <name>Dave Curry</name>
  12. <screen_name>DaveCurry</screen_name>
  13. <location>Seattle, WA</location>
  14. <description>Dave Curry is an award-winning technical creative director and flash developer at POP, a strategic interactive agency in Seattle.</description>
  15. <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/33089582/darthcurry_square_normal.jpg</profile_image_url>
  16. <url>http://www.davecurry.net</url>
  17. <protected>false</protected>
  18. </user>
  19. </status>
  20. <status>
  21. etc...

To loop through, I'll use "for each" within specific nodes. First in the user data for the imageURL and screenName, and again in the status for everything else, including the tweets themselves.

I should note that this section gets kinda long because I'm rebuilding the date Twittered into a more readable string.

  1. myXML = new XML(myLoader.data);
  2. // run through it
  3. for each (var user:XML in myXML.status.user) {
  4. // grab image
  5. if (imgURL == "") { imgURL = user.profile_image_url[0]; }
  6. // grab screen name
  7. if (screenName == "") { screenName = user.screen_name; }
  8. };
  9. for each (var tweet:XML in myXML.status) {
  10. // populate tweets
  11. twtArray.push(tweet.text);
  12. // populate tweet ids
  13. idsArray.push(tweet.id);
  14. // populate created_at
  15. var t:String = tweet.created_at;
  16. // format date
  17. // remove the junk at the end
  18. var tempDate:Array = t.split(" +");
  19. //trace(tempDate)
  20. // now spilt it apart again
  21. var splitDate:Array = tempDate[0].split(" ");
  22. // now split apart the military time
  23. var splitTime:Array = splitDate[3].split(":");
  24. // factor in the offset
  25. var myHour:Number = splitTime[0];
  26. // determine AM or PM
  27. var amPm:String;
  28. int(myHour) >= 12 ? amPm = "PM" : amPm = "AM";
  29. // fix hour
  30. if (myHour < 0) { myHour+=12; }
  31. myHour > 12 ? myHour = myHour-12 : myHour = myHour;
  32. // now put it all back together again
  33. var myDate:String = String(splitDate[0]+" "+splitDate[1]+" "+splitDate[2]+" at "+myHour+":"+splitTime[1]+" "+amPm+" GMT");
  34. dteArray.push(myDate);
  35. };
  36. //trace("done");
  37. //trace("imgURL = "+imgURL);
  38. //trace("screenName = "+screenName);
  39. //trace("twtArray = "+twtArray);
  40. //trace("idsArray = "+idsArray);
  41. //trace("dteArray = "+dteArray);

...and you can see that I have a great affinity for the trace function.

getURL is dead, long live URLRequest

This didn't really hang me up, but it is worth noting that you have to specifically activate a movieClip with buttonMode to use it as a button.

  1. // activate the button
  2. myBtn.buttonMode = true;
  3. myBtn.addEventListener(MouseEvent.CLICK, grabURL);

Once you've activated your movieClip and you've created an event listener to handle a mouse click, you're ready to create your URLRequest.

  1. private function grabURL(event:MouseEvent):void {
  2. var myRequest:URLRequest = new URLRequest("http://twitter.com/"+screenName+"/statuses/"+currentID);
  3. navigateToURL(myRequest);
  4. };

That's it, the rest was pretty easy to switch over.

You can grab the source files here and you can see it embedded fullscreen here.

BTW, I didn't use the Twitter flash api that Twitter has on their site because I prefer XML to JSON.

Posted in Articles, Design, Flash




Sunday, October 14th, 2007

Zelda Phantom Hourglass Site

The Legend of Zelda - Phantom Hourglass

Zelda launched a few weeks ago and we continue to get great feedback on the site. Creating for Zelda is an honor and a treat, and being such big fans of the franchise certainly makes our job easier. I just finished the game the other day and really enjoyed the new controls. The stylus is indeed mightier.

Posted in Design, Flash, Portfolio




Sunday, October 7th, 2007

myTweets Twitter Flash Badge

UPDATE: Twitter modified their crossdomain policy, which put an end to the flash fun. In other words, this doesn't work anymore. *sigh*

I wanted a Twitter badge for my site and Twitter is so easy to work with that I decided to whip one up that anyone can use.

The myTweets flash badge displays up to twenty of your public timeline tweets and offers a few customization options via flashVars.

var so = new SWFObject("myTweets.swf", "myTweets", "100%", "100%", "8", "#333333");

so.addVariable("userID", "1905521");

so.addVariable("total", "10");

so.addVariable("timer", "8");

so.addVariable("dateHex", "0xEAEAEA");

so.write("flashcontent");

bgcolor - via the embed

userID - mine is 1905521

total - total number of tweets you want to display, up to 20

timer - time between tweets in seconds

dateHex - color of the date Twittered text

The example above is at http://davecurry.net/myTweets/.

If you'd like to put myTweets on your site, here's a zip of the example.

Update: I've written an AS3 version too. Check out Talking to Twitter via Actionscript 3.0 for more info and source files.

Posted in Articles, Flash