Archive for July, 2007

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!

Bumptop, now available in Flash

Thursday, July 19th, 2007 by Carsten Schneider

Coming soon. Patrick wants someone to do this as a background transparent Air application so he can replace his desktop interface.

Related Posts: Organize your Desktop

UPDATE on Red Bull FFC Project

Tuesday, July 17th, 2007 by Luis

We have put together a nice set of photos where you can see the Red Bull Formula 1 cars in detail.

See Photos.

faces for charity

Related Post:

echochrome

Tuesday, July 17th, 2007 by Carsten Schneider

Trailer on EurogamerTV: echochrome, a game with MC Escher-inspired level design. Huge trailer here if you want to see it in more detail.

Theo Jansen - Kinetic Sculptor

Monday, July 16th, 2007 by Luis

Since about ten years Theo Jansen is occupied with the making of a new nature. Not pollen or seeds but plastic yellow tubes are used as the basic matierial of this new nature. He makes skeletons which are able to walk on the wind. Eventualy he wants to put these animals out in herds on the beaches, so they will live their own lives.


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.

Daniel Johnston, Thursday 12th July, Union Chapel

Tuesday, July 10th, 2007 by Luis

[UPDATE]

The show became magical when Johnston was joined by lo-fi folk stars Adem and James Yorkston. Their guitar and pump organ on one of Johnston's most loved songs, Some Things Last A Long Time, was nothing short of breathtaking. Johnston physically shook as he sang. "Are you still with me?" he asked, unaware that grown men were dabbing at their eyes.

Johnston has been described as, ‘one of the world’s greatest living songwriters by a who’s who of rock luminaries including Tom Waits, Kurt Cobain and David Bowie. Artists indebted to his sound include Beck, Jeffrey Lewis, The Flaming Lips and Mercury Rev.’ Even The Simpson’s creator Matt Groening is a big fan.

Still some available tickets on ebay.

Red Bull’s ‘Fans Car’

Friday, July 6th, 2007 by Luis

[UPDATE]: Click here to see some nice photos of the race.

After months working in this project, finally is taking a physical shape. Red Bull Racing team is already preparing the two Formula 1 cars for this weekend's British Grand Prix.

Over 30,000 pictures have been uploaded onto the livery of Mark Webber and David Coulthard's cars, raising over a million dollars for the spinal injuries charity, Wings for Life.

Read more here.

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

red bull F1 car

See more pictures here (totkat flickr).

Related Posts:

LICHTFAKTOR light photos

Monday, July 2nd, 2007 by Luis

Beautiful set of light photos, and here the gear.

light