Archive for the 'AS3' Category

One Race Wear

Thursday, September 18th, 2008 by Thomas

We’ve just completed the development of the One Race Wear microsite for our friends Bionic Systems and their client One Industries.

Bionic Systems were responsible for the project and art direction, we added our Flash treatment:

One Race Wear

Flash loading and browser cache test-suite

Thursday, July 10th, 2008 by Thomas

As a little homage to our most popular and seemingly helpful blog post about the Nasty XML load bug in Internet Explorer I created an app that tests the caching behavior of the browser it’s running in.

To recap - Loading XML files in Flash over an SSL Connection in Internet Explorer fails if the “Pragma: no-cache” or “Cache-Control: no-cache” HTTP headers are set in the server’s response.
In AS2 the loading failed silently, in AS3 we at least get an IO Error #2032, which has been discussed several times (see below)

If you want to keep the browser from caching your dynamic content you’ll have to use other means.
Judging from my tests, the best headers to prevent caching without causing errors in IE are: “Cache-Control: no-store” and/or “Expires: Thu, 01 Jan 1970 01:00:00 GMT”.

You can access the test suite here:

Set the headers that you’d like the server-script to return and find out what happens when the same request is sent twice after each other.
Use the Live HTTP Headers Plugin for Firefox if you’d like to see what the server actually returns.

Other interesting insights

  • The problem still exists in Internet Explorer 7! Don’t know about Vista…
  • Here it’s suggested that “Cache-Control: must-revalidate” and “Cache-Control: max-age=0″ also work. While that’s true in the sense that they don’t cause an error IE, they don’t seem to prevent caching 100% - there is a timeout.
  • “Pragma: no-cache” causes the error in IE, but doesn’t actually prevent it from caching at all when it’s set on a non-ssh connection.
  • Firefox internally sets the expiry date of script files to the past - so unless you set the “Expires” header to the future it’ll never cache the content.
  • Safari and Firefox change their caching behavior when the “Last Modified” header is set. If it’s in the past they seem to be happy to cache the file for you.

PHP sessions

Note that in PHP, as soon as you use sessions with session_start() the no-cache headers are added automatically. You’ll have to replace those headers or turn the default behavior off in php.ini. To replace the headers (found in the comments of the original post, see also the session-cache-limiter function and comments):

session_cache_limiter(’public’);
session_start();
header (”Cache-Control: cache, must-revalidate”);
// or if you still want to prevent caching
header (”Cache-Control: no-store”);
header (”Pragma: public”);

Related links:

Red Bull Flugtag Flight Lab - Mini Hangar Widget

Tuesday, July 1st, 2008 by Carsten Schneider

As a practical add-on for our loyal Flight Lab users we created a mini hangar widget that users can embed on their blog, social platform profile etc.

We happily used Clearspring as the platform for our widget, just click “Get this and Share” and take it away. If you enter the e-mail address you registered with at Flight Lab, the widget display your own planes to show off your flight machine building skills.

Related Posts:
Red Bull Flugtag Flight Lab
Developing Flight Lab

Stofanel Investment AG

Saturday, May 10th, 2008 by Thomas

We’ve recently completed the website for the German/Italian property investment firm Stofanel Investment AG.

A subtle use of Flash and Papervision 3D creates an abstract, dreamy and atmospheric paper space to reflect the company’s vision of a harmonious relationship between nature, architecture, community and self.

The corporate identity we developed in collaboration with yippieyeah is based on botanic patterns (Phyllotaxy) as you would find in the growth patterns of sun flowers for example - it underlines the companies dedication to nature and community.

Regular readers will be pleased to find the site equipped with our usual technical treatment: fully dynamic, browser-button- and deeplink enabled (thanks to SWFAddress) and HTML-version for search engine optimization.

O2 The Memory Project

Tuesday, April 22nd, 2008 by Luis

Last Friday we launched the first part of The Memory Project, an online 3D image bank (made with PV3D) of the 21st century ‘cyclorama’ created by artist Jason Bruges.


Inspired by Bluebook, the artist Jason Bruges has created The Memory Project - a 21st century ‘cyclorama’. The structure camera-captures panoramic moments in time and stores them within its digital memory bank. Inside, visitors can explore the stored history of the installation and interact with the displayed 360 degree images.

The Memory Project tours in April 2008, collating the mass memory of London, Edinburgh and Liverpool en route. You can delve even deeper into these public memory banks at www.o2memoryproject.com from Friday 18th April 2008.


BBC NEWS: Life in London captured digitally

DESIGN WEEK: O2 to launch Bluebook installation by Bruges.

Red Bull Flugtag Flight Lab

Wednesday, February 20th, 2008 by Carsten Schneider

Bring on the wood and sheet metal! Break out your saw! Cut the pieces to size, assemble them, paint them and… voila! You’ve built your own airplane. Now it’s time to get it off the ground… will it fly…?

As of today, Less Rain’s new 3-D model application with integrated flight simulator, the Red Bull Flugtag Flight Lab, will be online, a 3-part game based on Red Bull’s Flugtag event.

Step One: The fuselage, wings and pitch elevator are cut out of Styrofoam, cardboard, wood or scrap metal. The pieces are then automatically assembled into a 3-D airplane. Material and shape will later play an important role in the machine’s flying properties.

Step Two: Customizing the parts. This can be done by uploading your own photos, designs and patterns or, alternatively, using brushes to paint the machine ‘by hand’. The results might be anything from a realistic looking airplane to an abstract flying artwork.

Step Three: The prospective pilot can test the quality of his custom-designed aircraft and its flying capabilities amidst stunning natural scenery in the 3-D flight simulator. The machine is launched from a floating launch pad using the arrow keys. First the wings beat softly then the plane takes off energetically into the big blue sky.

The goal now is to cover as much distance as possible. To achieve this, users may experiment with acrobatic maneuvers, collect cans of Red Bull to refuel and employ the thermal updrafts – but they must beware of the bumpy crosswinds!

Points are given after each flight for distance covered and piloting style. Loops, drifts, rolls, low-level flight and other maneuvers are rewarded. In addition, the other users rate the plane’s design. A total score is calculated which, if it’s good enough, may be included on a high score table.

Pilots can store their planes in a hangar where they can develop them further or try out new designs anytime. Another unique aspect of the game is that any user can take-off with any airplane and, what’s more, can change and improve it to their own tastes.

The back-end and user administration part of Flight Lab has been developed by Signal7, our partner of choice when it comes to enterprise level, tailor-made database solutions.

Related Links:
Red Bull Flugtag Flight Lab
Pilot avatar motion capture demo and the original Paperdude post
Signal7

Update:
We’re Site of the Day at the FWA! Cheers, Rob!

Update II:
We made it Site of the Month at the FWA! That’s just fantastic, thanks everybody at the FWA!

Update III:
Thank you UltraShock, for the BombShock Award! And we are Adobe Site of the Day for March 4th!

Continue reading: Developing Flight Lab

Public Service Anouncement:
WordPress decided to delete the original post. This is a re-post, meaning the original comments got lost. We’re sorry about that.

Developing Flight Lab

Wednesday, February 20th, 2008 by Patrick Juchli

At the beginning it’s always simple. “Everybody draw crazy airplanes and then fly them.” We wanted a fun experience, no boring modeling session, no nerdy flight simulation.

Just draw an outline, booom!, airplane wing

Flight Lab uses Papervision3D to show 3-D models and these models have to be created in a very specific way. Drawing an arbitrary free hand line is the opposite of that, you can draw everything, in any way. That’s why the Flight Lab builder has to do a lot of interpretations. Did you just draw a correction to an existing outline? Are there intersections? Can we simplify the outline while preserving its characteristic look so the Flash Player has less stuff to compute? Next, Flight Lab has to break up the shape into triangles because Papervision3D only understands models made out of triangles. At the end, we add thickness and create the final model by extruding the outline. We’re done! Now let’s head over to the game.

Fly like birds do and crash like airplanes

Flight Lab gives you the real thing: It’s a 6DOF (degrees of freedom) flight simulator modeled by a physics engine in 3D using rigid body dynamics. Real airplane wings can be described by specific lift and drag coefficients, depending on how quickly and from which angle the air flows over a wing section. That’s what Flight Lab does.

On the other hand you’re flying by flapping wings. The flying experience had to be as physical as possible using as few buttons as possible. So we put a bird into the simulator, added additional forces and offered the user the same control a bird has over its body – if it’s not a chicken. 4 keys, 2 optional keys and one space bar (hint!) oughta be enough for everyone.

Flying Pigs

The flight behaviour depends on the material you choose and the shape of the airplane. But to be honest, we ended up limiting this influence a little bit. As an aviation engineer you just have to design some things exactly the right way or the airplane won’t fly at all. Crazy airplanes can quickly become impossible to handle in a real flight simulator. However, we wanted people to create imaginative planes and fly them in our simulator even though they may never take off in the real world. So we decided on a compromise. Huge wings for example will do what you expect them to do but they can have any shape and any position. In the end though, a well engineered aircraft will still fly better and bring you more score points.

Hand-crafted, with a lot of love

The game itself has a lot of elements running at the same time and a lot of effort went into making this possible. Flight Lab is using Papervision3D 1.5 and builds on the efforts of a vivid open-source community. Nevertheless, there are limits when it comes to creating a game experience of this scale. Nearly every element you see in the game posed a significant problem of its own. Be it quality of graphics, a panorama, a water surface, airplane shadow, clouds, wind or general depth-sorting problems. And often something feasible turned out to be too slow in context. Game logic, stunt analysis, sound and physics simulation quickly add up.

paperdude

Guest Star

PaperDude! Of course you know him and he’s back big time. He will be acting as your avatar so treat him with respect. His body follows motion capture data from Lord of the Rings and Saturday Night Fever. Real time, baby!

Plus everything else

Next to all this fancy game and 3D stuff, Flight Lab is also a website which offers saving, browsing and sharing airplanes. It’s a Rich Internet Application in the true sense of the word and a site that supports deep linking and browser history. If you want your friend to play the game directly using a specific airplane, just send him the link in the browser address bar.

Flight Lab is a prominent example of what you can do today with Flash Player 9. It was a fun ride and we learned a lot. Let’s see what the future holds, the flying pigs are here to stay.

Job in Berlin - Flash Developer

Monday, December 17th, 2007 by Thomas

Update: This position has been filled. You are still invited to send us your CV, but please use the email address specified, and not the comments section.

We are looking for a versatile Flash developer for full-time employment in our Berlin office with a solid background in object oriented web development and experience in AS3. We are seeking a motivated and confident problem solver with an eye for interaction design and a passion for web technologies.

You will be working in an international team of experienced developers in Berlin, London and Tokyo. Your role involves working closely with our front-end designers and the developer team to implement projects ranging from mini-sites and virals to large scale consumer & corporate websites. You will be working on projects such as:

Requirements

  • 2+ years experience in Flash development
  • Solid AS2 and AS3 Skills (OOP)
  • Experience with Flash integration technologies (Dynamic content, XML, Webservices)
  • Bandwidth and performance-friendly coding
  • A feel for good interaction design and usability.
  • Experience in related technologies and APIs is an advantage (i.e. Papervision 3D, Facebook API, Java, PHP)
  • English speakers are welcome

Less Rain is a digital design agency based in London, Berlin and Tokyo. We work independently & across 3 offices, in a multicultural team. Our services are aimed at producing sophisticated, concept driven, tailor made solutions for online communication, ranging from corporate to consumer websites, interactive content creation and online games, from the local to the international. Our client list includes Red Bull, BBC, Getty Images, Stockland Martel, Nike, Mitsubishi, Sega, Panasonic, Volkswagen.

Salary is negotiable dependant on experience.

We’re looking forward to your informative application via e-mail, including a CV and links to recent projects you developed. Please send your application to Thomas Meyer, bewerbung@lessrain.com

For further information about Less Rain visit:

http://www.lessrain.com

http://blog.lessrain.com

Flash: FIVe3D

Friday, October 12th, 2007 by Luis

The FIVe3D initiative is an open source code for the conception of interactive vector-based 3D animations developed by Mathieu Badimon.

The classes are written in ActionScript 2.0 and based on the ActionScript 3.0 structure. The FIVe3D system imitates a classicActionScript 2.0 MovieClip organization and provides extra 3D functionnalities.

Worth to take a look.

Related Links:

onReleaseOutside: AS3 Button Engine revisited

Saturday, September 22nd, 2007 by Luis

A few months ago I wrote a post with a solution to the missing onReleaseOutside event in AS3.

Unfortunately the post has disappeared completely while upgrading some wordpress plugins.

Here there is a resume of the post, a swf demo and the source code of the Button engine that allows you to set sprites as buttons very easily, with some additional events such onReleaseOutside, onRollOutWhileMouseDown, onRollOverWhileMouseDown and the ability to manage in a very natural and intuitive way all the Button Instances in your project.


Download src code.

Simple Usage:

Actionscript:
  1. package
  2. {
  3.     import com.lessrain.as3lib.utils.stage.TopLevel;
  4.     import flash.display.Sprite;
  5.     import com.lessrain.as3lib.controls.button.Button;
  6.     import com.lessrain.as3lib.controls.button.ButtonEvent;
  7.     import com.lessrain.as3lib.controls.button.ButtonList;
  8.     import com.lessrain.as3lib.controls.button.ButtonListEvent;
  9.  
  10.     public class Test extends Sprite
  11.     {
  12.         private var _myButton : Button;
  13.         private var _mySprite : Sprite;
  14.        
  15.         public function Test()
  16.         {
  17.             TopLevel.getInstance().stage = this.stage;
  18.             initialize();
  19.         }
  20.        
  21.         public function initialize():void
  22.         {
  23.             ButtonList.getInstance().addEventListener(ButtonListEvent.BUTTON_ADDED,buttonAddedToList);
  24.             ButtonList.getInstance().addEventListener(ButtonListEvent.BUTTON_REMOVED,buttonRemovedFromList);
  25.            
  26.             _mySprite   =  new Sprite();
  27.             _mySprite.graphics.beginFill(0x660000);
  28.             _mySprite.graphics.drawCircle(250,250,50);
  29.             _mySprite.graphics.endFill();
  30.            
  31.             addChild(_mySprite);
  32.            
  33.             _myButton   = new Button();
  34.            
  35.             _myButton.addEventListener(ButtonEvent.RELEASE,release);
  36.             _myButton.addEventListener(ButtonEvent.RELEASE_OUTSIDE,releaseOutside);
  37.             _myButton.addEventListener(ButtonEvent.PRESS,press);
  38.             _myButton.addEventListener(ButtonEvent.ROLL_OVER,rollOver);
  39.             _myButton.addEventListener(ButtonEvent.ROLL_OUT,rollOut);
  40.             _myButton.addEventListener(ButtonEvent.ROLL_OVER_WHILE_DOWN,press);
  41.             _myButton.addEventListener(ButtonEvent.ROLL_OUT_WHILE_DOWN,rollOutWhileDown);
  42.  
  43.             _myButton.initialize(_mySprite,'myID','myGroup',false,true);
  44.  
  45.         }
  46.        
  47.         private function press(event_:ButtonEvent):void
  48.         {
  49.             trace(String(event_.type));
  50.         }
  51.        
  52.         private function release(event_:ButtonEvent):void
  53.         {
  54.             trace(String(event_.type));
  55.         }
  56.        
  57.         private function releaseOutside(event_:ButtonEvent):void
  58.         {
  59.             trace(String(event_.type));
  60.         }
  61.        
  62.         private function rollOutWhileDown(event_:ButtonEvent):void
  63.         {
  64.             trace(String(event_.type));
  65.         }
  66.        
  67.         private function rollOver(event_:ButtonEvent):void
  68.         {
  69.             trace(String(event_.type));
  70.         }
  71.        
  72.         private function rollOut(event_:ButtonEvent):void
  73.         {
  74.             trace(String(event_.type));
  75.         }
  76.            
  77.         private function buttonAddedToList(event_:ButtonListEvent):void
  78.         {
  79.             var myButton:Button = event_.getButton() as Button;
  80.             trace('--------------------------------------------------');
  81.             trace('Button has been added to the ButtonList:');
  82.             trace('Button GroupID: '+Button(event_.getButton()).groupID);
  83.             trace('Button ID: '+Button(event_.getButton()).id);
  84.             trace('--------------------------------------------------');
  85.         }
  86.        
  87.         private function buttonRemovedFromList(event_:ButtonListEvent):void
  88.         {
  89.             trace('button has been removed:'+event_.currentTarget);
  90.         }
  91.     }
  92. }




Related Links:

AS3: TextEvent.LINK and ContextMenu incompatibilities.

Monday, July 23rd, 2007 by Luis

This morning I run into a small problem when using the new TextEvent.LINK.

Basically as with ActionScript 1 and ActionScript 2, ActionScript 3 allows you to associate ActionScript events with links in a textfield.

In AS3, the LINK event is dispatched when a user clicks a hyperlink in an HTML-enabled text field, where the URL begins with "event:". The remainder of the URL after "event:" will be placed in the text property of the LINK event.

Everything is good until here, but the problem comes when you right-click the link in the textfield. By default the flash player shows one type of context menu that is not any of the 3 types defined in the docs.

contextmenu

According with the AS3 language reference the Flash Player has three types of context menus: the standard menu (which appears when you right-click in Flash Player), the edit menu (which appears when you right-click a selectable or editable text field), and an error menu (which appears when a SWF file has failed to load into Flash Player).

The problem with the context menu appearing when you right-click a link inside a textfield is basically that igonres completely the new LINK event and by default tries to open the link generating an obvious alert message from the browser:

'Firefox doesn't know how to open this address, becuase the protocol (event) isn't associated with any program'.

So far I don't think there is a way to edit or modify this type of context menu.

Sample swf:

Sample Code:

Actionscript:
  1. package
  2. {
  3.     import flash.display.Sprite;
  4.     import flash.events.TextEvent;
  5.     import flash.text.TextField;
  6.     import flash.text.TextFieldAutoSize;
  7.     import flash.text.TextFormat;
  8.    
  9.     [SWF(width="450", height="150", frameRate="31", backgroundColor="#FFFFFF")]
  10.    
  11.     public class TextEventLinkTest extends Sprite
  12.     {
  13.         private var myTextField     : TextField;
  14.        
  15.         public function TextEventLinkTest():void
  16.         {
  17.            
  18.             myTextField             =   new TextField();
  19.             myTextField.autoSize    =  TextFieldAutoSize.LEFT;
  20.             myTextField.multiline   = true;
  21.  
  22.             var format:TextFormat   =     new TextFormat();
  23.             format.font             =   "Verdana";
  24.             format.color          =  0xFF0000;
  25.             format.size             =   11;
  26.  
  27.             myTextField.defaultTextFormat = format;
  28.             myTextField.x=20;
  29.             myTextField.y=20;
  30.        
  31.             addChild(myTextField);
  32.        
  33.             myTextField.htmlText = 'With the new method of event handling in AS3,<br>' +
  34.                     'event (asfunction) no longer calls a method you defined but,<br>' +
  35.                     'rather, sends out a TextEvent (<b><u><a href="event:flash.events.TextEvent">flash.events.TextEvent</a></u></b>) of the<br>' +
  36.                     'type <b><u><a href="event: TextEvent.LINK">TextEvent.LINK</a></u></b> for the text field instance in which it exists.<br>' +
  37.                     '<br>The text following the event: keyword in the link is accessible from<br>' +
  38.                     'the TextEvent object through its text property.';
  39.            
  40.             myTextField.addEventListener(TextEvent.LINK, linkEvent);
  41.  
  42.         }
  43.        
  44.         private function linkEvent(event_:TextEvent):void
  45.         {
  46.             trace('click: '+event_.text);
  47.         }
  48.        
  49.        
  50.     }
  51. }


Papervision3D 1.5 (AS3) Official Release

Saturday, July 21st, 2007 by Torsten

So now it's official. The latest release of Papervision3D comes with merged and cleaned code, new objects and materials, interactive materials and performance updates.

John Grden gives an overview of the change list:

  1. Optimized main render loop.
  2. Implemented ‘plugable’ face culler - 1 extra available at this time.
  3. Moved rendering from Face3D to materials, adjusted all current materials to override drawFace3D().
  4. New Materials : BitmapWire, BitmapColor, and CompositeMaterial (add multiple materials to this one single material).
  5. Moved all instances to their respective classes…fixed stars, vertices and DisplayObject3D to do so.
  6. Face normals are implemented.
  7. BitmapFileMaterial bug fixed - if used more than once, bitmap was displayed flat within the model’s body.
  8. Added progress events to BitmapFileMaterial and Collada objects
  9. Integrated InteractiveScene3D to 1.5
  10. Added Interactive materials for use with InteractiveScene3D - makes displayObjects that use an interactive material dispatch mouse events via InteractiveSceneManager.

Have a look at the Demo and Download Papervision3D 1.5

And now let's have a closer look at it. Thanks papervision!