Archive for the 'AS2' Category

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:

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:

Flash full-screen mode and Flash Player Update 3 Beta 1 (build 9.0.60.120)

Monday, July 16th, 2007 by Luis

It seems to be a small problem when triggering the full-screen mode in AS2 with the Flash Player Update 3 Beta 1 (build 9.0.60.120).

When triggering the full-screen mode from a button by using onPress handler under the Flash Player Update 3 Beta 1 plugin, the swf gets stack showing the hand cursor and blocking any kind of interactivity, instead the same trigger mode under the latest stable Flash Player version (9,0,47,0) behaves correctly.

The behavior is normal when triggering the full-screen mode from a button by using onRelease handler rather than onPress handler.

Since the Flash Player Update 3 Beta 1 is not release yet, this behavior can’t be considered as a bug (or maybe Adobe has changed the way you can trigger the full-screen mode) but just keep it in mind if you play around with this Flash player version and suddenly nothing works as you expected.

You can download the Flash Player Update 3 Beta 1 (build 9.0.60.120) here.

Test it here.

Toro Rosso

Tuesday, March 27th, 2007 by Torsten

The next Red Bull F1 team strikes back with a brand new website. Our intention was to involve the user in such a way that he is really feeling close to what is happening on the race track.


The relaunch shows the usual Less Rain tuning (friendly Search Engine Optimization (SEO) , Alternate HTML version optimized for ScreenReader, Back Button, Deeplinking).

Sound design by Taeji Sawai, straight from Japan.

Related entries:

Papervision 3D Demos

Wednesday, February 14th, 2007 by Luis

Check out this examples of some fantastic work done with Papervision3D.

Related Posts:

Papervision3D: PaperDude Demo

Thursday, February 8th, 2007 by Luis

This is not about performance or Collada or clipping issues in PV3D, this is just about Paperfun and imperfections.

The very first time I heard about Papervision 3D I thought about my first experience with 3D when I was a little kid, it wasn’t related with computers at all, it was a very basic set of plane paper dolls similar to this.

Based on that old memories I decided to have a bit of Paperfun and crete the Paperdude.
Paperdude

Click here to see the demo.

UPDATE 20-02-2008 (Paperdude Second Generation):

Paperdude

Related Posts:

Flash: Cast to Array with MTASC

Friday, October 20th, 2006 by Thomas

Just had some new insight on the Cast to Array problem I had posted a while ago.

For the Flash IDE compiler the following 3 lines are synonymous, i.e. creating an Array with one object in it (resulting in the problem I had in my earlier post):

Actionscript:
  1. var a:Array = Array({x:1});
  2. var b:Array = [{x:1}];
  3. var c:Array = new Array( {x:1});


Not for MTASC though. MTASC seems to interpret Array() as a cast operator instead of a global conversion function. Can be tricky to debug, because for FDT and MTASC Array({x:1}) is legal syntax, namely a cast operation. They don't throw an error, but they don't create an Array either. If you have more than one element they do complain. Array(1,2,3) is illegal syntax for FDT and MTASC.

The following example class would behave differently in swf's compiled with MTASC or the Flash IDE. Which strengthens my belief that the Array() operator should better not be used at all.....

Actionscript:
  1. class ArrayTest
  2. {
  3.  
  4.     public function ArrayTest()
  5.     {
  6.         testArray(Array({x:1}));
  7.         // Flash: Array.length:  1
  8.         // MTASC: Array.length:  undefined
  9.    
  10.         testArray([ {x:1} ]);
  11.         // Both: Array.length:  1
  12.    
  13.         testArray(new Array( {x:1} ));
  14.         // Both: Array.length:  1
  15.     }
  16.  
  17.     private function testArray(ar:Array):Void
  18.     {
  19.         trace("Array.length: "+ar.length);
  20.     }
  21. }


Flash & Eclipse: FDT release candidate 1.1

Tuesday, April 25th, 2006 by Thomas

Powerflasher have published their release candidate for FDT v1.1.

The most visible changes are:

  • Placing the mouse cursor on a variable or type/class name highlights all occurences of it in the current class (Editor "Mark Occurences")
  • Better code-folding
  • More detailed settings in Window-Preferences regarding encoding, folding
  • Jumping to methods and classes via CTRL + click on the class-name/type
  • First steps towards refactoring. If you rename a class or move it to another folder within the Flash Explorer it'll replace the according names within the class file. It doesn't change the imports of the project though... see FDT 2.0 announcement below

Here's the list of all changes.

To install you need to got through the usual installation steps again, using a different URL. Note that this is a Test version. I've been using it since a week and so far haven't encountered any problems.

Here are the installation instructions taken from their site with the test URL:

  1. Open Eclipse.
  2. Choose "Help"->"Software Updates"->"Find and install...".
  3. Select "Search for new features to install" and choose "Next".
  4. Choose "New Remote Site".
  5. Insert "FDT" as name and the URL "http://fdt.powerflasher.com/updateTest".
  6. Confirm with "OK".
  7. Mark "FDT" and choose "Finish".

Another exciting news is that they are working on their next major release FDT 2.0 with proper refactoring! Apparently the upgrade prize will be reasonable:

There will be no detriment for all existing FDT-owners with the upgradeprice, so there is no need to wait with licensing.

Flash: Nasty XML load bug in Internet Explorer

Thursday, November 17th, 2005 by Thomas

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 on the XML file.

Wow! I've been chewing on this one for a while... We have a Flash site running on https with dynamically generated XML content. The server always returned the Pragma:no-cache header so that the dynamic data isn't cached in the browser.

The bug is especially hard to find because the request goes out to the server successfully, but the XML object in flash remains undefined for no apparent reason. Only after removing the header output on the server it started to work.

Not nice.

This MS bug report seems to be related.

[edit]

This post has been replaced by a more recent one, including an application to test the caching behavior of Flash in different browsers.

Flash loading and browser cache test-suite

[edit]

Some more posts on the topic:

Marc Speck

Adobe Technote

Flash: Comment your classes!

Tuesday, September 27th, 2005 by Thomas

Nothing new, but always a good read:

How to Write Doc Comments (Syntax reference)

Javadoc-style comments in AS2 classes can be used to generate HTML files with the API specification of your project, by using tools like VisDoc, who also have a documentation on writing doc comments

Flash: Cast to Array

Thursday, September 15th, 2005 by Thomas

Now that's weird: it seems to be impossible to cast to an Array in AS2!

The "natural" way of doing it for me would be this:

Actionscript:
  1. var a:Array = [ [1, 2], [3, 4] ];
  2. var b:Array = Array(a[0]);
  3. trace(b[0]);


I'd expect the output to be "1", but it actually prints "1,2"!

Read the rest of this entry