Blog

Cylinder Studio project featured in Lynda.com course

Posted in Blog, The Studio

I recently learned that a piece from the Cylinder portfolio, the Unitus Annual Report interactive presentation, was featured in coursework on the online training site, Lynda.com.

In Lynda.com’s course titled “InDesign CS5: Interactive Documents and Presentations,” the Unitus Annual Report was shown as a case study for building interactive Flash presentations right from InDesign documents.

You can see it here. Look under “Trends in Digital Design” > Annual Report Case Study: Unitus.

You can see the annual report here.

As an aid to education and fundraising, this multimedia version of the printed Unitus Annual Report was developed in 2009 using the Adobe InDesign-to-Flash export format in order to closely match the print version of the report.

iOS 5 Will Have Garbage Collection. (Sort of.)

Posted in Application Development, Blog

Fresh out of Apple’s WWDC 2011, several developers blogged their excitement about a sweet new iOS 5 feature: automatic garbage collection.

It turns out that garbage collection won’t be automatic, but rather, the SDK will feature a compiler-level feature called Automatic Reference Counting, which at the very least, will make memory management much easier for iOS developers by automatically inserting retain and release commands.

So while not officially automatically collecting garbage for memory, it still is very good news and will remove one of the biggest headaches for iOS/Cocoa Touch development. See the notice for “Automatic Reference Counting” on Apple’s iOS5 for Developers page.

Being new to iOS development myself, I’m also personally excited by “Storyboards” and the new version of “Instruments” in XCode.

Using Public APIs with Flash but no crossdomain.xml

Posted in Actionscript, Blog

A lot of the Flash and Flex applications I build are dynamically driven by XML. As many ActionScript devs know, a crossdomain.xml file is required to pull XML from a server that’s separate from the one where the SWF resides.

Until now, I’ve always used local XML documents, had access to the server where the XML was being served and could put a crossdomain.xml file in place, or had access to a public API that provided an XML feed and had a crossdomain.xml file already in place. But an application I’m working on now uses XML from a server where I have no access or ability to put a crossdomain.xml file.

Enter the PHP proxy and the ActionScript escape method. A PHP script handles the URL for the API call, but you have to encode that URL with its arguments before handing off to the proxy.

Example:

Here’s the code for the PHP proxy file, which goes on the same server as your SWF.

$post_data = $HTTP_RAW_POST_DATA;

$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);

$ch = curl_init( $_GET['url'] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}

$response = curl_exec($ch);
$response_headers = curl_getinfo($ch);

if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
header( 'Content-type: ' . $response_headers['content-type']);
print $response;
}

(Thanks to xmlrpcflash.mattism.com for the PHP script.)

Now, assuming you are using a Loader with a URLRequest to pull XML into your application, and your xml_proxy.php file is in the same directory as your SWF, you have to escape( ) on the URL call to the API server, then tack that on to the end of your URLRequest to the PHP proxy, like this:

var myXMLLoader:URLLoader = new URLLoader();

var API_URL:String = escape("http://theAPIServer.com?app_id=d57&app_key=e9409&format=xml");

myXMLLoader.load(new URLRequest("xml_proxy.php?url="+API_URL));

Voila! No security sandbox error from Flash Player.

HTML5 does kinda rock

Posted in Blog, Flash, JavaScript, xHTML/CSS

Yeah, HTML5 and CSS3 aren’t 100% ready yet, nor standard, and may not be for a while…but since when did waiting around in this industry do you any good?

At any rate, one of the better primers on HTML5 right now looks to be HTML5rocks.com. And be sure and check out their slide presentation on the new features.

Aptana Studio: Newest in the Toolbox

Posted in Blog, JavaScript, xHTML/CSS

In anticipation of doing more JavaScript development, I went back to look at the state of my editors on hand. BBEdit was always a favorite for quick-and-dirty text editing, and has a very simple interface with some good, basic tools for, say, quickly throwing together a table or other assortment of HTML tags…but it was lacking for serious development.

A while back, I upgraded to Coda. I really love the interface, and it has nice built-in tools for FTP and SVN. But I want robust JavaScript functionality, and while the code completion is satisfactory (aside from some minor built-in typos), JQuery support isn’t what I was looking for.

I had given Aptana Studio a quick look as a helper for building AIR with JavaScript. But I recently gave it a full test drive as a JavaScript editor and I really love it. The code hinting and auto complete is great, JQuery support (as well as the support for other frameworks) via easily installed plugins is fantastic. There’s also debugging, robust HTML/CSS code assist, live preview, aq DOM outline view, and FTP. What’s more is, having built a ton of ActionScript applications with Flex/Flash Builder, the Eclipse-style interface is very familiar to me, even though it’s more cluttered than Coda.

Not to mention: it’s open source! Check it out.

TRON: Legacy

Posted in Blog, General Tech

Aptana Studio: Building JQuery/AIR apps

Posted in Blog, Flash, JavaScript

InsideRIA has a tutorial that walks through using a tool called Aptana Studio for rolling HTML & JQuery into AIR applications.

Using MVC for JavaScript

Posted in Blog, JavaScript

A List Apart has this article about using MVC to maintain your JavaScript projects that are big enough to get a little nuts. For those of us who have done mostly client-side, user experience construction, MVC seems like a good concept to become familiar with as you dive into more proper “development.”

Display Objects and Memory Management

Posted in Actionscript, Blog, Flash

There’s a good article on InsideRIA.com describing the key differences between the “visible” variable, the “alpha” variable and the removeChild( ) method when managing memory in your Flash applications.