Archive for the 'Learnings' Category

Flash: Transparent Video

Tuesday, September 26th, 2006 by Luis

How to make a transparent flash video using Adobe After Effects 7.0 Pro and Flash, by Paul Jenkins.

Read the tutorial here.

Flash: tabIndex and IE workaround

Tuesday, June 13th, 2006 by Luis

Problem:

In Internet Explorer after the last tabIndex, focus goes to the browser address bar.

Solution:

An easy workaround is to create an empty MovieClip which receives keyboard focus and automatically gives focus to the first selectable (editable) text field, button, or movie clip.

Example:

[flash]http://www.blog.lessrain.com/wp-content/upload/test_01.swf,250,100[/flash]

Actionscript:
  1. import mx.utils.Delegate;
  2.  
  3. var timeline:MovieClip = this;
  4.  
  5. var myformat:TextFormat = new TextFormat ();
  6. myformat.font = "Verdana";
  7. myformat.size = 10;
  8.  
  9. var tf1:TextField = timeline.createTextField ("tf1", this.getNextHighestDepth (), 10, 10, 200, 18);
  10. tf1.type = "input";
  11. tf1.selectable = true;
  12. tf1.border = true;
  13. tf1.setTextFormat (myformat);
  14.  
  15. var tf2:TextField = timeline.createTextField ("tf2", this.getNextHighestDepth (), 10, 40, 200, 18);
  16. tf2.type = "input";
  17. tf2.selectable = true;
  18. tf2.border = true;
  19. tf2.setTextFormat (myformat);
  20.  
  21. tf1.tabIndex = 0;
  22. tf2.tabIndex = 1;
  23.  
  24. var tabHackMC:MovieClip = timeline.createEmptyMovieClip ("tabHackMC", timeline.getNextHighestDepth ());
  25. tabHackMC.tabIndex = 2;
  26. tabHackMC.onSetFocus = Delegate.create (this, focusLast);
  27. function focusLast ():Void
  28. {
  29.     Selection.setFocus ("timeline.tf1");
  30. }


Flash: Uninstall and Install for testing purposes

Tuesday, April 25th, 2006 by Luis

Untill now I've been using Flash Plugin Switcher to uninstall and install the Flash Player in order to test some stuff such as Express Install and the Flash Player detection.

Recently I downloaded the latest version of Flash Plugin Switcher which for some weird reason destroyed completely my IE making impossible to install or uninstall any Flash player version.

From now on I will install and uninstall the Flash player using a different method:

Flash: Back Button and Deep Links Topic

Tuesday, March 28th, 2006 by Luis

I know this is an old topic, but I feel like posting about it. Since a few months ago I tried to make flash websites a little bit more usable and functional taking advantage of some new Flash 8 features and going back to old topics such as the browser back button support and deep linking support.

So far we have tried to implement this features in the last two projects we have done for redbull with 95% success, as usual MAC and Safari still very problematic.

Today I found this article in Jens Franke's blog where he points to a good solution for the Back-Button Support which apparently works in Safari.

Realated entries:

Other articles:

Flash: FE labs

Tuesday, March 28th, 2006 by Luis

Robert Taylor, creator of FlashExtensions.com has set up a small Open Source library of resources regarding Flash and its capabilities such as Drag n' Drop Selected Text , Detect Line Number and Position of TextField or a set of algorithms to display the right color of text for the right background.

Worth to take a look.

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: Video Articles

Wednesday, October 12th, 2005 by Luis

Macromedia has released a couple of new interesting Flash Video articles:

Flash: How to de-interlace video in real-time

Sunday, October 9th, 2005 by Luis

Fabio Sonnati has a very nice and useful article in his blog about how to de-interlace video in real-time using the Convolution Filter in Flash 8.

Worth to read: Flash real-time deinterlacing best-practice.

Related Articles:

Flash: Flash 8 garbage collector benchmark

Saturday, October 8th, 2005 by Luis

Interesting benchmark test, by Frédéric Saunier, to demonstrate how the new GC behaves when we fill an array with many new instances of an object and we destroy the array.

Flash 8 garbage collector benchmark.

Related articles:

Flash: Video Tutorials [UPDATED]

Friday, October 7th, 2005 by Luis

Flash Extensions

New set of Video Tutorials by flashextensions.

Updated, Flash 8:

Previous related entries:

Flash: Create background pattern in Flash 8

Tuesday, September 27th, 2005 by Luis

Quick example of how to create a tiled bitmap in Flash 8 using MovieClip.beginBitmapFill method instead of using duplicated movieclips.

SWF sample:

[flash]http://www.blog.lessrain.com/wp-content/upload/tilebackground2.swf,400,200[/flash]

Actionscript:
  1. import flash.display.BitmapData;
  2. var pattern:BitmapData = BitmapData.loadBitmap("img_105");
  3. function createTiles():Void {
  4.    
  5.         with (_level0) {
  6.            
  7.                 beginBitmapFill(pattern);
  8.                 moveTo(0, 0);
  9.                 lineTo(Stage.width, 0);
  10.                 lineTo(Stage.width, Stage.height);
  11.                 lineTo(0, Stage.height);
  12.                 lineTo(0, 0);
  13.                 endFill();
  14.         }
  15.        
  16. }
  17.  
  18. createTiles();


Related Entries:

Flash: EFFECTiveness in Flash 8

Monday, September 19th, 2005 by Luis

Well, probably this is not as fancy as 'fire', 'smoke', 'particles', '3d', but I would like to highlight this post from Tinic Uro where he gives some ideas of how to use the new 'Flash 8 features' in a different and practical way.

Worth to read: Using Flash Player 8 filters for good.

More ideas around this topic:

I think, since the new Flash Player has access to the pixel data of a webcam, we are close to the possibility of creating hands free devices that will enable many disable people to use their computers, such as Mouse Vision.

Related post: Flash 8 and webcams.