RemoteObject setRemoteCredentials()

May 6, 2008 – 6:00 am

“You can also call the setRemoteCredentials() method for Remoting Service destinations that are managed by an external service that requires user name and password authentication, such as a ColdFusion Component (CFC).” - Passing credentials from client-side components, livedocs.adobe.com

I’m not using ColdFusion Components, but an EJB application server. There should be a way to use the Flex remote object credential passing, but I can’t find documentation anywhere!

There’s information on “J2EE and JAAS” access elsewhere on the livedocs, but it only addresses WebServices and not RemoteObjects - two very different beasts.

(And while I’m at it, it’s prob’ly not a good idea to name your product after ill-reputed science.)

ActionScript Variable Scoping and the Lack Thereof

April 28, 2008 – 6:00 am

I’ve always disparaged JavaScript (in a bigoted way), and have only learned, and come to use quite often, ActionScript in the past six months. Both are now roughly based on ECMAScript.

I’ve always preferred “real” languages to kludgey script languages. (What is a language? That’ll have to wait for another day.)

The day I stumbled upon the fact that there is no variable scoping in ActionScript reminded me of its lowly origins.

for (var i:int = 0; i<10; i++) {
	// do something
}

for (var i:int = 0; i<10; i++) {
	// do something else
}

Redeclaring a variable within a method only issues a warning. If you change the type, and error is kicjed out.

Given this language functionality, I have gravitated toward a convention of declaring all variables at the top of the method. Never an inside-the-loop definition.

var i:int;

for (i = 0; i<10; i++) {
	// do something
}

for (i = 0; i<10; i++) {
	// do something else
}

Here’s a random piece of code. It’s not specifically an example of how you might run afoul with no scoping, but it is an example of using the declaration convention.

private function handle(event:DragEvent):void {
	var source:Object = event.dragSource.dataForFormat(dataFormat)[0];
	var base:ListBase = event.target as ListBase;
	var i:int = base.calculateDropIndex(event);
	var currentItem:Object = (i >= base.dataProvider.length) ? null : base.dataProvider[i]; // dragDestination()

	if (event.type == DragEvent.DRAG_EXIT || event.type == DragEvent.DRAG_DROP)
		currentItem = null;

	if (currentItem == lastItem)
		return;

	var feedback:String = determineFeedback(event);
	DragManager.showFeedback(feedback);
	if (feedback != DragManager.NONE) {
		updateLastItem(currentItem);
		setTempValue(currentItem, source);
	} else {
		updateLastItem(null);
	}

	base.invalidateList(); // required by lists using labelFunction, they don't catch binding changes
}

You Have a Tech Job? Learn to Write!

April 24, 2008 – 7:00 am

I always find myself wanting to edit technical blogs. Not usually for the technical content, usually for the horrible writing. I re-edit my writing all the time, and I struggle with blogging layout to support technical (and elsewhere, non-technical) content. I know it’s hard. But it seems you don’t even try, I will think poorly of you.

To totally pick on one guy who I happened to be reading when I went over the threshold to write this:

negatives:
“we saw” - it’s awkward, and passive
“Lets” - should not be capitalized, and should have an apostrophe
“let us get introduced” - what?

obligatory positive input:
earlier article - the link is appropriately tied to the content it’s referring to

That’s just from the first paragraph.

All of the code is in a quote, is word-wrapped, and is devoid of white space - fix that!

There’s much more - I could edit it to oblivion. But I also can’t pass up: “there by”, one word, “thereby”; “invoke a method call”, just “we invoke a method”; “rhe” simple spell check-”the”; “So,whats”, don’t use contractions if you can’t use contractions- “So, what’s”; “on fail” - we begin sentences with capital letters - “On fail”. The list goes on.

The technical content is quite interesting, so kudos on that.

By the way, the ability to communicate and write effectively is at the top of my list of things you need to do to prepare for a job interview. Practicing in a blog is a great way to do it. My rule of thumb is you should re-read and edit your piece three times. I do it once before I post, once a day later (in my RSS feed - also assuring that’s working correctly), and once several days later.


Arrg. From what looks like some kind of official Microsoft announcement I am presented with this abomination of a sentence that changes tense midway: “We’re friending, twittering, digging, tagging and linking to stay in touch, share photos, be entertained, meet new people, express our opinions, learn, and the list goes on.” Didn’t finish reading it; I still don’t know what Vile Mesh is. (And every time I see “aspx” in a URL, all I can think is that the site is asphyxiating me.)

Amit Mital, General Manager at Microsoft, you’re killing me softly.

Code Tags in Blogs and Lack of Support Thereof

April 22, 2008 – 10:30 pm

Most WordPress themes have little (if any) respect for code and pre tags. I stumbled upon a blog some time ago whose support of said tags I quite liked. I dug up the CSS code and mailed it to myself.

Upon recent cleaning of my inbox I stumbled upon it again, and actually applied it to current theme. The designer of the current theme is someone named Bob who hates white space!

Anyway, for posterity, and so I can look for it later, here’s the code. (It may well be able to be stream lined - I’m certainly neophyte enough in CSS still to not know any better.)

pre, code {
	background:#FFFFFF url(/wp-content/themes/preback.jpg) no-repeat scroll left top;
	border: 1px solid #99CC66;
	color: #000000;
	display: block;
	font-family: 'Courier New', Courier, Fixed, monospace;
	font-size: 110%;
	font-size-adjust: none;
	font-stretch: normal;
	font-style: normal;
	font-variant: normal;
	font-weight: normal;
	line-height: 17px;
	margin: 1em 0pt;
	overflow: auto;
	padding: 0pt 20px 0pt 30px;
	text-align: left;
}

Flex Bug SDK-15305

April 17, 2008 – 6:00 pm

Looks to me like a PrintDataGrid / VBox (or likely any parent) sizing negotiation bug that happens when variableRowHeight=”true”. [15305]

Adobe seems to be responsive on it, so far. Many of the bugs in their system are labeled as “deferred” - just hope this one doesn’t end there.

Problem is, even if it gets fixed, it’s a problem in the Flash Player and needs to be fixed and released from there - may not be until Flash Player 10 till it’s fixed.

WordPress 2.5 Optional Stats Problem

April 15, 2008 – 8:46 pm

I added the new WordPress plugin to track stats on one of my sites and I wasn’t getting any stats. Turns out the theme I’m using is using a different (likely older) footer code than the stats are expecting.

I added a line into the stats code to make it catch the hook:

// Plant the tracking code in the footer
add_action( 'wp_footer', 'stats_footer', 101 );
add_action( ‘get_footer’, ’stats_footer’, 101 );

Flex SDK PrintDataGrid Bug 15305

April 15, 2008 – 3:40 pm

Banging my head on some PrintDataGrid oddities, reported as Bug 15305. I suspect some of the code is making the assumption that only one PrintDataGrid will ever exists.

The sizing of the data grids seems oddly tied to previous grids that have been created. Can’t figure out exactly the cause, but the code to recreate is on the bug report. Here’s the execution:

Example PrintDataGrid Failure

Hit reload each time you want to reset the application.
Create grids, increase the number of rows, create again.
Or, 4 grids, 4 rows, the last grid loses a row.

Reviving LiveDocs: Adobe on the Case

April 15, 2008 – 10:12 am

You should always be the squeeky wheel!

I emailed a contact I had in the Adobe documents group (thanks, Matt!) and found out that Adobe was aware of their Dead Docs problem.

But more importantly they provided a link to a downloadable API documents for the Flex/ActionScript 3.0 collection - I’d much rather have it locally than over the web, and I was previously unable to find a download of such a thing.

PDP-11 on Mac

April 12, 2008 – 7:33 pm

Open Question:  How many PDP-11 emulators could you concurrently run on a 8-core MacPro?

Flex Mac Scrolling Bug

February 29, 2008 – 11:00 am

If you use Flex on a Mac you may have noticed that the trackpad scroll doesn’t work.  The Flex team has deferred the problem, claiming it’s a Flash Player bug.  I can’t find the Flash Player bug database, so I can’t confirm it.

If you use Flex and find this as huge an issue as I do, please vote for it in their bug database.