As Flash and Flex applications get more complex the ability to watch trace statements while running the application in a browser is invaluable. This is how I do it (in OSX):
1) find your mm.cfg file. Mine is located here: ~username/mm.cfg (substitute "username" with your real username)
2) open it in a text editor and add these lines:
CODE:
-
ErrorReportingEnable=1
-
TraceOutputFileEnable=1
-
MaxWarnings=0
3) open a terminal window and add this to your .profile file.
CODE:
-
alias trace=tail\ -f\ "/Users/username/Library/Preferences/Macromedia/Flash\ Player/Logs/flashLog.txt"
To watch your browser throw trace statements, just open a terminal window and type "trace" and they will now appear in the terminal window.
This code is a simple extention of the Flex List component to make a line item editable on double click, not single click which is the default behaviour.
Actionscript:
-
package{
-
import mx.controls.List;
-
import flash.events.MouseEvent;
-
import mx.events.ListEvent;
-
-
public class DoubleClickList extends List{
-
public function DoubleClickList(){
-
super();
-
doubleClickEnabled = true;
-
addEventListener(MouseEvent.DOUBLE_CLICK, handleDoubleClick);
-
addEventListener(ListEvent.ITEM_EDIT_END, handleItemEditEnd);
-
}
-
-
-
protected function handleDoubleClick(p_evt:MouseEvent):void{
-
var isEventPrevented:Boolean = p_evt.isDefaultPrevented();
-
if(!p_evt.isDefaultPrevented()){
-
editable = true;
-
editedItemPosition = {columnIndex:0, rowIndex:selectedIndex};
-
}
-
}
-
protected function handleItemEditEnd(p_evt:ListEvent):void{
-
editable = false;
-
}
-
}
-
}
December 16th, 2008
Randy
Last night's EFUG featured the technology from Scaleform. It was one of the best EFUG meetings yet.
Troy Dunniway (L.A.) and Matthew Dolye (Washington, DC) braved the cold weather to visit Edmonton to spend some time with GSkinner and BioWare. Troy, a game developer veteran, gave a rundown of the Scaleform product and how it is used to leverage swf files (vector graphics and logic) within console video games. Consoles have become extremely powerful and at the same time more complex to develop for. Games too are getting more and more complex and this has forced developers to rely on middleware to develop games that will work across platforms. Scaleform has targeted the 2D middleware integration stack and somehow reverse engineered the Flash Player so that 2D swf files can be rendered and executed within the 3D gaming worlds. Graphic overlay and menu development in these games has typically been an arduous task and never has it been vector based. With Scaleform game developers can leverage the Flash design world to take hud graphics (think Ironman) to the next level. A significant chunk of the Flash AS2 api (up to FP7 or so) is supported. ExternalInterface is also supported to allow roundtrip communication between game and swf. AS3 support is coming.
Matthew went on to demonstrate bringing swf content into Unreal Editor and hooking up the logic for a door key panel, as an example. It was really crazy seeing a futuristic semi-transparent display panel that, among other things, showed lived camera views (real-time audio/video) which you could back away from and walk around. The Unreal3 engine maps the swf in it's 3d space seamlessly. The antialiasing techniques ... unbelievable.
The Gskinner tie-in came next as Gskinner developers demonstrated a brand new component set they have developed for use with Scaleform. They also have created some JSFL-based workflow tools that ease the developments process since this GFx platform has it's own eccentricities. Since Gskinner developed GLIC (mCOM) and then the Flash V3 components, Scaleform picked the right group do build these components. The are highly optimized and easily skinnable.
It is no accident that the Scaleform guys took the time to demonstrate to the local Flash user group. They are looking to build a network of great Flash developers/designers since the demand for such a skill set in the gaming world is set to explode.
Recently I struggled with trying to figure out why I could not traverse loaded XML data using E4X. In one case it was a RSS feed and in another it was Timed Text data. What these data sets have in common is that they declare name spaces. Consider this xml data:
XML:
-
<tt aaa:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling" xmlns:aaa="http://www.w3.org/XML/1998/namespace">
-
<head>
-
<styling>
-
<style id="1" tts:textAlign="right"/>
-
<style id="2" tts:color="transparent"/>
-
<style id="3" style="2" tts:backgroundColor="white"/>
-
<style id="4" style="2 3" tts:fontSize="20"/>
-
</styling>
-
</head>
-
<body>
-
<div aaa:lang="en">
-
<p begin="00:00:00.25" dur="00:00:03.25">Dreamweaver users now have access to Flash video. Didn't have it before.</p>
-
<p begin="00:00:04.20" dur="00:00:03.07">And if you were to talk to a Dreamweaver user about three or four years ago</p>
-
</div>
-
</body>
-
</tt>
I see that it declares a couple namespaces but I thought since the "p" nodes do not. This ...
yields nothing. Yet this ...
Actionscript:
-
if (timedTextXML.namespace("") != undefined){
-
default xml namespace = timedTextXML.namespace("");
-
}
-
trace(timedTextXML..p);
works fine.

It has been a little over a week since we got back from San Francisco and the MAX conference. It has taken me this long to surface for air after getting caught up from being away. Adobe announced a dizzying amount of updates and initiatives. Serge Jespers has a list of most of them here: http://www.webkitchen.be/2008/11/22/weekly-blend-the-max-edition/. Let's just say that it will be a while before I can digest all of this.
The picture above (taken by Charles Freedman) shows the massive display that was set up for the keynotes. I have never seen anything like it before. When I walked into the hall, Icky Thump by White Stripes was playing through the incredible sound system and I could feel the thumps on my chest. I had goosebumps.

Read more...
Mark Logic tells me that anyone who cares about free text analytics will be very interested in this visualization, because it previously was not available in any product. The keyword here being Real-Time. A geospatial analysis of documents returned from a free text search, plotted in arbitrary geographic bounding boxes, calculated in real-time. No other product can do this is real-time. Try out the demo..
When the initial heatmap is displayed you can hold the ctrl/cmd button down and either click on a "bucket" or click-drag to zoom in on an area and have new buckets calculated.
This widget was part of the recent MarkLogic Server 4.0 release.
My role was that of Flex developer of the map visualization. Craig Schlegelmilch directed the project and wrote the middleware integration using Xquery. Owen Brierley wrote the javascript (html controls are continually updated with search results). Tanya Camp provided graphic design consultation. Craig and Tanya form the dynamic company Bucketduck Inc. and the overall project is a production of GystWorks.
I am developing a custom video player for a client and I am using the Flash CS3 TileList component which loads thumbnails from a CDN. Sometimes the URL fails resulting in a runtime error and a dialogue thrown up by the Flash Player (if you have the debug version installed):
Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found.
Only a tiny number of viewers will have the debug version installed and will not see this error, but those people count because they will be my colleagues and fellow flash developers and they will judge me harshly as a result. Oh yes. I really dislike it when other websites (like my blog
cause the Flash Player to throw up runtime errors, sometimes crashing my browser.
All you need to do add an event handler to catch the IO Event. But in this case it is not incredibly obvious where to add the event listener. Many thanks to Lanny McNie for pointing out how I can extend the TileList Class and add the event handler to the "activeCellRenderers". Change the linkage to the TileList component in the library to point to your new class and you should be good to go.
Actionscript:
-
package com.channelflip.video.control{
-
import fl.controls.TileList;
-
import flash.events.IOErrorEvent;
-
-
public class VideoTileList extends TileList{
-
public function VideoTileList(){
-
super();
-
}
-
override protected function drawList():void{
-
super.drawList();
-
var length:Number = activeCellRenderers.length;
-
for (var index:Number=0; index
-
activeCellRenderers[index].addEventListener(IOErrorEvent.IO_ERROR, handleIOError, false, 0, true);
-
}
-
}
-
protected function handleIOError(p_evt:IOErrorEvent):void{
-
trace("caught IO Error: " + p_evt);
-
-
}
-
-
}
-
}
Recently I had a Flash problem to solve where the content needed to pan and zoom in one smooth motion to the point where a user clicked. The technique was a little tougher to figure out than I originally thought but I got it down to essentially three lines (using Grant Skinner's gTween).
The source FLA is available here. Below is a code snippet that assumes you are panning to center and zoom to 400%:
Actionscript:
-
var xStop:Number = base.x + ((stage.stageWidth/2)*4 - (mouseX*4));
-
var yStop:Number = base.y + ((stage.stageHeight/2)*4 - (mouseY*4));
-
var gTween:GTween = new GTween(base,.5,{y:yStop, x:xStop, scaleX:4, scaleY:4},{ease:Circular.easeOut});
Example: click on the blue circles to zoom in and anywhere around the circles to zoom out.
Recently I came across a problem with a swf that was failing to get a value from a form in the HTML wrapper using IE7 while it worked as intended in Safari and FireFox. Adobe's AC javascript embed code (no object or embed tags) is used in the HTML wrapper and ExernalInterface.call() is used in the swf (AS3). The fix was to ensure the id attribute in the embed code was set to a different value than the src and name attributes. Thanks to Adobe Live Docs for clues that saved hours of hair pulling.
I dealt with this with the 10.5.2 update. Apparently the OSX update installs a fresh version of the Flash Player which is not the debugging version. This will disable the ability for Flex Builder to test an application in debug mode. It is a simple fix (I like simple). Simply download the Flash Player with debugger and install it.