Joeflash’s Enigmacopaedia


Indentation Guides in Flex Builder

Posted in Usability, Flex, Workflow, Eclipse, Flash Builder 4 by Joeflash on the March 17th, 2009

When I am coding a large class file with several nested code blocks such as methods, try/catch statements, if statements, for loops, I have to use Notepad++ to have access to Indentation Guides, because this feature is not built into Flex Builder. Indentation guides are vertical lines in the editor that follow the tab stops in the document so that code blocks can be visually tracked.

To me this is an essential feature: it is a crucial element of code assist, enabling me to keep track of all the open and closed blocks. I wish Flex Builder had this feature, which is found in several other code editors. If you want to see this feature in Flex Builder, please go vote for Feature Request #17634 on Adobe JIRA:
[#FB-17634] Indentation Guides in Flex Builder
(more…)

The Case Against Ignorant Tech Analysts

Posted in Flash, Business, Flex, Publishing, Flash Platform Community by Joeflash on the February 28th, 2009

It seems to be a recurring trend amongst amateur or ill-informed tech pundits to take aim at misuses of Flash as an argument against using the technology as a whole. And once and a while this mis-aimed cannon of vapid sophistry also takes aim at Flex. And quite frankly, I’m tired of it.

I mean, as a Flash developer for over 10 years (now a Flex developer too ; ), I’m never shy to admit that Flash Platform applications have their limitations and misuses. There is definitely a place for XHTML applications, instead of or as a complement to a Flash-based presence, and skip intros are a no-no. And as I’ve stated before, if you’re going to publish a site in Flash with lots of text, make sure that that text is at least accessible. But if you’re going to provide an argument against using a particular technology, don’t do it as a transparent attempt at promoting your own product at the expense of another, or creating attention grabbing headlines just to get a few more eyeballs to your site. You’ll land up looking foolish, and it’s bad karma besides.

Just recently someone posted a comment on this blog in response to what he probably thought was an “anti-Flash” post. Big mistake. First, as I indicated in my response, while his initial arguments had validity, his conclusion was way off. And it seems to be common occurrence for some bloggers to post comments on other people’s blogs in an effort to garner support for their arguments without considering the point of view of the blog they’re posting on, so the argument falls flat. I’m not opposed to a little healthy debate and free speech, but this tactic is getting tiresome: I see it used so often that, aforementioned comment notwithstanding, I sometimes wonder if some of these posts are provoked by corporations as a “web 2.0″ anti-marketing smear tactic.
(more…)

A Rallying Cry for Net Neutrality In Canada

Posted in Flash, News, AIR, ActionScript 1.0, ActionScript 2.0, ActionScript 3.0, Flex, Events, Adobe, DRM, Net Neutrality by Joeflash on the February 13th, 2009

As reported on the Canadian Net Neutrality action website SaveOurNet.ca, The CRTC has said that it will consider public opinion in determining the outcome of the traffic shaping hearings set to take place later this year. As Canadians, we owe it to ourselves and this great nation to hold governmental institutions charged with guarding the public trust accountable to the purpose for which they were created. We need to send ISPs in Canada the message that this kind of censorship shall not be tolerated, and should not be allowed. Check out the details on SaveOurNet.ca, and send in your action letter to the CRTC.
(more…)

The RPC Fault Security Error that wasn’t

Posted in Books, Flex, Community MX, Security by Joeflash on the February 1st, 2009

In the first chapter of our upcoming book Professional Flex 3, I built a simple RSS reader in just a few lines of code to demonstrate how easy it is to build a Flex application. I expanded on this application in a few recent articles at Community MX, creating a mini RSS feed reader for all the book authors. All was well, until one of our tech editors Matthew Fabb, told me that the reader I built was producing a dreaded security error. Good catch Matt!

Here’s the original RSS reader code used in the book:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="feed://http://www.adobe.com/2006/mxml"
  3.     layout="absolute" creationComplete="RSSFeed.send();">
  4.     <mx:HTTPService id="RSSFeed" url="feed://http//www.joeflash.ca/blog/feed/"/>
  5.     <mx:List id="postTitles" labelField="title" left="20" right="20" top="20"
  6.         dataProvider="{RSSFeed.lastResult.rss.channel.item}"/>
  7.     <mx:TextArea htmlText="{postTitles.selectedItem.description}"
  8.         left="20" right="20" top="190" height="200"/>
  9.     <mx:Button label="Go to page" left="20" top="400"
  10.         click="navigateToURL(new URLRequest(postTitles.selectedItem.link));" />
  11. </mx:Application>

I tried it locally, and no security error, of course. I loaded it onto my server, and I got the following error:

[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] ...

(more…)

Help me speak at 360|Flex (and kick some ass in Flex Builder)

Posted in Flex, Workflow, Flex Builder 3, Conferences by Joeflash on the January 17th, 2009

John Wilker, one of the organizers of 360|Flex, has put up a voting system to help decide from 124 speaker submissions which 40 make the cut. If you wanna find out how to kick some ass in Flex Builder, like how to tweak the Eclipse JVM to speed up compile times, use Subclipse for subversion, or code like a mad dog, go vote for my talk. Full description as follows:

Kicking Ass and Taking Names: Optimizing Flex Builder Performance and Workflow

Flex Builder is a great tool. There are times when using this tool is great, grand, works like a charm. And other times it’s an excruciating experience akin to waiting for paint to dry while a crack team of ninja monkeys shove bamboo under your finger nails. This session will show you how to kick some serious ass in Flex Builder: speed up the IDE, code faster, leap tall buildings in a single bound and shoot lasers out of your eyes. (Okay, maybe not the lasers part, but still.) In this session we’ll be talking about:

  1. Optimizing Flex Builder Performance
    • Project Development Best Practises
    • Speeding up Eclipse
    • The Heap Status Indicator
    • Why Compilation Slows Down
    • Command-line Startup Options
    • JVM Memory Tuning,
  2. Using Language Intelligence
    • Code Assist, Syntax Highlighting, Mark Occurrences, Go to Defintion, etc.
    • Code Preferences
    • The Class Outline View & Sort Options
  3. Managing Workflow
    • Useful Keyboard Shortcuts
    • Search & Refactoring
    • The Diff Tool
    • Layouts for Productivity
  4. Customizing The Workbench
    • Custom Shortcuts
    • Customizing the Editor (Syntax Colouring, Changing the Editor Font Size, Bookmarks, etc.)
    • Editing the Workspaces List
    • Migrating a Workspace without getting an ulcer
  5. Code Versioning in Flex Builder
    • The Built-in Eclipse History / CVS
    • installing and using the subclipse subversion plugin
  6. Assorted Plugins (a melee of Eclipse plugins that’ll make your life easier)

Vote Now!! : )

And here’s my official conference bio (in case you’re wondering who the hell this guy is):

Joseph Balderson (aka “Joeflash”) is a freelance Flex and Flash Platform Developer living in central Ontario, Canada. He spends most of his time in his home studio mainlining code like a junkie on a binge tripped out on trance music, surrounded by three loving cats whom he’s training to meou on cue so they can answer the phones for him (but so far no success). In his spare time he… wait, what spare time?? Joseph is a staff writer at CommununityMX, and lead author on the upcoming book
Professional Flex 3 by Wrox/Wiley Publishing.

Moving a Flex Builder/Eclipse Workspace Without Importing Anything (Update)

Posted in Flex, Workflow, Flex 3, Flex Builder 3, Eclipse by Joeflash on the November 27th, 2008

In the last post, I examined how to move a Flex Builder/Eclipse workspace to a different directory location without re-importing all your projects. Only it didn’t work as well as expected. I finally figured it out, but use at your own risk, since this involves editing Eclipse binary metadata files.

Currently there is no user-friendly technique for moving an entire Eclipse workspace folder to a different directory. This I most wanted to do because the current technique involves the painstaking task of creating a new workspace, then reimporting all projects, reconfiguring all compiler settings, and then re-imputing all the SVN location data for Subclipse. Blech!!

I wanted to move all my workspaces from my C:\ drive to a C:\_fx3\ directory to get them off the root drive. But I don’t have whole days to mess around with importing projects and making sure all the settings have been imported faithfully. I just wanted to move entire workspace folders to the new directory, make a few metadata file hacks, and be done with it.

Well, as it turns out, it’s not that easy. What makes all the difference for most workspaces are not the XML metadata, which seems to be mostly for caching, but the .location files in the metadata project directories, which is where the absolute directory location for each project folder is referenced. Problem is they’re not meant to be user-edited. So use this technique at your own risk, as other absolute directory dependencies may exist that I’m not aware of. For now consider this an experiment in progress.

1. Copy your workspace to the new directory location.

2. Edit the XML metadata files in the workspace folder as detailed in this last post.

Now here’s where it gets interesting.

3. Find the .location files in the workspace metadata. They are located in the

\{workspace dir}\.metadata\.plugins\org.eclipse.core.resources\.projects\{project folder}

directories

3. Open up each .location file in a Hex Editor application. I’m using the free Hex Workshop utility from pbsoft.

Now let’s take a look at the process for editing one of those files.

4. Edit the URI in the binary data. In the Hex for each file you will see the characters “URI” followed by the absolute directory path for the project folder in question. Edit the path, making sure to add or delete bytes as required.

In my .location file, the old path is:

URI//file:/C:/profx3book/Chapter_01_Why_Flex

editing the .location file - start

I edit the new path to be

URI//file:/C:/_fx3/profx3book/Chapter_01_Why_Flex

5. Edit the byte before the “URI” to be the new character length of the path.

If your code editor has hex-to-dec conversion, as mine does, you can see that the character length of my old path, which includes “URI”, is hex 2C or 44 characters (see image above).

Select that byte value, and replace it with the character length of the new path. I got the character length by using word count in MS Word (Tools > Word Count…).

URI word count

The length is 49 characters, which is hex 31.

editing the .location file

5. Save the file.

6. Repeat for each .location file.

Now when load up Flex Builder and point to the new workspace location, I verify that the project does indeed point to where I told it to in the .location file. And my SVN locations are conserved, as are all my preferences. YAY!! :)

verifying the successful workspace move

Unfortunately, although this hack works, it’s a lot more trouble (or at the very least the same) as making a whole new workspace and importing each project one by one. I had to Hex edit over 20 files to move the entire workspace — which could hardly be considered a time-effective solution. I can make things easier on myself my copying the entire workspace to my new directory, but I still have to delete and recreate the workspace metadata by pointing to that new workspace folder, and then re-import every project in that workspace. Still, I learned quite a few things about Eclipse in the process, which was partly the goal of the exercise for me anyways.

Although I’ve used it for a few days now and I have not seen any compile or file referencing problems, and it seems like a sound solution, this technique has not been battle-tested, and I’m not an Eclipse developer by any stretch, so I’ll say it again:
use this technique at your own risk. Don’t come crying to me if this hack corrupts or messes up your Flex Builder or Eclipse workspace in any way.

If indeed this hack proves to be stable, as it seems to be, the next step would be to create a batch file or something that could at once copy the complete workspace directory to a new location, seek out and edit all the required XML metadata files with the correct path references, and hex edit all the .location files with the changed URI and adjust the length byte accordingly. Maybe even a custom eclipse plugin written in Java? Hmmm… But that task lies beyond my time and current programming abilities at present, so I will leave you with that final tantalizing thought.

(maybe some enterprising Eclipse developer will read this and decide to surprise us with a plugin, hint hint ;) )

Flex Builder Tip: Moving an Entire Workspace in One Step Without Importing Anything

Posted in Flex, Workflow, Flex 3, Flex Builder 3 by Joeflash on the November 24th, 2008

I had a situation recently where I had way too many workspaces sitting in my root C: drive folder, so I decided I wanted to move them to a subfolder with a very short name like “_fx” just so all my Flex workspaces are all in the same place, and to make backup archiving easier.

If you’re wondering, I have dozens of workspaces, one for each client and/or writing project, each of which has an average of 20+ projects.

Problem is, the conventional way is slow. Really slow. I’d have to create a new workspaces directory location (C:\_fx in my case), and import every single project into every new workspace. And even with saving preferences, I’d lose things like Subversion site locations in the Subclipse perspective. And with over 20 workspaces,. each with an average of 20 projects… I’d be at it for weeks. So I needed a shortcut.

So I dug around in the workspace metadata files, and eventually found where the directory locations reside for each project in that workspace. Luckily, it’s all in one file, so the hack is relatively simple.

Correction: unfortunately it’s not one file you have to edit, it could be a few XML files. And unfortunately this hack doesn’t work with all workspaces unfortunately. See below.

1. Make a copy of your workspace folder to the new location. Don’t move it, in case anything goes wrong. I found this out the hard way by wiping out the metadata for a workspace with over 30 projects — ouch!

2. Find the .metadata folder for the workspace.

3. Find the following files and open them in a text editor:

{workspace}\.metadata\.plugins\org.eclipse.ui.workbench\workbench.xml

{workspace}\.metadata\.plugins\org.eclipse.ui.workbench\dialog_settings.xml

{workspace}\.metadata\.plugins\org.eclipse.ui.workbench\workingsets.xml

{workspace}\.metadata\.plugins\com.adobe.flexbuilder.editors.common\dialog_settings.xml

4. Find & Replace all instances of the old directory location with the new one.

For example, for my \profx3book workspace, I replaced all instances of “C:\profx3book\” with “C:\_fx\profx3book\“.

5. Save the file, and point Flex Builder to the new workspace. Once you’re sure everything is where it should be, delete the files in the old location.

Et voila!

PS: Yes, I know, the above lists five steps, not one — but really it’s only one step: replacing the location string in the workbench.xml file.

PPS: Important Caveat: Search for all .location files in the workspace .metadata folder. If there any files found, this technique might not work, since the directory location for that project is stored in .location files as binary data, and cannot simply be edited with a text editor. So use this technique at your own risk.

Server Side ActionScript 3.0: Coming to a ColdFusion Server Near You

Posted in ActionScript 3.0, Flex, ColdFusion by Joeflash on the November 18th, 2008

Okay I was going to wait until after MAX to blog about stuff, but this cannot wait: as of about 7:30pm PST, at Adobe MAX 2008 SF, the sneak peeks announced that ColdFusion 9 will have server side ActionScript 3.0 capability. I’ve been waiting for this since Macromedia Comm Server, never mind FMS…

Correction: they didn’t say ColdFusion 9, they said they were working on this for a future version of ColdFusion Server.

You know, Flash Catalyst (aka Thermo) is cool, I mean way cool. And CoCoMo, and the next version of FMS with RTMFP is cool, and Alchemy just rocks the house, and Configurator is nice in a nostalgic kinda way (for me). And Gumbo, well it is definitely cool, but it’s not really news.

I mean, I was blown away enough by the sneak peeks Flash Player Multicast (via RTMFP), Nitro (SWF widgetization), Durango (realtime drag drop HTML/Flash/AIR component mashups), the Content Intelligent Toolkit, MeerMeer (multi-browser realtime virtualization)…

But what did it for me, the whole payoff for travelling across the continent from Toronto to San Francisco to go to MAX, was very last on the list. Server-side ActionScript 3.0, with the next a future version of ColdFusion Server.

If that were it, well, I would think, hey, that’s cool. But it’s how you can do it that totally rocks the house, that’s got me dancing in the streets.

There are three ways, from what I could tell:

1.     ColdFusion tags on the server with ActionScript 3.0 in a <mx :Script> block which generates HTML (and whatever other server-side code I would guess).

This brings the power of AS3 to ColdFusion developers. Combined with the new eclipse-based ColdFusion IDE which can sit alongside any other Eclipse Plugin (like Flex Builder), and CF will be a whole new ballgame.

2.     MXML & AS3 in Flex Builder.

Now you can author your MXML and AS3 in Flex Builder for the client-side code calling a Service operation on the server… written completely in ActionScript 3.0 inside a
<mx :Script> tag, no ColdFusion, using a .sas file on the server.

3.     AS & SAS in the same MXML file in Flex Builder, compiled using the next v. a future version of ColdFusion Server.

This is the one that did it for me, the one that brought home the bacon, oh yeah!!! :)
So now, as a Flex developer, I don’t have to know server-side code to create a service or a remote object on the server. I can just write:

<mx :Application ... >

    <mx :Script runat="client">
    ...

    <mx :Script runat="server">
    ...

</mx:Application>

Update Nov.19,3:30am PST: Sorry if you saw the wrong MXML in the last five hours, wordpress kept trying to correct the invalid XHTML of the MXML tags, but it’s fixed now.

…and I’ve got code running on the client and the server, all in ActionScript 3.0,
in the same file.

WOOHOO!!!

Now I don’t have to be freakin’ Java or PHP or CF expert just to code a backend-enabled Flex app.

Adobe, you frakin’ rock.

Developing for Flash Player 10 in Flex Builder 3

Posted in Flash, Tutorials, Flex, Community MX, Adobe, Flash Player, Flash CS3, Creative Suite, Flash CS4, FP10 by Joeflash on the November 12th, 2008

In the past few weeks I’ve written two free tutorials on Community MX that guide you through the process of compiling for Flash Player 10 in Flex Builder 3. One shows a Flex project compiled for FP10, and the second shows a Flex-free AS project compiled for FP10.

Developing for Flash Player 10 in Flex Builder 3

     This article shows you how to install the latest stable Flex 3.2 SDK, and from there configure Flex Builder to compile for Flash 10 using the latest playerglobal.swc file.

Developing a Flex-free AS3 Project for Flash Player 10 in Flex Builder 3

     This article shows you how to create an ActionScript project in Flex Builder compiled for Flash 10. It also shows you how to remove references to the Flex framework, so you can use Flex Builder for compiling pure ActionScript 3.0 projects without worrying whether you’ll “accidentally” use a part of the Flex framework. For those resisting the Flash CS4 upgrade, you may not be able to compile for Flash Player 10 in Flash CS3, but you can in Flex Builder 3.

Some Sites Should Never be Done In Flash

Posted in Flash, Usability, Flex, Adobe, Flashturbation, Conferences by Joeflash on the November 7th, 2008

…Unless they do a decent job at duplicating HTML-like functionality. You see, I have a bone to pick with companies and developers that try to shoehorn a solution into an inappropriate technology. The Adobe MAX 2008 Experience website is a most succinct case in point.

When I go to a conference, I like to assemble all the information available to me in an Excel spreadsheet I can just print out and carry around with me, so I don’t have to look up where everything is when I get there. A bit anal, perhaps, but there it is. This year when I go to Adobe MAX (which is my very first MAX, BTW) I thought I would not have to do that at all because the Session Locater will spit out a customized PDF with all my choices and reserved workshops. Fantastic!!

Only thing is, it won’t list my second and third choices in case I feel like wandering, so I create my spreadsheet anyways. Problem is, the PDF the session locater outputs has the text locked down. Whaa? I try and copy-paste, and all I get is gibberish. Now I understand PDF security preventing copy-pasting on legal documents and such, but on a personalized conference schedule? You know, cause I’m such a Man of Mystery jetsetting from one top secret conference to another, I need that kind of security. Whether by accident or design, this is strike one. So I type the sessions into my spreadsheet by hand, wondering why I’m even bothering. (Update: figured out I can copy-paste the text from the session locator, so I’m happy on that score. : )

But my beef is not with the Session Locater app as a whole, despite this dreadful oversight. That is clearly an excellent use of Flash, a great example of a Rich Internet Application. I go in, do what I need to do, download my PDF and I’m good.

So I’m trying to find out more information on the ‘after events’ for Adobe MAX N.Am. 2008 — you know, the parties and shmoozefests where the action really is ;) Specifically, more information on what’s featured in the “birds-of-a-feather/meet the team” sessions on Tuesday night, so I can include it in my spreadsheet.

I don’t find anything in the Session Locater. Nothing on the customized registration page. Nothing in the MAX Conference Brochure PDF.

Where do I find it? It’s under Highlights on the main “Experience” website. Okay, so far so good: the site has deeplinking so I can bookmark where this info is so I can find it later on.

Okay, so I think, it’s text, right? I can just select and copy. Uh, no. The text here is locked down as well, no can do copy. Here is a Flash site full of text, and right-click > copy is disabled! WTF?! Is this another state secret? So I try to output the site to Flashpaper, to PDF, anything that will gimme da text, fool! No luck, all I get is truncated sentence fragments and goobledygood.

Okay, so the whole point of my spreadsheet is to have the information in a customized, portable format I can carry around with me so I don’t have to dig through the conference literature or open my laptop and surf to the conference website (and pray, pray really hard for a good internet connection). But I’m sure as hell not going to print out screenshots of the damn thing or I’ll burn through a whole printer cartridge.

So I gotta ask the question: who in their right mind builds a Flash website with mostly text, with no print functionality, no textfield copying allowed, all in Black so no one would even dare print out a screenshot? Someone who was in a rush to get it out the door and didn’t think of the user experience, that’s who. That’s madness!

So you know what I did? Not to be daunted, I did take screenshots. Four of ‘em, which told me what I needed to know. I screencap’ed them, cropped them, and inverted the colours so they’d be in white instead of black so I can print them out. Here they are:

Adobe MAX NA 2008 Highlighhts ScreenhackAdobe MAX NA 2008 Highlighhts Screenhack
Adobe MAX NA 2008 Highlighhts ScreenhackAdobe MAX NA 2008 Highlighhts Screenhack

But really, should I have had to go to all that trouble just to make the data portable? The user experience of that website is so old skool it makes my teeth hurt, and is every argument that people use against using Flash. The animations and the game is cool, but I could care less about the eye candy when I’m looking for information. Flashturbation or what guys…

Some sites should never be in Flash. Such as text heavy, hyperlinked websites. Like brochure sites. Like blogs. Like research papers. Sites that the user will want to print out a lot of information. Not unless you’re willing to add the user experience features to make up for this handicap, and even then. To this day I refuse to bookmark or refer to any links from Flash-built blogs, on principle, because they’re such a pain in the ass to use.

Flash just got a whack of new text features; it has deeplinking; it has SEO; it has print functionality; it has enhanced clipboard copy; it has dynamic PDF conversion; it can iron your shirts and predict the weather. So use these features. Or make the site in HTML. But don’t botch the job and make us all look bad. Sorry, from the industry leader of this technology, I gotta call it like I sees it.

Adobe, you did a fantastic job of the MAX conference, I am deeply impressed by the organization of that event on so many levels. But after spending a months’ salary just to go to a conference, well… I expected a better experience. (web experience that is — I’m sure the conference itself will be blast!!)

For all I know this information will all be in the conference booklet I get when I get there. That’d show me and my big mouth, huh? :)

« Previous PageNext Page »