Moock AS3 SFO Tour Recap

From Lee Brimelow – check out this cool video recapping Colin’s AS 3 From the Group Up tour stop in San Francisco.  Includes an interview.  If you’re just getting into AS 3 and live in one of the tour cities, at least try to get yourself on the wait list!

Lee’s blog is full of good content as well – worth a bookmark.

Although I enjoy programming, I enjoy math more.  Pretty much everyone has heard of Dr. Math. One of the lesser-known sites that I enjoy for a quick break is . In addition to problems (I’ve forgotten a lot about number theory over the years), they have a nice FAQ section, which is great for students.

Panel border dimensions

I’ve received a couple questions regarding custom Flex components (in Actionscript) and how to position child elements relative to the parent borders.  For example, consider a component extending Panel that contains Text and Button child items.  The Text control is to be placed near the top-left of the content area and its width is relative to the width of the content area.  The (0,0) coordinate represents the top, left-hand corner of the Panel, not the content area.  To position children relative to the content area, it is necessary to know the border dimensions.

If the parent container extends mx.core.Container, you might consider using the viewMetrics property, which returns an instance of mx.core.EdgeMetrics.  The EdgeMetrics instance contains four properties (bottom, left, right, top) containing the extents of the borders surrounding the content area.

If you are just starting out with custom Actionscript components for Flex, maybe this will help you out.  Good luck!

Flex File Upload with ASP.NET

In my ongoing efforts to learn, I recently read about web handlers. Hmmm … seems like a convenient way to handle file upload from a Flex app.  Although I’m much more comfortable with PHP, I hacked something together that worked okay on my server (.NET 2.0).  I suspect others have blogged about this, but another example never hurts and I tried to distill this one down to a very simple level.  Hopefully, it will be easy for other beginners to pick up on and expand.

There are some hacks in the .ashx file, including hardcoding the physical location of the upload folder on my server (which no longer exists after testing).  I believe there is a more elegant way to specify the upload folder in the web.config file and then access it in the script using WebConfigurationManager.AppSettings.  Haven’t had time to try that.

If you’re an experienced .NET pro, go ahead and laugh (although suggestions on making the process better are quite welcome).  Beginners are welcome to download the files here (MXML and Uploader.ashx).   It may go without saying, but make sure you have write access on the upload folder 🙂

Papervision Renderable Spline with Path Following

Visualizing a spline path is not only useful, it may be required for some applications.  Fortunately, the new Lines3D and Line3D classes in the Phunky branch make renderable splines possible.  Path animation also requires orientation control.  To provide these capabilities, I extended the Singularity P3D.BezierSpline to create a PV3DSpline class.  This allows the 3D BezierSpline class to remain generic while providing Papervision-specific controls for drawing the spline in 3D space and better path following.

I still need to add detailed roll control.  That’s on the ever-growing ‘to do’ list.  An online demo is available if this is something you want to check out.

A MaterialsList material is applied to the test object to identify the top (blue) and front (green). You can observe the demo here, which includes a link to download the Singularity library.  You *must* use the Papervision code from the Phunky branch in order to build your own standalone application.

Flex 3D Data Visualization with Papervision

I’ve started yet another background project studying ways that Papervision 3D can be used for 3D data visualization.  One of the earliest techniques in this area (for hierarchical data)  was Cone Trees.  The example below illustrates a very simple Papervision cone tree.  Actual cones are used as the representation of the root node for a few reasons.  First, I plan on having both free and target cameras available for tree/node visualization and fly-through.  Cones are easily seen from any camera angle.  Cones are already colored based on whether or not the node has children.  The size of a cone may indicate the relative number of children (tall/thin -> few children, short/fat -> many children). This is helpful as I plan to add the ability to expand/contract nodes in the future.

Although visually unimpressive, the BaseCone class upon which the above image was created supports on-the-fly addition of children, with automatic repositioning of child nodes throughout the hierarchy.  This makes it useful for on-the-fly parsing of XML data, for example.

Still a lot of work to do in automatically adjusting each level to avoid overlaps as children are added and all the camera support needs to be added.

I’ll keep plugging along.  In the mean time, thanks to Ralph Hauwert for his explanation of some of the PV3D internals.  I can’t figure out how these PV3D guys have time to make a living, raise families, and work on Papervision.  They must really be from the planet Krypton 🙂