Some favorite site feeds aggregated locally: iPhone Development RSS   Adobe Labs RSS   Macrumors RSS

Monday, June 30, 2008

Arthropod + Serial Port can be bad

Monday, June 30, 2008    0 Comments

I'm running Arthropod within an application that runs a socket connected to a socket server serving up data via a serial port connection.

Every now and then my messages coming in over the socket seem to get stomped on. Meaning I get NaN for somethings, etc. The message is always delivered, but the contents are wonk.

Without including the class, things work great. I don't know if it's because localConnection and the socket running at the same time equals wonkiness or not, but I thought I'd put this information out there.

For now I'll have to debug via other means (perhaps my own debug class that uses simple statements to print out to an application GUI element within the application itself instead).
 

Sunday, June 29, 2008

iTunes Bug

Sunday, June 29, 2008    0 Comments

Pat Monahan from Train was in my high school class for two or three years, and I checked iTunes and he has a solo album now. I previewed a track, and instead of playing 30 seconds, it's playing the whole thing. It's doing it for each track too. This is a kind of cool bug ;)

Weird. I closed iTunes and now one track is still playing. So it was possible to initiate playback on more than one track at a time. Laptop must have gotten into a weird state before launching iTunes.
 

Saturday, June 28, 2008

Saturday Morning Code

Saturday, June 28, 2008    0 Comments

Extra-large Dunkin Donuts coffee, Ryan playing with his animals, some classical music on the Nose, my wife holding our daughter, and a print out of the week's coding in hand with highlighter pen. Ahh... a nice way to spend an hour on a Saturday morning before the day kicks into gear.

Plans for the weekend are set, yet already I am thinking to Monday and the modifications to the code base I plan on making. It almost ruins the weekend, it's my fault I know. But there is something magical about making things happen in software.

Have a great weekend, until Monday comes calling. Short week too with the Fourth of July celebrations and everything. God bless America.
 

Wall•E mini-review

   0 Comments

No spoilers.

I just returned from a 10:15PM showing of Wall•E (namely because of the kids, etc.) so I went into it pretty tired. The theater was PACKED, even at such a late showing. It had to be close to sold out, and this was one of the larger spaces in the theater (stadium seating).

Pixar really outdid themselves here. They took a big gamble with this film in my opinion... almost zero dialogue and they were forced to display emotion with pantomime. They did an incredible job.

The rendering and animation are gorgeous. I used to do a ton of 3D, and this stuff is amazing. They added oodles of atmospheric touches everywhere without making things look too real.

The emotion displayed is incredible and smooth. I looked for moments where the animators and scene artists took liberties for sake of completing the film and didn't find any... Pixar are masters of their craft. You can tell they love what they do by the attention to detail in everything. They add subtle motions and effects everywhere where they could have gotten away with some straight keyframing.

When Wall•E powers up (solar), the chime he emits when complete made the audience cheer every time. If you're a fanboy like me (and many in the audience), you'll recognize that chime immediately.

It's rated G, but there were a few parts in there that I think would have scared my son... so while it's rated G and 98% toddler friendly, just know that there is a tiny bit of gun play and explosions.

This is a great film. I'd see it again. Not just because I was dead tired watching it, but it's really wonderful on numerous levels.

*yawn* Time for some shuteye.
 

Thursday, June 26, 2008

FlashDevelop Request: Method Sets / Folding Triggers

Thursday, June 26, 2008    4 Comments

When I get into some lengthy classes (namely perhaps a document class), I have specific methods in relation to other classes or functionality. I usually try to group them inline in the class (one after the other). After a while I end up with blocks of code specific to something... and sometimes I need to spread some public methods down @ the bottom where I usually keep all my public methods, just for style reasons (and ease of location).

It would be nice to somehow group these methods so I could easily expand & collapse sets of methods with a single click. What I mean here is folding triggers.

This would require another Panel in FlashDevelop. By default it would be empty.

Right-click on a folding marker, and you could Create And Add To Nesting Set, or Add To Nesting Set, or Remove From Nesting Set.

The panel would show the labels you give the sets and perhaps optionally the methods contained in it (a tree mb). You could simply use a check box to the left of the Set title in the panel to expand/collapse the Set easily. The panel would allow you to rename the set labels, etc.

I think this would be a big time saver. Thoughts?
 

Quicklook plugin for SWFs

   2 Comments

[UPDATE]

Head over here for an updated QuickLook plugin. I've tried it a few times now and it's working for me. The dimensions of the SWF aren't enforced but who really cares about that? It's useful and I have requested the source so that I may possible improve it... as danieltoo mentions crashing, etc.

Remember after "installing" the plugin to log out and back in to activate it.

I found a Quicklook plugin that is supposed to work for SWFs. However, when I try it, I only get the HTML with no SWF running within it. I can't tell if the player has instantiated as Quicklook views don't allow for right-clicks in them.

The contents of the preview.html file:

<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="Main" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/
current/swflash.cab">
<param name="movie" value="%@" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="%@" quality="high"
width="100%" height="100%"
name="Main"
align="middle"
play="true"
loop="false"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</body>

The binary for the plugin must somehow pass that "%@" in there with a file path... but it seems like it's failing for me. Could this be a sandbox violation of some kind? I can't see what the binary is trying to do here. Pointing to a .cab file is pretty strange, ain't it?

The link to the plugin can be found right here (ZIP FILE).

Any insight would be cool... as a SWF Quicklook plugin would rock pretty hard.

Update:
I tried placing an image into the quicklook, and it ONLY works locally (inside the package)... calls to the web fail. So I know the HTML control is there, but the SWF itself doesn't seem to load at all yet.

I wish I knew who made this thing or if anyone had a little XCode Project I could peak at.

Update 2:
Screw it, I might just start developing my own in XCode. I hope it's not too difficult. I mean, it's an HTML control with a plugin call within it (I think). I just got a PDF from the Apple Developer Connection.
 

Lazy imports?

   2 Comments

I like verbosity, no question, but I wonder if it matters in the case of using general imports:

import flash.display.*;

versus

import flash.display.Sprite;
import flash.display.BitmapData;
...

I mean, using a wild-card in an import allows you to forget about being really specific and knowing the compiler will only include classes that you actually use in your application. Does it really matter as a point of coding style? 

For me, the wild-card is more than acceptable. But I can see where some might like to see completely verbose imports to clear up any possible confusion for a someone else perusing the code.
 

goosh: unofficial google shell

   0 Comments

This is a pretty cool javascript application (goosh) here, powered by Google. Definitely created for the battalions of geeks out there.
 

Wednesday, June 25, 2008

Create your own magazine, for free

Wednesday, June 25, 2008    0 Comments

Supposedly this site (MagCloud) allows you to upload your high resolution artwork as PDF and it's on-demand printing for those ordering copies. Kind of like Café Press for magazines.

Might be pretty cool to create a copy of a magazine and order one myself just to see how well it turns out. A kind of neat concept... could go hand-in-hand with podcast releases.
 

Yet another Silverlight browser crash

   0 Comments

Well tonight Silverlight decided to kick the latest release of Firefox 3 (3+) squarely in the nuts. I spotted a twit from MossyBlog with a link explaining why he joined Microsoft, complete with to visit URL. That site bombs after a few seconds of playback.

And it's been a few other sites that have sucker-punched my browsing face. Granted, there are a whole lot of Silverlight sites out there, I am looking for them (still). And they have been ready for me, ready to end my browsing temporarily. 

Damn Silverlight...
 

TONS of Wall•E featurettes

   0 Comments

I just got a million links to cool WALL•E featurettes (behind the scenes, etc.)

This movie looks pretty fun, so I know the videos are of interest to me. Here are the links for your enjoyment. There are certainly lots & lots of them.

WALL•E – “Lots of Bots” Featurette

Quicktime:

High

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_LotsBots_High.mov

Medium

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_LotsBots_Med.mov

Low

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_LotsBots_Low.mov

Flash:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_High.flv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_Med.flv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_Low.flv

Windows Media:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_High.wmv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_Med.wmv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_Low.wmv

iPod:

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_LotsBots_iPod.m4v.zip


WALL•E – “A Space Journey In Sound” Featurette

Quicktime:

High

http://bvim-qt.vitalstream.com/WallE/SpaceJourneyInSound/WallE_SpaceSound_High.mov

Medium

http://bvim-qt.vitalstream.com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Med.mov

Low

http://bvim-qt.vitalstream.com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Low.mov

Flash:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_High.flv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Med.flv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Low.flv

Windows Media:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_High.wmv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Med.wmv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_Low.wmv

iPod:

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/SpaceJourneyInSound/WallE_SpaceSound_iPod.m4v.zip


WALL•E – “The Man & The Machine” Featurette

Quicktime:

High

http://bvim-qt.vitalstream.com/WallE/Podcast_ManAndMachine/WallE_ManMachine_High.mov

Medium

http://bvim-qt.vitalstream.com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Med.mov

Low

http://bvim-qt.vitalstream.com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Low.mov

Flash:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_High.flv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Med.flv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Low.flv

Windows Media:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_High.wmv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Med.wmv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_Low.wmv

iPod:

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Podcast_ManAndMachine/WallE_ManMachine_iPod.m4v.zip


WALLE – “Pixar Goes To Space” Featurette

Quicktime:

High

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_PixarSpaceFO_High.mov

Medium

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_PixarSpaceFO_Med.mov

Low

http://bvim-qt.vitalstream.com/WallE/Featurette/WallE_PixarSpaceFO_Low.mov

Flash:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_High.flv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_Med.flv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_Low.flv

Windows Media:

High

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_High.wmv

Medium

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_Med.wmv

Low

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_Low.wmv

iPod:

http://http.vitalstreamcdn.com/bvimflash_vitalstream_com/WallE/Featurette/WallE_PixarSpaceFO_iPod.m4v.zip 

 

Reserved IDE import & package import?

   0 Comments

One thing I'd like to see in regards to import statements on symbols coming from the IDE's library... demand an implicit import statement. I've seen a few document classes out there that call up class objects from the SWF's library. This is cool, but when you look at the document class, you just see something like

var foo:Sprite = new ClassName;

That's cool if you're the only one who will ever look at the document class, but it makes others wonder where the hell that thing is coming from. Perhaps something declared like:

import $ide.ClassName;

Then you could use that asset ... or something to let the world know where that thing is coming from. I don't know the specifics of the ramifications of this, but sometimes I run into this myself. I set up an asset in the SWF and it's subclassing something (say Sprite) and it has it's own class name. It's then simply used in the document class. It confuses some other developers... they don't know where it came from until I tell them its in the Library set to export to that class name. 

I suppose I could just link it to my own class for it and be done with it, but that's a bit of pain in the ass. Well, it can be if it's just a simple UI element.

So maybe something reserved so it's clear its not part of someone else's package. I don't know. It would help a bit... and on the topic of imports...

You can instantiate class objects in a class as long as the classes are all in the same package without using import statements... the compiler looks and finds them. 

...
var foo:SomeClass = new SomeClass;

Without an import statement, you have to check the package directory and look for that class. 

An import statement is best form in my opinion. Not importing saves you a few seconds of time but adds confusion to anyone else combing your code.
 

Reading other developer's code

   1 Comments

I just a wonderful hour-long experience going over multiple classes with a fellow developer. Sometimes talking about unfamiliar code someone else wrote can rock!

So my buddy Andrew wrote a bunch of classes in the scope of a larger application, and sent them over the fence to me via email. To see what he was doing, I printed the classes out and started marking up where they worked, etc. After ten minutes of doing that, I ran over to Andrew's cube and we just talked code for an hour. It was great to learn someone else's code quickly on the cuff, asking questions, making suggestions, etc. 

I think I learned more about OOP and AS3 in that hour than I have in the past two weeks. All because I was starting with code I didn't write, didn't influence, and wanted to find out how it worked quickly. Sometimes we're all guilty of coding on our own cozy island and forget, as Neil Peart stated in Natural Science, "living in their pools they soon forget about the sea." 

It's a great way to get yourself out of a little rut too. Andrew and I were coding up very similar stuff, but his take on it was somewhat different than mine. Made me think about what I was doing, what he did, and what we can combine it to make.

An awesome end to a Wednesday of coding. 
 

Tuesday, June 24, 2008

zomg crazy

Tuesday, June 24, 2008    0 Comments

Spotted this making the rounds on the internets:

From: ---- --------
Sent: Monday, May 5, 2008 4:37 PM
To: Everyone
Subject: Server Room Access

Hi all.

As you all are aware, we have new tenants that have moved into the 2nd floor suites. The access to the server room is now via the women’s bathroom.

There will be a sign on the woman’s door that can be changed from OPEN to CLOSED and vice versa.

Should you need to enter the server room, please change the sign to CLOSED. Once you are done, please change it back to OPEN.

Once you enter the bathroom, you will be able to access the server room via the handicapped stall. Please close the stall door prior to entry, just in case someone doesn’t see that the bathroom is closed.

I know this isn’t ideal, but if we adhere to this protocol, I don’t think anyone will be disrupted.

Thanks! Let me know if you have any questions.

---- --------
Building Management
 

Blackberry usability really blows

   2 Comments

[grain of salt: yes, I am a fanboy]

I'm holding on for July 11th when the iPhone drops, but my wife was shopping for a Blackberry at Verizon to replace her current phone for personal/work use. She knows I'm all about the iPhone, but I went to the store with her with an open mind. Honestly.

So we had a few models to look at, and the form factor of these things were okay. Not great, but they seem attractive enough. The models we saw were the kind with devoted qwerty and another with doubled-up ascii per button (yuk).

Diving into one (I don't remember which... Pearl, Curve?) I was immediately presented with about 20 icons on the home screen. I had to navigate around with one of those old IBM-like thumb ball controls. And the list of icons would scroll around on me when I hit an edge. Okay. Hard to use, but let's check out some messaging and email.

The font was ENORMOUS and ugly, and I tried using the settings to change it to something modestly attractive. All the fonts began with a "BB_" so it looks like these were custom fonts. Cool... maybe they spent the time to make some good ones. Yuk. None to be found.

Okay font ugliness aside, let's see how easy this thing is to use. After 15 minutes I came to the conclusion that I honestly felt like I was fighting with the phone to do anything. No, I didn't read a user manual, but should I really need to? It's a freakin' phone.

I picked up a Win Mobile phone and it was MUCH easier to use. I actually kind of liked some of it, probably only because I still have an ancient Toshiba PDA whose software looks like Win Mobile (even after all these many years).

Blackberry? I wouldn't take one if it were free. Too bad.

I have an N95 that suffers the same for me... sits unused because it's a freaking nightmare to use. Looks awesome and has tons of features. But right now it's main feature is preventing dust from settling in a 99 x 53 mm area on my desk.

My wife came to the same conclusion on her own after we met back up to talk about which model we liked the best. She had every intention of walking out of the store with a Blackberry of some flavor.

Unless the iPhone gets sweet Notes integration (Notes... yuk), she will probably pass on an iPhone. She could always use the browser to view emails, but that's lame. My suggestion without switching carriers and giving the iPhone a go would be Win Mobile.

My prediction though... when I get my iPhone, she's going to want to use it a lot, and probably snap one up too.
 

Monday, June 23, 2008

twhirl and iTunes video bug

Monday, June 23, 2008    0 Comments

On Windows XP, if you run twhirl & pop open a video from iTunes (out into it's own container), the always on top twhirl client suffers from some BIZARRE screen redrawing bug. The iTunes video playback breakout window is set to always on top, as is the twhirl client, and it flickers back and forth. I tried taking a screenshot of it, but it always catches the flicker with the twhirl client on top without evidence of the flickering. I have no idea where the bug lies, but this isn't great behavior. I'm sure this isn't just targeted at twhirl but any AIR client running on top, perhaps any app set to always on top too.
 

I almost drank out of this...

   1 Comments


I almost drank water out of my adobe water bottle a few minutes ago. I left it at work over the weekend with some Crystal Light concoction in it.

I dumped the concoction out, filled it with water twice (the first being a lame rinse attempt), and went to take a long, cool drink when in the corner of my eye I noticed a little something floating on top. 

Further investigation revealed to my horror that a family of spores had taken up residence at the bottom, awaiting my sickly ingestion. Holy cow, that was a really close call of a Monday nasty.
 

BitmapData draw clipRect

   2 Comments

I've found a situation using BitmapData that I'm sure many have run into. I have a sprite whose registration point is smack dab in the middle of it.

If I'd like to copy that Sprite and use it somewhere else too as a copy, I have to nest the Sprite in another Sprite so the registration point of the outer DisplayObject is 0, 0 and thus when I take a scrape of it using BitmapData, I don't just end up with the lower right quadrant of it.

I looked at the clipRect property of the draw method, and I tried negative x & y for it... which work GREAT for me here to avoid nesting... but it doesn't seem to work correctly at all.

var bmp:BitmapData = new BitmapData( 100, 100, true, 0xFFFFFF );
bmp.draw( someDispObj, null, null, "normal",
new Rectangle(-100,-100,200,200),true);

mySprite.addChild( bmp );

Hrmm. Well, for now it seems like I am shackled with nesting which is okay I guess. Just wish I didn't need to do that. Any solution in avoiding nesting to get something like this rolling?

Update:
Quasimondo (Mario Klingemann) posted a response to this posting here. I haven't tried the solution yet for scaling and rotation:

function snapClip( clip:DisplayObject ):BitmapData
{
var bounds:Rectangle = clip.getBounds( clip.parent );

var bitmap:BitmapData = new BitmapData( int( bounds.width + 0.5 ),

int( bounds.height + 0.5 ), true, 0 );

bitmap.draw( clip.parent, new Matrix(1,0,0,1,-bounds.x,-bounds.y) );
return bitmap;
}

 

Sunday, June 22, 2008

Aiptek on the weekend

Sunday, June 22, 2008    2 Comments

My master plan has succeeded... purchasing a cheap HD video recorder with a small form factor actually equates to much more footage shot. And perhaps a few extra digital snaps as well.

The family and I braved the humidity to pay a visit to nearby Drumlin Farms. My son loves the cows and pigs and owls they have there. Without even thinking about it, I placed the Aiptek in my pocket and when cute time rolled into view, I was able to quickly start shooting 1080p footage for posterity. No tape needed. SDHC is all you need to join the party. With 8GB I have around two hours shooting time. Maybe. I'll grab a 32GB sometime here soon™.

It's nice to catch a break from coding on the weekends, especially when you can hear the rumbling of the code collection truck amassing momentum for Monday morning. And with really portable video shooting capability, I'm able to save these moments away for later in life.
 

Saturday, June 21, 2008

IK & Box2D

Saturday, June 21, 2008    1 Comments

Recently I started to roll my own IK engine... I started out needing some simple limb swinging with a joint, but it gradually started turning into a real IK engine. So I decided that I needed to stop and simply implement something already out there.

I just stumbled upon Box2D because of an aggregated post on AXNA.

This looks really promising and I hope it doesn't add a ton of overhead to implement. I am after some IK physics, yet have a lot of control over a drop behavior (watching a IK figure crumple to the ground is realistic only if you don't care if the person is supposed to have life in them).

I'm ultimately after some realistic human figure motion on drag, and when I drop the IK figure, it drops and stands up a bit (balancing up). No crumple to the floor. I was rolling my own engine so I would have total control over something like that, but I am going to investigate Box2D to see if I can set up some physics and have enough control to roll it out.

Funny how you never think you'll need some aspect of Flash only to find yourself chomping at the bit to figure it out and deploy it.
 

AS3 starting to look like Cocoa

   3 Comments

Took a look at some cool betaruce code and ActionScript is starting to look a little like Cocoa (meaning kind of jumbled and ugly to look at... Cocoa code has eight billion brackets):

// original position
public var oldV:Vector.Vector.<Vector.
<Point>>;
// target position for vertices after click and each drag public
var newV:Vector.Vector.
<Vector.<Point>>;
// coordinates for rendering e.g. when point going to final pos
public var renderV:Vector.
<Vector.<Point>>;
I imagine it will only take usage and time to get used to,
but those vectors honestly look pretty ugly.


 

Friday, June 20, 2008

Now that's a setup!

Friday, June 20, 2008    2 Comments

I added some hardware to my office at work, and it's all sitting atop a nice cart I can move around as I need to. Why a cart? Well, I'm using a 42" Westinghouse 1080p LCD as a monitor for a suped-up Dell with a monster graphics card and plenty of RAM.

I ran some Cat-5 from my ethernet hub to the new machine and slapped it on the network, mapped a network drive where I keep a ton of my development files, and it sits there in order for me to test certain applications I am writing.

I code on another PC at my desk (mainly just for the 24" Dell and the FlashDevelop on it), I have the FLA on the network open on my 8-core MacPro.

I make a few tweaks in FD, publish on the Mac (another 24" Dell), and via a shortcut to the SWF on the network I am viewing the new application. It's awesome... and with MTASC I can get around the whole Mac thing and inject bytecode from the classes... but I am usually making tweaks to visual library assets there.

I could do the SVN thing (and I will anyway), but I don't need to worry about updating a repo or anything. Publish, done.

I'm getting LCD-burn from being surrounded by the walls of light, but it's an awesome environment. I took some pictures of the setup too. Maybe I'll upload those.
 

Wednesday, June 18, 2008

Popcorn consumption behavior

Wednesday, June 18, 2008    0 Comments

How do you consume popcorn?
  • Handfuls @ the theater, basically all consumed by the time the feature is only five minutes old.
  • You peck at your bag at the theater, rationing the stuff to last as long as you can
  • By the time the opening credits have started at the theater, you're already thinking of going back for more
  • You dislike popcorn or can't eat it for dietary reasons
  • You dabble with it a little at home
  • You have been referred to as a professional popcorn eater, or a farm animal
A weird topic I know, but I usually power through the stuff at the theater trying to maintain that popcorn taste in my mouth in an uninterrupted fashion. It's almost embarrassing, but what the hell. I do the handfuls thing, and it's gone early in the movie.

Normally my gums and tongue string a little from all of that overly-iodine tasting mineral sprinkled all over it... with a mild drenching in the liquid quasi-butter concoction.

Anyway, I had a good coding session today and came home to have some popcorn and noticed I had a nice perimeter of kernels spread around me in a almost even pattern.

I lost track of what I was doing and had to wash my hands before I laid them on this laptop keyboard. A black Macbook shows smudges pretty easily ;)

Happy Thursday evening. Celebrate the code you wrote today, the checkins you made, the code reviews you helped with, or the stuff you designed and played with.
 

Ragdoll physics approach?

   0 Comments

Greetings community,

I am looking for some source or ideas or validation for the following application feature:

By now you've all probably seen street view for Google maps. It's a great feature, and on the map is an icon of a person, which you can pick up and drop where you'd like to set your location. Cool enough. I am looking for something similar, but using a little ragdoll physics. Maybe, or maybe not.

What do I really mean? A clip of a person that I can pick up by the head, move around & get some sway in the arms and legs (within normal human body ranges), and I can place back down without them falling down (they always land on their feet and stand @ attention). The "person" would not need to rotate in 3D space, and I don't think there would need to be velocity injected on a side to side drag.

My initial thoughts were that I could simply add a little random movement in the limbs, and the random ranges would be set by me to mimic IK. Since the "person" could only be manipulated by grabbing their head, this probably doesn't need to be true IK at all, or even ragdoll.

I could use a shadow to create the illusion of 3D space (grab the head and drag upwards = growing shadow beneath... but only a certain number of pixels allowed in the upwards grab).

Now, if there were items in the scene that we no-no's in regards to placement (tables, chairs, stairs, outside a defined space, etc.) then that movement could probably be detected with an offset of the head location during the grab.

Does this seem like the correct approach? This would be to drag a "person" around a top-view or 3/4 view inside rooms in a home.

Update:
I have the basics working pretty well already, but the one thing I need to do in regards to simulating IK is when the upper arms rotate (using TweenLite for AS3 and a method to produce a range of random values based on rules), the lower arm needs to remain pinned to the bottom of said upper arm segment (think elbow), while introducing some of its own rotation.

In a way this is pretty fake IK, but I think the effect will work.

I *could* use the onUpdate method and reposition the x,y of the lower arm segment while it does it's own rotation. This should probably suffice.

Update 2:
I took a different approach, creating joints (Sprites) on the end of limbs and then attaching a limb to that which will rotate with the upper limb and be able to independently rotate on its own based on rules. This is working really well for me at the moment too.
 

Tuesday, June 17, 2008

My quick Aiptek A-HD+ review

Tuesday, June 17, 2008    5 Comments

Tonight I grabbed an Aiptek A-HD+ 1080p video camera, a 8GB SDHC card and a little media card reader (which I didn't really need). I figured since it's so small, I might capture video more often than I do now with a larger expensive video camera.

Upon opening the thing up, it's remarkable how light the thing is. Of course no tapes or drives or optical media... just the SDHC card you need to supply with it. And the fact that the entire thing is made of plastic. This is good & bad. The lightness results in the need to keep a steadier hand (there is no stabilization in this thing). However the lightness also means you can easily slap it in your pocket for easy travel.

You can capture video from your HD TV if you have AV outs... our big Samsung LCD doesn't seem to have them, although I only spent a few seconds looking back there... the TV has a million inputs, just not many outputs.

I shot some low-light interior video at 720p (30fps and 60fps) and the video quality was pretty decent for such a cheap unit. I then shot at 1080p (30fps) and it looked pretty tight, but reducing the 1080p down by 50% resulted in a really crisp video image. So you could shoot 1080p knowing you'll take it down to 720p yourself. I tested this on a Macbook and not on our big set yet, but I know it will look pretty good.

The microphone on the unit pretty much sucks. It's passable for most situations, such as family events and the like, but nothing approaching professional (or even stereo for that matter). Again, the unit is cheap, so I wasn't expecting a completely amazing experience here.

For the money, this thing is really awesome. I was suprised even though I read a lot of reviews on it before deciding on it.

I know a lot of people (vBloggers, Adobe employees, etc.) are running around with those Flip Video units, and they are cute and portable. But they can't touch the Aiptek A-HD+. Maybe the audio on those things is better, but everywhere else the Flip gets shattered (for about the same price too).

Go out and try one out. It's easy money spent.
 

Flash playing on iPhone emulator!

   1 Comments

Speaking during its fiscal second quarter conference call, Adobe CEO Shantanu Narayen revealed that the company has a version of its Flash Player running inside the iPhone Emulator.

In response to a question about possible Flash support on the iPhone 3G, Narayen said, “With respect to the iPhone, we are working on it. We have a version that’s working on the emulation.

This is still on the computer and you know, we have to continue to move it from a test environment onto the device and continue to make it work. So we are pleased with the internal progress that we’ve made to date.”

Following the release of the iPhone Software Development Kit, Adobe stated its intent to bring the Flash Player to the iPhone, noting that integrating the software with the Safari browser would require “work with Apple beyond and above what is available through the SDK and the current license around it.”
 

Super Fuzz, Fenway

   0 Comments

Spending the afternoon inside Fenway Park, running around the locker room, sweating it out behind the scoreboard, spitting from the Green Monster, listening to live music, eating some park food & generally misbehaving at our company group event. 

It should be a good time, the team is out of town so it's time to round the bases (they won't let us do that though). Parking will be part of the fun (I opted out of taking provided transport). 

I prepared a bunch of files and DVDs earlier, and bumped into this trailer to a movie that I remember seeing eight million years ago. I still remember seeing it, it was that bad. Maybe you've seen it too?

Crazy stoopid.
 

Monday, June 16, 2008

Looking for a better alternative to Flip Video Mino

Monday, June 16, 2008    2 Comments

[please comment with your suggestions/reviews ]:

We own a Panasonic something or other, it's pretty bulky, it's mostly the suck and uses those little tapes. We never use it even though we spent a lot of cash on it. So we're looking for something much more portable.

I noticed a lot of people are into the Flip Video Mino, however I heard it's kind of awful on the Mac... importing into iMovie or Final Cut Pro ends up in exports with no audio track or spotty audio.

Not a great solution, and while the unit seems really small, the video quality seems to be fairly marginal for recording life events that you want to remember (ie. lack of resolution).

So I was looking at the DXG-569V HD camcorder. Anyone have thoughts on this device, or other portable devices? We like our digital camera, so we don't need or care about stills from a video recording device.

Great resolution, portability (equate to more likely to actually use), and price are the driving considerations.
 

Sunday, June 15, 2008

A take on the progress of RIAs

Sunday, June 15, 2008    0 Comments

Cocoa for Windows + Flash Killer = SproutCore.

As I'm watching the Celtics vs. Lakers game this fine evening (after giving GTA4 a break), I found a nice article to read on the laptop in the family room.

I haven't yet completed it (it's a lengthy read), but so far it's a very interesting take on the whole race for RIA superiority.

I've gotten to the part where the most used RIAs are developed by Google (GMail, Reader, etc.) and the points made in regards to this are valid.

I love Flash, it's my bread & butter, but I know it's not the be-all, end-all solution for anything by any means.

Leave your comment after reading the article. Interesting thoughts there.
 

Friday, June 13, 2008

Found this code laying around: string2Bin(s)

Friday, June 13, 2008    0 Comments

This probably isn't very useful to many, but I found a little code to translate a String into a binary representation.

function string2Bin(s:String)
{
var b = new Array();
var last = s.length;
for (var i = 0; i <>
{
var d = s.charCodeAt(i);
if (d <>
b[i] = dec2Bin(d);
else {
var c = s.charAt(i);
b[i] = -1;
}
}
return b;
}

function dec2Bin(d:uint)
{
var b = '';
for (var i = 0; i <>
{
b = (d%2) + b;
d = Math.floor(d/2);
}
return b;
}
//01000101,01110010,01101001,01100011
trace( string2Bin("Eric") );

 

Thursday, June 12, 2008

Those Gameday Applications

Thursday, June 12, 2008    1 Comments

Just a little curious, but I am wondering if those GameDay applications you can find on ESPN (like watching a baseball game, football, etc.) are simply running using an XMLSocket connection to a cloud someplace. That part is pretty understandable, but how the hell is the information getting in there, and seemingly so quickly?

Are there employees sitting there basically blogging data as quickly as they can to a server someplace, and that gets pushed out via socket? I know it's not real-time data, but it's pretty close sometimes.

I have sat and watched a Red Sox game and watched the GameCast just to see how off the online application was... and sometimes it got to be only off by about 30 seconds or so.

Right now I am watching a GameCast of Austria vs. Poland, and watching this stuff makes me really want to play around with something similar, but I have absolutely no way of gaining access to information like this. Not without a ton of effort just to prove a concept out.

Update:
Apparently in UK cliché speak from football commentators and players/coaches, "early doors" means "soon" or "early." I had no idea what the hell they were talking about until I asked a bloke who I work with in the office.
 

InteractivePNG from Moses Supposes

   0 Comments

If you ever use PNGs with alpha transparency in your applications/designs and require mouse interactions that don't default to the entire PNG square area (ie. treated like a bit square hit area as opposed to having the transparent areas actually act like they aren't there), then you need to check out MosesSupposes' InteractivePNG Class. Whew that was certainly a long sentence. 

Really nice work. This might come in handy for sure. Nice approach.

 

AS2 Free Zone

   0 Comments

No More AS2It's not like I abandoned AS2 recently, but man am I ever glad that I did way back when.

Today I went back and looked at some of the applications that I slaved over a few years ago and was simply astounded at all the tricks and hoops one had to jump through in order to roll up applications.

All those dispatching obstacles, scoping function calls in classes, all the weird looking (now anyway) event handling and assignments, etc.

I haven't touched AS2 in probably a year and a half, and I couldn't be any happier because of that decision. It took some trial and error, and most of all just playing around to get a handle on the improved language. The best way is to create projects containing desired functionality, and then figure out how to do that. Then add some more functionality, and let it roll. Soon that hill will slope downwards and it will become second nature. 

There are certainly things (aspects) that I have yet to get squared away simply because I haven't needed to dip my toes into said areas. But that's part of the fun. Always learning & improving. Any time spent with AS3 is fun and fruitful.

This is an AS2 Free Zone now... there wasn't any looking back when I started grinding AS3 out, but looking at that code today made me cringe. Literally. All those comments for other developers about what certain hacks were in place & why they worked at all. No more nesting of functions. No more onAnything events. No more intervals that need to run to fix up instantiation problems. The list goes on and on. 

While it's not new to anyone, and we've (the community at large) been drumming the AS3 kettle for a long time, I just had to get this out (express it) because AS3 development is such a freaking joy. It's weird how a language can actually physically change your mood, but AS3 certainly has done that for me. 
 

Wednesday, June 11, 2008

Number.fromCharCode

Wednesday, June 11, 2008    0 Comments

We've all been acquainted with String.fromCharCode in relationship to event.keyCode, but it also works with Number. Why would you want to do that?

Well, I am getting sets of keyboard inputs as keyCodes from a piece of hardware, and I build up an angle to use. A delimiter lets me know when to stop per each set.

In order to translate the keyCodes back to numbers for use in building up the angle to use, instead of using a method to translate the keyCodes to a Number to use, you can simply do something like this:

var code:Number = event.keyCode;
var n:Number = Number.fromCharCode( code );

And from this I build up an array, looking for a delimiter all the time, and when I get the delimiter, build the angle number and use it. Of course this fails if you are getting keyCodes that are out of range of 0-9, so you need to filter your keyCodes as they come in.

I haven't seen any public code (yet) that uses Number.fromCharCode yet, and for me it works perfectly, so I thought I'd throw this out there.

Labels: ,

 

Tuesday, June 10, 2008

Moments of calm

Tuesday, June 10, 2008    1 Comments

Whenever I create some big framework, some UI theme, etc. I generally gravitate towards Asian labeling (ie. Green Tea, Oolong, Bamboo, things like that). By the way, green tea was a complete UI theme for a project I was working on... and it turned out really well.

I have a Japanese watercolor of a coy at my desk at work with the words "Gentleness" brushed on it. 

Today I was feeling a little stressed while coding, and decided to visit Keith Peter's personal blog

Truly wonderful photos, great narrative, and it brought my blood pressure down a few notches. Thank you Keith.
 

Monday, June 9, 2008

Nice

Monday, June 9, 2008    1 Comments

I went to grab some sample source code from Apple this morning and I got this message.

We'll be right back

We are currently updating the iPhone Dev Center, and you should be able to access it shortly.

Excellent ;)
 

Flash Debugging

   0 Comments

I caught news of the Arthropod debugger AIR application that pairs via LocalConnection to your SWF running in a container (projector, AIR application, etc.) where you lose your normal trace visibility. This thing pops your

Debug.log( sValue, color );
Debug.error( sValue );
Debug.warning( sValue );

into the AIR app that's the receiver for the LocalConnection. It works well.

Caveat:

I'm still waiting to see a debugger that allows for calling methods, interrogating properties, setting properties, etc. while the SWF is running. Snap shots work, and this special tracing certainly helps, but we can use more firepower in our debugging.

I have an AS2 solution for this that we used while I was at Convoq, but it needs rewritten because of the manner in which inheritance works in AS3. I haven't had the time to do that, but it would go light years beyond the typical debuggers you see out there today (although its a performance hit since it works with the running application and not just snapshots, etc.)

Since it's not originally all my code, and while that start up I worked for is now nonexistent, I thought about open sourcing it... but I don't think I could legally do that. Perhaps a project should be started to address the need though.
 

Friday, June 6, 2008

Anniversary of D-Day. Thank you all.

Friday, June 6, 2008    0 Comments

Remarks at the U.S. Ranger Monument
Pointe du Hoc, France
June 6, 1984

"We're here to mark that day in history when the Allied armies joined in battle to reclaim this continent to liberty. For four long years, much of Europe had been under a terrible shadow. Free nations had fallen, Jews cried out in the camps, millions cried out for liberation. Europe was enslaved, and the world prayed for its rescue. Here in Normandy the rescue began. Here the Allies stood and fought against tyranny in a giant undertaking unparalleled in human history.

We stand on a lonely, windswept point on the northern shore of France. The air is soft, but 40 years ago at this moment, the air was dense with smoke and the cries of men, and the air was filled with the crack of rifle fire and the roar of cannon. At dawn, on the morning of the 6th of June, 1944, 225 Rangers jumped off the British landing craft and ran to the bottom of these cliffs. Their mission was one of the most difficult and daring of the invasion: to climb these sheer and desolate cliffs and take out the enemy guns. The Allies had been told that some of the mightiest of these guns were here and they would be trained on the beaches to stop the Allied advance.

The Rangers looked up and saw the enemy soldiers--the edge of the cliffs shooting down at them with machine guns and throwing grenades. And the American Rangers began to climb. They shot rope ladders over the face of these cliffs and began to pull themselves up. When one Ranger fell, another would take his place. When one rope was cut, a Ranger would grab another and begin his climb again. They climbed, shot back, and held their footing. Soon, one by one, the Rangers pulled themselves over the top, and in seizing the firm land at the top of these cliffs, they began to seize back the continent of Europe. Two hundred and twenty-five came here. After two days of fighting, only 90 could still bear arms.

Behind me is a memorial that symbolizes the Ranger daggers that were thrust into the top of these cliffs. And before me are the men who put them there.

These are the boys of Pointe du Hoc. These are the men who took the cliffs. These are the champions who helped free a continent. These are the heroes who helped end a war.

Gentlemen, I look at you and I think of the words of Stephen Spender's poem. You are men who in your "lives fought for life . . . and left the vivid air signed with your honor.''

I think I know what you may be thinking right now--thinking, "We were just part of a bigger effort; everyone was brave that day.'' Well, everyone was. Do you remember the story of Bill Millin of the 51st Highlanders? Forty years ago today, British troops were pinned down near a bridge, waiting desperately for help. Suddenly, they heard the sound of bagpipes, and some thought they were dreaming. Well, they weren't. They looked up and saw Bill Millin with his bagpipes, leading the reinforcements and ignoring the smack of the bullets into the ground around him.

Lord Lovat was with him--Lord Lovat of Scotland, who calmly announced when he got to the bridge, "Sorry I'm a few minutes late,'' as if he'd been delayed by a traffic jam, when in truth he'd just come from the bloody fighting on Sword Beach, which he and his men had just taken.

There was the impossible valor of the Poles who threw themselves between the enemy and the rest of Europe as the invasion took hold, and the unsurpassed courage of the Canadians who had already seen the horrors of war on this coast. They knew what awaited them there, but they would not be deterred. And once they hit Juno Beach, they never looked back.

All of these men were part of a rollcall of honor with names that spoke of a pride as bright as the colors they bore: the Royal Winnipeg Rifles, Poland's 24th Lancers, the Royal Scots Fusiliers, the Screaming Eagles, the Yeomen of England's armored divisions, the forces of Free France, the Coast Guard's "Matchbox Fleet'' and you, the American Rangers.

Forty summers have passed since the battle that you fought here. You were young the day you took these cliffs; some of you were hardly more than boys, with the deepest joys of life before you. Yet, you risked everything here. Why? Why did you do it? What impelled you to put aside the instinct for self-preservation and risk your lives to take these cliffs? What inspired all the men of the armies that met here? We look at you, and somehow we know the answer. It was faith and belief; it was loyalty and love.

The men of Normandy had faith that what they were doing was right, faith that they fought for all humanity, faith that a just God would grant them mercy on this beachhead or on the next. It was the deep knowledge--and pray God we have not lost it--that there is a profound, moral difference between the use of force for liberation and the use of force for conquest. You were here to liberate, not to conquer, and so you and those others did not doubt your cause. And you were right not to doubt.

You all knew that some things are worth dying for. One's country is worth dying for, and democracy is worth dying for, because it's the most deeply honorable form of government ever devised by man. All of you loved liberty. All of you were willing to fight tyranny, and you knew the people of your countries were behind you.

The Americans who fought here that morning knew word of the invasion was spreading through the darkness back home. They thought--or felt in their hearts, though they couldn't know in fact, that in Georgia they were filling the churches at 4 a.m., in Kansas they were kneeling on their porches and praying, and in Philadelphia they were ringing the Liberty Bell.

Something else helped the men of D-Day: their rock-hard belief that Providence would have a great hand in the events that would unfold here; that God was an ally in this great cause. And so, the night before the invasion, when Colonel Wolverton asked his parachute troops to kneel with him in prayer he told them: Do not bow your heads, but look up so you can see God and ask His blessing in what we're about to do. Also that night, General Matthew Ridgway on his cot, listening in the darkness for the promise God made to Joshua: "I will not fail thee nor forsake thee.''

These are the things that impelled them; these are the things that shaped the unity of the Allies.

When the war was over, there were lives to be rebuilt and governments to be returned to the people. There were nations to be reborn. Above all, there was a new peace to be assured. These were huge and daunting tasks. But the Allies summoned strength from the faith, belief, loyalty, and love of those who fell here. They rebuilt a new Europe together.

There was first a great reconciliation among those who had been enemies, all of whom had suffered so greatly. The United States did its part, creating the Marshall Plan to help rebuild our allies and our former enemies. The Marshall Plan led to the Atlantic alliance--a great alliance that serves to this day as our shield for freedom, for prosperity, and for peace.

In spite of our great efforts and successes, not all that followed the end of the war was happy or planned. Some liberated countries were lost. The great sadness of this loss echoes down to our own time in the streets of Warsaw, Prague, and East Berlin. Soviet troops that came to the center of this continent did not leave when peace came. They're still there, uninvited, unwanted, unyielding, almost 40 years after the war. Because of this, Allied forces still stand on this continent. Today, as 40 years ago, our armies are here for only one purpose--to protect and defend democracy. The only territories we hold are memorials like this one and graveyards where our heroes rest.

We in America have learned bitter lessons from two World Wars: It is better to be here ready to protect the peace than to take blind shelter across the sea, rushing to respond only after freedom is lost. We've learned that isolationism never was and never will be an acceptable response to tyrannical governments with an expansionist intent.

But we try always to be prepared for peace; prepared to deter aggression; prepared to negotiate the reduction of arms; and, yes, prepared to reach out again in the spirit of reconciliation. In truth, there is no reconciliation we would welcome more than a reconciliation with the Soviet Union, so, together, we can lessen the risks of war, now and forever.

It's fitting to remember here the great losses also suffered by the Russian people during World War II: 20 million perished, a terrible price that testifies to all the world the necessity of ending war. I tell you from my heart that we in the United States do not want war. We want to wipe from the face of the Earth the terrible weapons that man now has in his hands. And I tell you, we are ready to seize that beachhead. We look for some sign from the Soviet Union that they are willing to move forward, that they share our desire and love for peace, and that they will give up the ways of conquest. There must be a changing there that will allow us to turn our hope into action.

We will pray forever that some day that changing will come. But for now, particularly today, it is good and fitting to renew our commitment to each other, to our freedom, and to the alliance that protects it.

We are bound today by what bound us 40 years ago, the same loyalties, traditions, and beliefs. We're bound by reality. The strength of America's allies is vital to the United States, and the American security guarantee is essential to the continued freedom of Europe's democracies. We were with you then; we are with you now. Your hopes are our hopes, and your destiny is our destiny.

Here, in this place where the West held together, let us make a vow to our dead. Let us show them by our actions that we understand what they died for. Let our actions say to them the words for which Matthew Ridgway listened: "I will not fail thee nor forsake thee.''

Strengthened by their courage, heartened by their value [valor], and borne by their memory, let us continue to stand for the ideals for which they lived and died.

Thank you very much, and God bless you all."

-- Ronald Reagan

 

Wednesday, June 4, 2008

Flash on the iPhone? Looks quite possible.

Wednesday, June 4, 2008    1 Comments

US Patent Application 20080122796
...
[0779]In some embodiments, user interfaces 4000A-4000F include the following elements, or a subset or superset thereof: [0780]402, 404, 406, 3902, 3906, 3910, 3912, 3918, 3920, 3922, as described above; [0781]inline multimedia content 4002, such as QuickTime content (4002-1), Windows Media content (4002-2), or Flash content (4002-3);

Okay, that seems pretty cool to me to see Flash mentioned in an Apple patent application for the iPhone. I certainly hope this happens.
 

Saffron UML acquired by Microsoft?

   13 Comments

Someone left a comment here ("pssd") about a DIGG in regards to Saffron.

"Jeff D. confirms that Saffron has been bought by Microsoft and will no longer be released as an AS3/air app. Sam is currently working with Microsoft engineers to move the code base over to WPF/Silverlight with a view to a release in Q1 next year as an online app available as part of the Visual Studio package. April 23"

Hmm... Sam's website is down for maintenance, and the digg references a journal entry from 2/19/2008 -- which doesn't currently exist anymore. 

So there is no way to actually prove any of this is real. There hasn't been any news in a long time. So it has the ring of truth in it (acquired), or perhaps Sam is putting out all the stops in regards to getting ready for a release so many are eager for.

If Microsoft did acquire this, congrats Sam. Although it pains me to see this beauty deployed in anything but an AS3 AIR application.
 

Tuesday, June 3, 2008

AS3 Socket & Security

Tuesday, June 3, 2008    0 Comments

I bumped into this pretty hard today. In my previous post about controlling the operating system's mouse cursor, I am using a Java socket server to do the lifting for Flash.

I send out a string to the method in the server, and it in turn converts said string to mouse x & y positions, and places the operating system mouse cursor there.

This works perfectly well when compiling from the IDE, because naturally it's a trusted SWF coming from an IDE compile. I was able to see my socket connection working, and I was able to set the x,y of the mouse well enough.

When run in standalone through the Flash Player on my desktop, the socket was being silently ignored.

What I had to do was to add the SWF to the list of trusted folders/files. After that, it seems to work really well. I spent a long time trying to wonder what was happening, but then forgot about the whole security aspect of the player. Silly me. 

It's something that's kind of easy to forget about in the heat of coding. Just a FYI reminder.
 

Flash controlling OS X mouse

   0 Comments

The generosity of Andrew Wright has paid great dividends. He wrote a java socket server to control the system-level mouse. You can get the sources here (zip file). It took me a little while to get this going mainly because of the class path. I was getting a java.lang.NoClassNameDef... error.

When you download the source folder, place it where you want it and then fire up the Terminal and cd to the bin directory. Now, you want to set the class path by enter this CLASSPATH=. (include that dot).

Then you enter into the Terminal:
java com.snepo.cursorcontroller.CursorControlServer

You should see "Listening on port 8899..." and "Ready..." in the Terminal window when successful. You can now send pipe-delimited Strings to the socket server and position the system-level mouse. Run the socket server first, then launch your SWF.

var sock:Socket = new Socket("localhost", 8899);
private function sendCoords(px:String, py:String):void
{
if(sock.connected)
{
var point:String = px + "|" + py;
sock.writeUTFBytes(point + "\n");
sock.flush();
}
}
You should be good to go. I've tested this all out and it works great. I have a special application of mouse control in mind, but you can see this is pretty cool. Since this is Java, it will work cross-platform.

Right now I'm battling to get this to work in another application, as it seems my calls to the server might be ignored right now. Hopefully I'll get this rolling.

 

One hell of a hockey game

   0 Comments

Up two early to see it dissolve to a tie, then go down... pull the goalie and get a goal to tie it up. Third overtime called goal by Petr Sykora. I'm tired and I only watched.

GO PENS!
 

Monday, June 2, 2008

Controlling the mouse in OS X

Monday, June 2, 2008    2 Comments

Has anyone seen Flash (AIR, executable, etc.) that controls the x, y position of the SYSTEM mouse?

We can easily hide the system cursor, use a custom cursor, restrict the position of that custom cursor Sprite, but what I'd really like to do is to be able to control the x, y position of the OS X mouse. If its within a certain range, move it with code. I am wondering if AppleScript might be able to do this, or some other method.

I found this method below in an Apple technote, but it's deprecated.

CGDisplayErr CGDisplayMoveCursorToPoint(
CGDirectDisplayID display, CGPoint point);
This is a really strange thing to want to do, but I am wondering if there is any way at all. Flash needs to send the commands... can it be done via Python maybe or something?

If someone has done this, please share ;)

Update:
I found this link. However I'm not sure how I'd actually call the method I need.