Wednesday, April 30, 2008
Wednesday, April 30, 2008  0 Comments     

The 1900xt card in my MacPro is starting to overheat quite a lot. Its out of warranty, and its $399.00 still for a replacement. A better card can be had for a lot cheaper:

NVIDIA GeForce 8800 GT (1st Generation) Graphics Upgrade Kit for Mac Pro
Part Number: MB560Z/A
  1 Comments     

I see that there is a new Java out for OS X... will this screw with Flex Builder 3? Or is it okay to go ahead and update?

Update
No worries, the new Java doesn't screw anything up for any application as far as I can tell yet. Flex Builder 3 still works perfectly.
Tuesday, April 29, 2008
Tuesday, April 29, 2008  0 Comments     

I just read a truly remarkable article online which poses a really interesting industrial design/gui problem that Apple might be facing... the design and usability considerations of shrinking the iPhone/Touch.

You can go and read the well thought out words and get a better understanding of the situation by the images prepared for the article. It really makes you think, which I love.
  0 Comments     

Would you like an easy install for Python's lucene for OS X? Open a terminal window, enter this:

sudo easy_install -f http://kapil.objectrealms.net/dist lucene

And you're done. Enter your admin password and you should be good to go. 
  4 Comments     

Saffron UML

Has anyone seen anything lately in regards to Saffron UML? I ask because I have been much too busy lately to be able to jet anywhere to attend a conference and I imagine the time when Saffron is unveiled or demo'd would be at such an event.

Samuel, if you read this, you could always post on your blog about what's happening. You know you have a lot of people really hoping this tool is released soon™. You should think about micro-payments :)
Monday, April 28, 2008
Monday, April 28, 2008  2 Comments     

I used to like Grand Theft Auto, and I spent a lot of time trying to get into tons of trouble, ignoring missions (I really despise false-premised time trials) and driving around eventually being chased by the military.

So I'd randomly jack cars, smash into people and things, get the cops after me, take them down, and then see how long I could run from the military helicopters, etc. Then I'd turn it off, after wasting a couple of hours doing basically nothing ;)

That was a long time ago, and now GTA IV is coming out tonight, and I know many who will be online running around finding prostitutes, whacking targets, role-playing, smashing into other cars, and all of that.

Since I have children now, I really can't say that I am interested in this in any way. Mind you, I do like a mean FPS still, so I'm not saying that I am above the moral fray of GTA as much as it seems way over the top for even me.

I get the premise, but I don't think I need to see 1/2 of the crap that is in GTA to have fun with a game. The language, the simulated sex, the random violence, etc. just doesn't end up being fun for me. Lots of people in lines already right now for this thing.

I'm sure lots will buy it, and many will buy simply because it's controversial. But I won't be buying this one.
  0 Comments     

My MacPro is now all set up, however I installed a different rev of Subversion, svnX, and SCPlugin. I have since removed SCPlugin since it sucked (the receipt and the contextual menu plugin).

But now when I bring up a contextual menu, and choose the bottom option More, I am greeted with a quick Finder crash & restart.

The More allows for Automator stuff, sending things to Bluetooth, enabling Folder Actions, configure Folder Actions, etc. Hmm.

Has anyone else run into this problem? Hopefully I can nail this dumb thing down.

Update
It would appear that the SCPlugin was part of the problem, and once that was removed I still had a contextual menu item plugin... namely ADFSMenu.plugin. Removing that seems to have cleared up the More contextual menu item. Whew. Everything seems like it is back to normal functioning behaviors.
  1 Comments     

Today Adobe walked over to the ventilator and pulled the plug on GoLive. To be honest, I wasn't even sure it was still a product. I feel sorry for all the developers who put a lot of work into that product, only to see it die on the vine today. I'll have some extra coffee for you today.

Adobe is also offering a $199 upgrade for registered GoLive users to switch to Dreamweaver, nice.

Today Apple released some new iMacs, as predicted. You only need to head to Apple.com to see the homepage emblazoned with the news.
Saturday, April 26, 2008
Saturday, April 26, 2008  0 Comments     

I ran into problems with that SCPlugin (too bad), but I have tried out svnX (0.9.13) for OS X and its pretty sweet.

I don't get finder icons to show me status of files, but since I am not using SVN on a huge team of developers I'm pretty good.

And I always update the repository no matter what at the start of each session. And we always have diff. when needed.
Friday, April 25, 2008
Friday, April 25, 2008  1 Comments     

On this glorious night as I watch tonight's white out game in Pittsburgh (DVR -- we went to Sesame Street Live!), my thoughts float to Objective-C and the iPhone. 

Now, in order to get things rolling on the iPhone in terms of using the SDK to create an application for the iPhone/touch, you're looking at Objective-C. For me whose nearly sole focus has been ActionScript 2/3, javascript, lingo, some ASP and some PHP, Objective-C Cocoa is a whole lot to chew on. It's no easy nut to crack. At least for me, someone who doesn't have a CS degree but learned what I know on my own.

There can be no doubt that the apps you can build with the SDK are powerful. Crazy powerful. But coming at it from outside the normal scope of coding is awfully daunting. The language itself isn't very easy to look at and understand... its abstracted quite a bit in my opinion. The use of drag & drop delegates can get confusing too. 

Almost all of the iPhone sample applications have empty Windows (which is normal, I make my Flash apps without any assets on the stage, etc.) but makes picking things up more difficult. I'm wondering if developers not accustomed to Obj-C Cocoa will be able to quickly pick it up or not. 

I should find an Obj-C course someplace, take it, then do some iPhone SDK workshops to get some hands-on stuff rolling. I have a lot of ideas, its just a brand new world to play in. I need to establish many basics before I can proceed to step into the boat. I'm not even sure what all the classes available are yet, so the answer could be obvious, but not until I make myself aware of it. 

Anyway, off to bed.

Let's go Pens!
  0 Comments     

Some quotes some might want to take back.

redean: 3-0 damn, its over.
Joey704Calz: LMAO, whos loving this as much as I am?
redean: I know I am, chokefest.

Thank you Malkin and Crosby for teaming up for the winning goal this evening.
Thursday, April 24, 2008
Thursday, April 24, 2008  0 Comments     

Love TortoiseSVN on the PC? You might like this on the Mac:



Status icons in the Finder, and integrated into Finder contextual menus! SCPlugin to the rescue. It's pretty close to Tortoise as far as I've seen using it. Command-line is the best, but for those who don't actually like that interface, this is pretty spectacular. Nice to see something like this on the Mac.

Update

After one day working, this thing has gone bad on me. If I try to access the contextual menu item "More" the Finder crashes and restarts itself. I can't get this to work at all anymore - so I am going to uninstall this. Thank God I didn't come to rely on this quite yet, or else I'd be a little screwed as I don't like the Terminal very much. SVNX I guess.

Oh well...
  1 Comments     

I am currently head's down into the iPhone SDK. Not being totally familiar with Cocoa, it's presenting a nice challenge. One thing I am most interested in is reading data from the web and displaying it on an iPhone or Touch... without use of Safari.

Any devs out there have any quick example projects that show this? It could even be reading remote XML or something straight & parsing it. I'll be scouring the web for some examples as well.

The latest XCode is really pretty awesome - but I am no fan of all of the freaking windows and square brackets yet. There are tons of nice UI touches everywhere. It almost doesn't feel like an IDE.
Wednesday, April 23, 2008
Wednesday, April 23, 2008  0 Comments     

I saw this tonight:

Weblogs is Temporarily Offline

We apologize for the inconvenience. We are aware of the problem and working on it.

Thank you for your patience.

Bummer. And then of course all of the sudden the HDMI from the cable box is absent, the television telling me there is no signal, but component is there. Crap. Better be a blip... cause that cable was expensive. Yesterday we didn't have Versus but it was there today. Now this. Ugh.

  0 Comments     

Animating text into a text container is a treatment that you see every now and then on the web. They come with various visuals, but most of them either come in chunks of text at a time or line by line. 

The current implementation below allows for the adjustment of chunks and the speed in which the chunks are rendered. 

This is a quick implementation that indeed works, but its picky about the specified container at the moment, but it could be expanded upon to include line by line rendering, fading in text elements as they are placed (that would be pretty snazzy), etc.

If you know of existing classes that provide interesting textual placements, please share with us.

Anyway, I have three classes: StringFeeder.as, FeedUpdateEvent.as, and Application.as. The Application class is the document class here and simply provides a little testing environment. 

How this works is when you tell the StringFeeder class instance to run, it requires the use of an eventListener to supply the bits of text to render in a text field. So if you don't listen for the UPDATE event, you won't be able to do much with any of this code. I'll bold that listener for you where it's used.

FeedUpdateEvent.as

package net.ericd.v8.events
{
    import flash.events.Event;
    import flash.text.TextField;
    
    /**
     * This class allows one to pass properties on the event
     * object, to make things easier to implement.
     */
    public class FeedUpdateEvent extends Event
    {
        public static const UPDATED:String = "EVENT_FEED_UPDATE";
        public static const DONE:String = "DONE";
        public var value:String;
        public var who:TextField;
        
        public function FeedUpdateEvent( type:String,
                                         value:String,
                                         who:TextField )
        {
            super( type );
            this.value = value;
            this.who = who;
        }
        
        public override function clone():Event
        {
            return new FeedUpdateEvent( type,
                                        this.value,
                                        this.who );
        }
    }
}

You can always go ahead and add more types of your own liking, but the constructor expects those two properties. I suppose you could rest that (...) so you'd have the option of sending more (I've never tried that with events though... wonder if it would work at all).

StringFeeder.as

package net.ericd.v8.content
{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.display.MovieClip;
    import flash.utils.Timer;
    import flash.events.*;
    import net.ericd.v8.events.FeedUpdateEvent;
    
    public class StringFeeder extends Sprite
    {
        private var $array:Array;
        private var $string:String;
        private var $speed:Number;
        private var $target:TextField;
        private var $delay:Timer;
        private var nCount:Number   = 0;
        private var nTotalCount:Number = 0;
        private var nextStart:Number = 0;
        private var nextEnd:Number = 0;
        private var $eachCut:Number = 4;
        private var nRunLimit:Number;
        private var myEvent:FeedUpdateEvent;
        
        public function StringFeeder( oTarget:*, sValue:String,
                                      nSpeed:Number )
        {
            this.$string    = sValue;
            this.$speed     = nSpeed;
            this.$target    = oTarget;
            nRunLimit = Math.ceil( $string.length / $eachCut );
        }
        
        private function sendData( event:TimerEvent ):void
        {
            var sSnippet:String = $string.substring( nextStart,
                                                     nextEnd );
            myEvent = new FeedUpdateEvent( FeedUpdateEvent.UPDATED,
                                           sSnippet, $target );
            this.dispatchEvent( myEvent );
            nextStart = nextEnd;
            nextEnd += $eachCut;
            
            if ( nTotalCount > nRunLimit )
            {
                $delay.stop();                
                var doneEvent = new FeedUpdateEvent( 
                                    FeedUpdateEvent.DONE,
                                    null, $target );
                this.dispatchEvent( doneEvent );

                return;
            }            
            nTotalCount++;
        }
        
        public function run():void
        {
            nextStart = 0;
            nTotalCount = 0;
            nextEnd = nextStart + $eachCut;
            $delay = new Timer( $speed );
            $delay.addEventListener( TimerEvent.TIMER,
                                     sendData );
            $delay.start();
        }
        
        public function set span( eachCut:Number ):void
        {
            $eachCut = eachCut;
            nRunLimit = Math.ceil( $string.length / $eachCut );
        }
        
        public function get span():Number
        {
            return $eachCut;
        }
        
        public function interrupt():void
        {
            $delay.stop(); 
        }
    }
}

A little ugly, but again, she does work.

Application.as code

And here is some code from the Application document class. There is an instance of a MovieClip containing a TextField on the stage already, "holder_mc.test_txt". I am copying and pasting some code out of the live class, so if I miss something, the compiler errors/warnings should be able to direct you.

import flash.text.TextField;
import flash.display.MovieClip;
import gs.TweenFilterLite;
import gs.TweenLite;
import net.ericd.v8.content.StringFeeder;
import net.ericd.v8.events.FeedUpdateEvent;
...
var bigText = "huge string here please...* for linefeed";
feeder = new StringFeeder( holder_mc.test_txt, bigText, 10 );
feeder.span = 12;
feeder.addEventListener( FeedUpdateEvent.UPDATED, updateFeedText );
//DONE event only for blur effect. Actually ugly.
feeder.addEventListener( FeedUpdateEvent.DONE, finishedUpdate );
TweenFilterLite.to( holder_mc, 0, { blurFilter:{blurX:5, blurY:5}});
feeder.run();
...
private function updateFeedText( event:FeedUpdateEvent ):void
{
    var tmpString:String = stringReplace( event.value, "*", "\n" );
    event.who.appendText( tmpString );
}
        
private function stringReplace( $str:String, $search:String,
                                $replace:String ):String  
{  
    return $str.split($search).join($replace);  
}
        
private function finishedUpdate( event:FeedUpdateEvent ):void
{
    // Yes, I know, this thing's parent COULD be the
    // document class itself (Application). But since
    // we know what's really going on here, s'ok mb.
    TweenFilterLite.to( event.who.parent, 2,
                        { blurFilter:{blurX:0, blurY:0}});
}

My apologies for this code not being formatted as per long ago. My linefeed settings on publish are a little messed up for posting code, but great for random typing such as this.
  3 Comments     

There aren't too many editors for OS X that I like. Flex Builder 3 is very nice. It feels sluggish though compared to FlashDevelop on the PC.

I know a favorite is TextMate, however it seems to be restricted to AS2 right now, MTASC seems to want to pump out Flash 8 stuff.

Is there a way to get completion approaching that of FD yet outside of Flex Builder? When I declare a private var typed, and FD pumps out the import statement for me, well... that makes my day :) And autocomplete with my own custom classes saves me TONS of time. 

Looking something close on OS X, or else I can just keep using FD on the PC to code with I guess.
  0 Comments     

Looks like netvibes users get server upgrades tonight.
Thank you for showing netvibes your love!

Due to tremendous demand, we're currently upgrading our servers to accommodate the increase in traffic. Rest assured, we're working diligently to have your favorite start page back online very soon.

Thanks again for your patience.

- The netvibes team
Excellent :)
Tuesday, April 22, 2008
Tuesday, April 22, 2008  0 Comments     

I think I have a shiny new MacPro waiting for me back @ work... 6GB of RAM, upgraded video card, a Griffen KVM switch (although I think it might have those squarish USB jacks and not standard... that will piss me off), software, new monitor, etc. Two big drives.

I got it with that super-tiny wireless keyboard, but I hope I can KVM my current ergonomic mouse/keyboard instead. Yes, carpal tunnel syndrome has hit before and I don't want to go through that again, it was awful.

I'll be keeping my PC next to me at the desk for things that have already been set up there, a few PC-only clients, etc. Besides, I'm not altogether keen on buying another copy of XP.

Its time to remove power cables for things like my eMate, Newton, a Nokia N95 I never use, an external development drive that only has a SQL dBase on it that I don't need right now, etc. I sit atop a jumbled mess of cables and dust, but you wouldn't know that by how tidy I keep the desk surfaces.

Randomness:
+ Wow, this Sharks/Flames game is crazy good so far. One team takes a lead and soon™ the other team ties it up.

+ FiOS DVR kicks the snot out of TiVo Series3 in terms of ease of use.
  0 Comments     

AIR

The AIR runtime (at least for me) has been updated this morning (after running Twhirl the notification came up). Now at 1.0 p4990. I have no idea what changes are in the new runtime yet, but glad to see Adobe updating the bits.
Monday, April 21, 2008
Monday, April 21, 2008  0 Comments     

Silverlight, silverlight, wherefore art though?

We saw some splash when you were announced, we saw Mano out and about, the AXNA even has a post every now and then about you. Kind of out of the blue each time.

You have a road map I think I stumbled into by accident not too long ago. But other than the dribbles of news & promises of impact, I haven't felt you at the door, let alone the same continent.

Now, I know you can do some pretty cool things. But I haven't seen many doing those cool things with you yet.

By the way, on my one XP box, I still cannot manage install you. I've tried more times than I have emptied the recycle bin. And you won't stick there. I hope your creators fix that. I have to be on one of my other boxes to see anything done with you.
  0 Comments     

You showed a lot of heart taking it to game seven, but you got your sh*t pushed in this evening. I was hoping the Penguins would get saddled up with you, but looks like the Rangers now.

About FiOS, tonight our new HD-DVR can't tune in channel 75 (Versus). I got the game on NESN just fine, but man... wtf is up with FiOS this evening. That better be a blip, cause we had Versus this morning with the old box.

I just spent 25 minutes on hold with tech support ("speak with an agent") -- speaker phone makes that easy. But I ended up hanging up without speaking to anyone.

Anyone in the Boston area with FiOS having trouble with ch. 75 Versus?
  0 Comments     

We upgraded to a FiOS HD-DVR box since we like their onDemand (Sesame Street, etc. for our son), and we like their viewing Guide (we really prefer TiVo but we would lose both those things if we went TiVo Series 3). Anyway, setting up the new box ourselves, I forgot how to get into the secret menu to change the scaling coming out of the box.

I found it online with a slew of other menu items. I post this for those with FiOS boxes, it's cool what kind of information you can display.

From the online forum post:

With your STB powered on, hit "Power, Select, Select" quickly in sequence from the front panel. To exit the menu, hit "Power" to turn off the STB. The next power up will be back to normal.

The setup menu is where you configure the display, 4:3 override, HDMI settings, etc. is accessed by hitting "Power, Select, Menu". That's different than the diagnostic menu described here.

This menu is how your STB tells you what's going on. Everything from signal quality to channel encryption status to it's IP address and who it's talking to over the MoCA ethernet. The Line Attenuator thread contains a link that describes what the screen looks like and how to find SNR and AGC: »cjhengineering.com/hdtv/cablehdt···diag.htm. However, it's old and Verizon's menu contains additional entries.

I don't think you can hurt anything as this menu doesn't allow for user entry. Read-only. I think...

d01 General Status: Displays a top level error code and lots of times and dates. Remod Channel might be the RF tuner output channel (3). One of the time formats is in "GPS" time. Sorry, it's called either "GMT" or "UTC" whichever is in use (they are different). Might want to report that as a bug, but it's been there since forever.

d03 OOB Status: Out Of Band. On Comcast, this was the RF channel for the program guide. 75.25 MHz. On Verizon, it's used for firmware and channel map and other items to allow you to see the video (and maybe the guide info?).

d04 Inband Status: The status of the current channel, from an RF perspective. WIth the STB ON, select the channel of interest, then access the diagnostic menu. The menu will report the channel it's currently tuned to.

Note: Be careful to note which tuner is in use. My HD-DVR has 2 tuners, the current channel was on Tuner 2, not Tuner 1. I did not enter the diagnostics menu while it was recording, but that shouldn't cause any problems (?).

I checked the SNR, AGC, and correctable errors for a few channels. SNR is >37 dB, AGC "Good", 0 errors. Helpful if you have pixelation errors (those that are not from Verizon) or lose a channel. I mapped a few channels:

Channel Name Frequency Modulation
03 CBS local broadcast 459 MHz 256-QAM
49 WeatherScan local 477 MHz 256-QAM
75 Versus SD 795 MHz 256-QAM
829 Comcast Sportsnet-HD 639 MHz 256-QAM
833 HDNet 501 MHz 256-QAM
846 Discovery HD 669 MHz 256-QAM

Notice that the STB is using the SD digital channels for 2 - 49, not the analog. Knowing the right frequency is very helpful if you think you are having signal problems. Like if you are having a problem on a channel at 800 MHz and not having problem at 100 MHz, check your coax. Or, if you are using a QAM tuner without an STB, you could map frequencies to channels.

d06 Current Channel Status: Displays info about the channel, but with a focus on the digital status. Contains details about the flags used to set copy protection. Those interested in recording over firewire may want to visit AVS forum to understand the DRM and CCI and other bits to determine if a program can be copied / recorded: »www.avsforum.com/avs-vb/showthre···page=148. The menu shown in the link above is old.

d07 Upstream Status: "Ethernet Return". Get your STB's IP settings and MAC address here. DHCP stuff, DNS enabled, RADD Name Resolved (?). Looks like the IP address is configured for IPv6: 0000:0000:0000:0000:0000:0000:192.168.001.100.

d08 Code Modules: The firmware versions. Compare this stuff to the reported IMG Settings.
Platform Built: Version: 19.38, Nov 15, 2007 13:36:00 (Guessing this is the firmware release date, time is usually a version number. Not in the IMG.)
Code objects: fios_0064 version 5.68 (IMG Build Number), odc_0064 version 8.68 (IMG data object filename)

d10 Audio/Video Status: Use this to check the audio and video formats.
Audio: Surround, Video: 16:9 1920 x 1080i 30 (also 4:3 528 x 480i 30 for local SD). The "30" means 30 Hz refresh.

d11 Interface Port Status: All things digital plugged in. Displays status of firewire (1394), USB, MoCA. Like if the firewire port is enabled (Y) and active (N). Page 2 is the display EDID data. It's a map of supported video resolution formats. Helpful for debugging 480i vs. 480p vs. 720p vs. 1080i.
- Page 3 contains details about the 1394 copy protection status, e.g. 5C implementation. Same as D06 menu, but in E-Z read format.

d13 DVR/HDD Status: Hard drive central. Like size (160 GB), disk space, IDE, model, etc. The bottom of the screen contains the hard drive temperature. Temp: 100F 38C, Max: 113F 45.0C, Over Temp: No, Count: 0 (Current temperature 100 deg F or 38 deg C, maximum was 113 deg F or 45 deg C, is not over temperature now, has been over temperature 0 times).

d16 Connected Home: This is how your STB talks to the ActionTec router (that's not my real MAC address). RF Freq: 1150 MHz, MoCA 10/10, RF Password: (blank), MAC/IP: 01:23:45:67:89:AB, 169.254.001.209.

You can match this to the ActionTec router:
Network Status menu: Device: IP-STB1, Connection Type: Coax, IP Address: 192.168.1.100, IP Address Allocation: DHCP, MAC Address: 01:23:45:67:89:AB.
"MoCA Diagnostics Information". Channel: 1 - 1150 MHz, MAC address of the STB (device 1): 01:23:45:67:89:AB, IP Address of the STB: 192.168.100.1. There are other views that show the information a bit differently.

The ActionTec MoCA channels: 1 - 1150 MHz, 2 - 1200 MHz, 3 - 1250 MHz, 4 - 1300 MHz, 5 - 1350 MHz, 6 - 1400 MHz. Don't know if Verizon uses anything other than Channel 1. (Use good coax and splitters that go to at least 1 GHz).
Remember: Do NOT change any parameters that deal with the STB- you may lose your program guide, etc.

I haven't found where the 169.254.001.209 is on the ActionTec, but I'm not expecting to. That's a reserved address that didn't find a host device. Probably for something else, but don't know what.

Back to the STB:
Page 4 (scroll up/down) shows the STB's TX data rates, in Mbps. I think it might be useful for those with home media DVRs that transfer their videos around the house. I don't know, as I don't have one. But it looked interesting. My data rate is around 230 Mbps.

Labels: ,

  5 Comments     

(There are two (2) updates to this post):

I am curious as to the best way to dispatch events from an AS3 class to a listener in another, passing arguments through (I'd prefer properties really). What I have so far actually works, but it requires some arcane knowledge of the inner-workings of the class doing the dispatching (it feels really bad to me at the moment). 

What I have is a custom Event class for dispatching events, and its imported and used from within another class. A third document class listens to the class for events. I'd like to get properties of the returned event like we could in AS2 hackery, but right now I only seem to be able to pass arguments, and then you'd have to know which argument is what to make them useful (bad).

The custom event class:

package
{
    import flash.events.Event;
  public class EventType extends Event
    {
        public var arg:*;
        public var properties:Object;

        public function EventType( type:String,
                                   bubbles:Boolean = false, 
                                   cancelable:Boolean = false, 
                                   ... a:* ):void
        {
            super( type, bubbles, cancelable );
            arg = a;
        }
        
        // Override clone
        override public function clone():Event
        {
            return new EventType( type, bubbles, cancelable, arg );
        };
  }
}


From within the class dispatching the event ("10" is just a test):
...
public static const UPDATED:String = "updated";
...
dispatchEvent( new EventType( ClassName.UPDATED, false, false, "10" ) );


And from the document class:
...
classInstance.addEventListener( PartitionGauge.UPDATED, updateListener );
...
private function updateListener( e:EventType ):void
{
    trace( e.type );
    trace( e.arg.length );
    trace( e.arg[0] ); // wtf is this really supposed to be?
}

So you can see that this approach does work, but you'd have to have special knowledge to get the .arg from the returned event, and you'd also need to know what each index of the returned arguments actually map to. It would be cool to be able to pass back a property on the event itself, like:

trace( e.value );

and thing like that. I haven't figured that part out quite yet, and I've spent time googling and haven't found a whole lot just yet. But there must be a pretty easy to use solution for this kind of thing. I'd hope.

Update:

Well, I've come across a different approach, and it's similar to the one above, but instead of arguments it uses properties on a returned object. At least that is more approachable, although you need an intermediary object to inspect through.

Here is the class:

package 
{
    import flash.events.Event;
    public class CustomEvent extends Event
    {
        public static const DEFAULT_NAME:String = "CustomEvent";
        public static const ON_UPDATE:String = "onUpdate";
        public var params:Object;
        
        public function CustomEvent( $type:String,
                                     $params:Object,
                                     $bubbles:Boolean = false,
                                     $cancelable:Boolean = false )
        {
            super( $type, $bubbles, $cancelable );
            this.params = $params;
        }
        
        public override function clone():Event
        {
            return new CustomEvent( type, this.params,
                                    bubbles, cancelable );
        }
        
        public override function toString():String
        {
            return formatToString( "CustomEvent", 
                                   "params", "type",
                                   "bubbles", "cancelable" );
        }
    }
}


And within my class that dispatches the event (test properties here):

...
import CustomEvent;
...
this.dispatchEvent( new CustomEvent( CustomEvent.ON_UPDATE,
                                     {value:"10", foo:"hello" } ) );


And now in the document class

...
classInstance.addEventListener( CustomEvent.ON_UPDATE, updateListener );
...
private function updateListener( e:CustomEvent ):void
{
    trace( e.type );//onUpdate
    trace( e.params.value );//10
    trace( e.params.foo );//hello
}

So, that's a little better. You still have to access through the params object instead of simply on the returned event object itself, but it's better, don't you think?

You don't have to parse through arcane argument indexes wondering what they are. At least with properties you can use the name of the property outright. And that makes the whole thing more approachable.

Update 2 (yes, another one):

Well, here is something that is more approachable still.

package 
{
    import flash.events.Event;
    public class CustomChangeEvent extends Event
    {
        public static const CHANGE:String = "EVENT_CUST_CHANGE";
        public var who:*;
        public var value:Number;
        
        public function CustomChangeEvent( type:String, who:*, 
                                           value:Number )
        {
            super( type );
            this.who = who;
            this.value = value;
        }
        
        public override function clone():Event
        {
            return new CustomChangeEvent( type,
                                          this.who,
                                          this.value );
        }
    }
}

You will get code completion in FlashDevelop, you can access the properties of the return event object, you get strong typing for some of it (I left who as a wildcard right now since it's not settled what it will be yet, probably a Sprite though). When I make that change, the class will have strong typing through it, and everything will be nice and neat.

I think this approach will truly work well in any circumstance.
  0 Comments     

I don't use the Office suite much at all, but my wife certainly does. And Office 2008 looks so nice on a Mac, I really must admit.

However, when she launches Excel, most of the time it just beachballs on her. If it manages to launch without crashing or hanging, she can't work in it for long before it does crash. Word is the same way. Its actually difficult to ForceQuit the apps, as the Finder gets hung for a while during all of this. What a p.o.s.

Now, we can always go Open Office, iWork, etc. but wouldn't you think Microsoft's flagship software suite outside of an OS would actually work? The 12.0.1 update was supposed to fix hanging and crashing, but guess what... it didn't.

I don't think its too much to ask to get a working software. How did QA let this out the door? I'm seeing tons of people via Google having the same problems... and switching to other things.
Saturday, April 19, 2008
Saturday, April 19, 2008  0 Comments     

I haven't logged into Live! to play Halo3 in ages, because it was getting boring. We all went to CoD4. However, I am downloading the Legendary Map Pack right now (the new maps look great and Forge gets new items). So I'll be all over Halo3 sometime tonight ;)

Labels:

Thursday, April 17, 2008
Thursday, April 17, 2008  5 Comments     

If you haven't heard or played very much with mySQL SQLite and AIR, but you'd like to learn more, then check out this video. Peter Elst does a really fine job explaining the major classes you'll need to employ and how to get rolling with mySQL SQLite in AIR.

Once you get going, you might want to have a little SQL statement guide (although there really aren't that many statements to remember are there?) You'll be using mySQL regardless of need... just because it's so cool to use.
      


A truly tasteless cover.
  0 Comments     

A quick test of formatting from FD.

private function updateScrollBar():void
{
    TweenLite.to(optionSelector.thumb_mc, 0.2, 
    {y:INITIAL_THUMB_Y+__currentMenuIndex/(nContH/nDocH)});
}
  1 Comments     

Update:
Man, it's like I'm having a conversation with myself here. Once I blurt out something here, only a few moments later do I have a revelation about how lousy the previous post might have been.

As it turns out, I don't need the class below (TypeDescriptor) unless I really want to dig into the hierarchy, and if I did, I would need to re-factor the class in a major way to make it actually useful in an abstracted kind of way.

Or just leave it to a developer (including myself) to worry about. For designers, they probably never need to see the XML output of describeType... ever.

So all a designer really needs to worry about is:

trace( getQualifiedClassName( this ) );
trace( getQualifiedSuperclassName( this ) );

And that's it really. All my class was doing was breaking the describeType down a little bit, and that's a sincere waste of time.

Forget about all the posts and class crud I've buggered this blog up with. It's all nonsense now that I've spent more time in the flash.utils documentation. The two classes mentioned above are most of what anyone might need.
package
{
import flash.utils.describeType;
public class TypeDescriptor
{
public function TypeDescriptor()
{
}

public function getType( sValue:String, value:* ):String
{
var varList:XML;
var result:String;
switch( sValue )
{
case "typeName":
varList = describeType( value );
result = varList.@name.toXMLString();
break;
case "typeBase":
varList = describeType( value );
result = varList.@base.toXMLString();
break;
case "typeIsDynamic":
varList = describeType( value );
result = varList.@isDynamic.toXMLString();
break;
case "typeIsFinal":
varList = describeType( value );
result = varList.@isFinal.toXMLString();
break;
case "typeIsStatic":
varList = describeType( value );
result = varList.@isStatic.toXMLString();
break;
default:
result = "error";
break;
}
return result;
}

public function getExtendsClass( value:* ):String
{
var varList:XML = describeType( value );
var result:String = varList.extendsClass.@type.toXMLString();
return result;
}

public function getImplementsInterface( value:* ):String
{
var varList:XML = describeType( value );
var result:String = varList.implementsInterface.@type.toXMLString();
return result;
}
}
}
  0 Comments     

I get the following error when I launch Digital Editions:

"Can't find Digital Editions folder."

And that's it. I have uninstalled and installed again, and I get the same error. Obviously Add/Remove isn't removing a prefs file someplace or something related to that. So for now I can't use it, and I finally have enough PDFs, etc. that I think it would be really useful. I've pinged the Support Forum for DE too, hoping someone can clear this up.

Update:
Sorry for the noise. 

My "My Documents" folder is mapped to a network drive, and thus the "My Digital Editions" folder was nowhere to be found by Adobe Digital Editions.

All I needed to do was create one on the network drive mapping, and things are working now.
  0 Comments     

I'm not really sure if something like this is very useful, but it does hide the guts of implementation away from a designer.

Basically it's a class abstracting describeType a little bit more so a designer doesn't need to look at the E4X stuff and get spooked by it. They don't even have to know about describeType at all.

package
{
  import flash.utils.describeType;
  public class TypeDescriptor
  {
  public function TypeDescriptor()
  {
  }
  public function getTypeName( value:* ):String
  {
  var varList:XML = describeType( value );
  var result:String = varList.@name.toXMLString();
  return( result );
  }
    }
}

And the usage is pretty simple:

import TypeDescriptor;
var foo:TypeDescriptor = new TypeDescriptor();
trace( foo.getTypeName( ["hello", "sup"] )); //Array
trace( foo.getTypeName( 5 ) ); //int
trace( foo.getTypeName( "hello" ) ); //String
trace( foo.getTypeName( new MovieClip() ) ); //flash.display::MovieClip
trace( foo.getTypeName( JessicaAlba ) ); //JessicaAlba (class from IDE & instantiated in the class itself)
trace( foo.getTypeName( this ) ); //if in a class (Application), something like com.ericd.projectOne::Application

Again, not very useful for developers perhaps, but it makes life easier on a designer. And I suppose you could add methods to retrieve different parts of the XML (base, isDynamic, isFinal, isStatic, etc.)
Wednesday, April 16, 2008
Wednesday, April 16, 2008  0 Comments     

Tonight, despite the valiant efforts of the Ottawa Senators, my Pittsburgh Penguins brushed them aside by applying the broom. As Mike Lange said, "The kitchen is closed."

The Senators threw the kitchen sink at the Pens there at the end. Congratulations to the Sens for the effort. Maybe you can hang a mural of the handshake on the other side of the arena, this time the Penguins winning (to match the mural of the Pens losing last year that you put up). Even after that, I respect your players.