Archive for February, 2009

Symposium on combining art and programming next weekend in Pittsburgh

Saturday, February 28th, 2009

artcode

I learned about this too late unfortunately(!), as many of the workshops are now full, but there is a symposium called ArtAndCode happening next week, March 7-9, 2009, at Carnegie Mellon University in Pittsburgh, PA. I am very busy right now, but am quite tempted to attend the first two days. General admission is only $25. The symposium is organized by the very creative Golan Levin, and has a long list of creative professionals speaking, including Ben Fry, co-creator of Processing.

What would a browser look like if the Web was all there was?

Thursday, February 26th, 2009

Mozilla Labs has a design challenge to encourage students to answer this question. In their own words:

As the Web becomes even more ubiquitous, we’ll never have to leave it. Whether it’s on touch tables, giant wall-sized screens, mobile devices, or just our computers, exploring the interactions for browsing a windowless Web will become ever-more important in the next couple of years.

To get started, you’ll need to submit a mockup of your idea. This can be anything from a napkin drawing, to a wireframe, to a polished graphic or video.

Unfortunately the deadline for the initial phase is only 3 days away, on March 1st!

Common Flash Compiler Errors: #1009

Thursday, February 26th, 2009

My students often run into the same kinds of errors, so I thought I would post some info on the more common ones. One very common error to receive in Flash is this one:


TypeError: Error #1009: Cannot access a property or method of a null object reference.

Quick Answer and Solution

Somewhere in your code there is a variable that you are using to refer to a property or method of an object (such as a movie clip), however, it does not actually contain an object so it throws an error. Look for the parts of your code where you have a dot following a variable name and some property or method, such as myMC.width or myMC.startDrag(). Place a trace statement above this variable to see if its value is null.

 
trace( myMC );
// if this lists "null" in the output window the next line of code will throw an error
// look for the first occurrence of myMC (where it was created) to see why it does not 
// contain a reference to something other than null
myMC.width = 200;

Technical Overview

Objects are collections of variables and functions that are defined in a class file. In the context of Object-Oriented Programming, variables are referred to as properties, and functions are referred to as methods. A movie clip object (which is an instance of the MovieClip class) contains properties and methods for dealing with the appearance and interactivity of movie clips, such as x, y, width, height, startDrag(), addEventListener(.), etc. When a new object is created it is typically stored in a variable—technically meaning a reference to the object is stored in the variable, not the actual object—the variable acts like a unique identifier to lookup the object within a particular section of code (called the scope of the variable).

For example, a new movie clip object can be created with new MovieClip(), this would then be stored in a variable (named myMC in this example) with the code var myMC:MovieClip = new MovieClip();. Properties and methods of this movie clip object can be accessed using dot notation. For example, to return the width in pixels of the movie clip, the following may be typed:

var myMC:MovieClip = new MovieClip();
trace( myMC.width );
// outputs 0 because the movie clip doesn't have any graphics, 
// and is therefore 0 pixels wide

If the variable was created, but not set to reference a new movie clip object instance, it will be empty and contain the special value of null, denoting the absence of a reference to an object. Trying to access a property or method via the variable would then mean the computer would attempt to find the property or method of a null value, which being a placeholder for “no value,” throws an error.

var myMC:MovieClip;
trace( myMC.width );
// throws error #1009 because the variable myMC does not contain a reference to an object

Adobe announces a slew of new initiatives for mobile development

Monday, February 16th, 2009

Today was a big news day for mobile content developers—at least in the eyes of Adobe, whom, to coincide with their participation in the GSMA Mobile World Congress, released a number of press releases detailing—among the finer technical points—the incredibly large sum of money they are throwing at securing Flash as the de facto platform for multimedia on mobile devices.

A summary of their announcements is as follows:

Adobe Flash Lite 3.1 Distributable Player

Available immediately to developers via Adobe Labs, the Adobe Flash Lite 3.1 Distributable Player, if I interpret it correctly, sounds like a mobile version of Adobe AIR. Using something called the Adobe Mobile Packager, a SWF application can be bundled with a player version checker, an icon, and metadata to provide an installable file that can be distributed to mobile devices with Flash Lite support. Because of the player version checker, developers can target the latest version of the player without worrying about their end-users not being able to view the content. Should they have an earlier version of the player, the version checker can download the latest version without leaving their application. This eliminates the step of requiring a user to navigate to Adobe’s site to download the latest version of the Flash Lite Player, and then returning to the application they were originally attempting to view. With an update, content targeting the latest Flash Lite player can be created with Adobe Flash CS3/CS4 Professional, and Adobe Device Central CS3/CS4.

Flash Lite Developer Challenge

To spur on Flash Lite development, Adobe has launched a competition called the Flash Lite Developer Challenge. The competition is offering a combined total of $100,000 in cash prizes for the best applications developed in the following areas: Game, Lifestyle, Infotainment, Sports, Social Networking, and Most Innovative Application. This reminds me of the ongoing Ribbit Killer App Challenge.

$10 million Open Screen Project fund

The Open Screen Project, an initiative aiming to enable a consistent experience for web browsing and standalone applications is barely a year old, but now thanks to the collaborative effort of Adobe and Nokia, the project has a US$10 million fund available to support developers in creating applications and services for mobile, desktop and consumer electronics devices using the Adobe Flash Platform. An Adobe press release provided the following details:

Projects submitted for development will be reviewed by a group of multi-screen application and services experts from Open Screen Project partners including Adobe and Nokia. Focus areas include: entertainment; social networking; productivity; gaming; news and information. Developers retain all rights to their applications while Adobe and Nokia have the right to evaluate, test and promote the content. For more information and details on how to apply, visit www.openscreenproject.org.

Full-fledged Flash Player 10 coming to Smartphones

While the elusive iPhone is still not in this mix, a full-fledged version of the Adobe Flash Player 10 (the full version of the player that runs on desktop PCs) is coming soon to a whole group of smartphones. It will be available on smartphones running Windows Mobile, Google’s Android, Nokia S60/Symbian, and the new Palm operating systems. Devices using Flash Player 10 are expected to hit the marketplace in 2010. This is great news for developers, as it provides continuity between developing for the desktop player and a mobile device.

Adobe Reader Mobile 9 SDK

Adobe announced the Adobe Reader Mobile 9 software development kit (SDK), a proprietary SDK for allowing third-party mobile developers to implement PDF and eBook (utilizing the EPUB format, an XML-based format for eBooks) viewing functionality on their devices. At the moment, the SDK is available to “OEMs, ISV integrators, and mobile applications developers on a case-by-case basis,” so the impact will likely been seen in existing big-name devices. For example, the Sony’s Reader Digital Book already utilizes the Adobe PDF engine.

Flash movie clip transformational properties explorer, manipulate values live!

Thursday, February 12th, 2009

I created this simulation to visually show the relationships between a movie clip’s (actually any display object’s) transformational properties (x, y, width, height, scaleX, scaleY, rotation, and transformational matrix). Drag the square around the “Stage” and move the sliders to transform it. Each property is prefixed with a dot “.” since in a real application these properties would be accessed via myMC.x or myMC.transform.matrix.tx, for example, where myMC is the instance name of the movie clip on the stage.

Additionally, if you look carefully this shows an apparent bug in the way ActionScript 3 handles the width and height properties of a rotated movie clip (see Grant Skinner’s post on the subject). If the movie clip is rotated and the width and height sliders are moved slowly, they will swap their values back and forth as one or the other is adjusted. This could stem from the fact that the height and width are of the dimensions of the bounding box, not the movie clip itself, and they may be trying to maintain the proportions of the movie clip when adjusted. Or it’s a bug.

This movie requires Flash Player 9

Spring <br /> Conference 2009 call for speaker proposals

Wednesday, February 11th, 2009

sblogoThis year I am co-chairing the Spring <br /> Conference, an annual one-day web technology and design conference happening June 9th at Ohio University, in Athens, Ohio. In the past the conference has drawn an average of 350 attendees regionally and from across the country.

I would encourage anyone with expertise in a particular area of website development and design to submit a speaker proposal, as there are still speaking opportunities available. Also, feel free to contact me with any questions.

Flash CS3 IDE not displaying all coordinate decimal places

Monday, February 2nd, 2009

Flash CS4 has corrected this issue, but in Flash CS3 the coordinates of a movie clip on the Stage are only displayed to the first decimal place (e.g. 100.5). So an x coordinate value of 100.55 would be displayed in the Properties panel as 100.5, yet still be 100.55 in the x property of the movie clip instance.

To test this, create a new document in Flash CS3 and go to Insert –> New Symbol…, choose Movie clip and draw a rectangle in the new symbol. Return to the main Timeline and drag the new movie clip symbol to the Stage. In the Properties panel, set the X coordinate value to 100.55. Notice that it shortens it to 100.5. Now drag a new instance of the symbol onto the Stage and set the X coordinate value to 100.5. Clicking on either instance on the Stage will show the same X coordinate value (of 100.5). Now give the symbols on the Stage the instance names box1 and box2. Click on the first frame and open up the Actions panel and type

trace( box1.x , box2.x );

Test the movie. It will output:

100.55 100.5

This shows that a slight difference in positioning of the two movie clips actually does exist. While this is an ever-so-slight difference in position, it can be visually apparent. To fix it, the X coordinate value of the movie clip with the extra decimal value can be retyped in the Properties panel as a slightly rounded value (100.5 in this case).

Flash CS4 has addressed this issue, as two decimal places are displayed when the X,Y coordinate values are adjusted.

Flash for the iPhone, closer to actuality

Sunday, February 1st, 2009

While Adobe has been at work on a Flash Player for the iPhone at least since last March (Wall Street Journal: Adobe Working on Media Player for iPhone), the effort has sounded one-sided, with Apple’s Steve Jobs panning the player for running “too slowly for the iPhone,” and describing Flash’s slimmed down mobile cousin, Flash Lite, as not “capable enough to be used with the Web.” Jobs wants something that isn’t such a resource hog as the desktop plugin, but is more capable than the current Flash Lite (which has yet to offer anything more than ActionScript 2.0 support).

That wish may be sooner than ever to reality, as Adobe’s CEO Shantanu Narayen said in a recent interview that “Apple and Adobe are collaborating,” and that “the ball is in our court. The onus is on us to deliver.” Apple’s receptivity to the development of a tailored Flash Player for the iPhone is a promising indicator that rich interactivity may soon be delivered to the iPhone through ActionScript in addition to Objective-C.