June 2008 Archives

Color Name Class (SVG 1.0 - X11 and VGA)

| | Comments (2)

One small thing I've always found a bit handy with CSS in XHTML is the ability to type familiar names for colors rather than the hex value.

Unfortunately, Flash's StyleSheet does not support color names at all and Flex's StyleManager only supports the 16 basic VGA color names.

I decided to write a class that adds static properties for all of the color names defined by SVG 1.0 (The colors in SVG 1.0 include the X11 colors with the addition of gray/grey variants. X11 includes the 16 basic VGA, or HTML4, colors as well). This class also adds two static convenience methods for returning a Color* object by passing in the color name or hexadecimal color value.

*The name that made the most sense for this class was Color and since the Flash Color class has been removed with AS3, there was no reason not to use it.

While this class does not extend the CSS parsing capabilities of Flash, it could be used by an advanced StyleSheet class that overwrites the parseCSS method using this class as a lookup.
This class could also be extended to add (or overwrite) color values specific to a project you are working on. By setting up static properties for a project color set, the project team could be assured that the colors being used are consistent between team members.

Description:
The Color class defines the names and hexadecimal values of the colors defined in SVG 1.0.

Documentation:
Color Class Documentation

Download Color Class

Reposition ScrollBars in Flex Components

| | Comments (3)

I was under the assumption that someone had already figured this out, but I searched forever last night trying to find out how to move the VScrollBar to the left-hand side of a TextArea component and came up with nothing. (If I've overlooked something, forgive me... but at least this will help others when trying to find the answer).

After digging through the source code for a bit, I came up with the solution.
Now this has only been tested with the TextArea component and vertical scrollbar, but should work with any component that extends ScrollControlBase and should work with the horizontal scrollbar as well.
The other thing to keep in mind is that this might (and probably does) mess up the size calculations of the component... I didn't look into that.

So without further ado, create a class that extends the TextArea component and override the protected updateDisplayList method like so:

protected override function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void
{
 	super.updateDisplayList( unscaledWidth, unscaledHeight );
 	
 	if( verticalScrollBar && verticalScrollBar.visible )
 	{
  		verticalScrollBar.x = -verticalScrollBar.width;
  	}
}

Dead simple.

This sets the vertical scrollbar of the TextArea component to the far left side of the component. You can change the verticalScrollBar.x value to whatever you like to position the scrollbar elsewhere. Also, you should be able to do the same check for horizontalScrollBar and change its position within the if statement to move it. Like I said, I haven't checked that out, but it should work.

Let me know.

The latest issue of Adobe Edge, with my article on using Flex and Papervision3D to geocode, just went live.

Check it out here.

Woopra... wow

| | Comments (0)

What a great app!

Woopra is a real-time web tracking application that's currently in beta.
I've only been playing with it for a few minutes (since I received my confirmation) and am already loving it.
Its basically Google Analytics except with the incredible addition of being live. On top of all of this, it has a great design and is extremely user friendly.

Woopra allows you to sit and watch people log on and off of your site. Track them in real-time as they switch pages and interact with your site. What's even crazier is you can even initiate a conversation with any visitor. For all you know, I'm watching you right now. Rockwell was right in being paranoid.

Like I said, I'm just getting into it, but so far I'm leaning towards this being my web analysis app of choice.

August 2008

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Categories

Archives