Saturday, August 08, 2009

MovieClip Timeline Control

Controlling the main timeline from a movie clip should be as easy as this:

function goHome(e:MouseEvent):void {
this.gotoAndStop("one");
}

But it doesn't work. Turns out that you can't do this in AS3 because root, this, and parent refers to display objects that don't have multiple frames. You need to encase the script with the MovieClip object as follows:

function goHome(e:MouseEvent):void {
MovieClip(root).gotoAndStop("one");
}

Strange, but true.

Labels: , , ,

Thursday, April 23, 2009

Lynda.com has a new Flash SEO course

Lynda.com has a new Flash with Todd Perkins entitled: Flash CS4 Professional: Building Search Engine Friendly Sites. [Login required to view full course.] Perkins starts off with some straight HTML fundamentals and how search engines work. So for the advanced user, you might want to skip ahead.

Al Lemieux
Lemieux Design

Labels: ,

Wednesday, April 01, 2009

Flash CS4 Interface

I've been using Flash CS4 for a while now and I'd have to say that the biggest complaint I have is the interface. I understand Adobe's move here, but I feel very restricted by the environment, as if there isn't enough room to get my work done. There still isn't a logical place to keep the Actions Panel, Timeline, and Stage in view. Those, I feel, are the most important panels to me.

Another troubling aspect of this version is the shift in paradigm on the Tool panel. I'm so used to looking for the vertical Tool panel, that sometimes I forget where the tools are. Then actually finding the tools I need to use becomes an issue.

Granted, there are other Workspaces in the Window menu, but they don't seem to suit my needs. What are your thoughts on the new interface?

Labels:

Dynamic Text Fields

I had a recent issue with Dynamic Text Fields. In an interface I designed, I had a set of button symbols - just simple buttons. I didn't want to put any text labels in the buttons themselves, I wanted the text to come from an external XML file. So I set up the XML file and got the text into a Dynamic Text Field that I had in a layer above the buttons.

The problem happened when testing the movie. The buttons normal behavior was blocked by the Dynamic Text Field?!? For example, when hovering over the button, the cursor stopped being a hand cursor over the text field. Any rollover effects stopped when the cursor was over the text field. So I thought it was an issue with the text field itself, like some appearance property or something. I tried all of the settings and it didn't change anything.

After posting questions to a couple of forums, I finally got the answer. With ActionScript, you need to set the text fields mouseEnabled property to false:

textfield1.mouseEnabled = false;

That means that the text field doesn't respond to mouse events at all. Problem solved.

It seems odd to me that Dynamic Text Fields do this at all. I don't think this was a normal behavior in versions prior to CS4.

Labels: , ,

Friday, January 30, 2009

Flash AS3 MP3 Player with XML

I'm working on an XML-based MP3 player in AS3 and there are so many things to think about here. For example, AS3 allows you to read ID3 tags from MP3 files. But I found out with a lot of testing, that it doesn't read all ID3 tags. In my case, I gave it a bunch of different MP3 files and it didn't read anything.

Here's the code:

var url:String = "Falling Down.mp3";
var request:URLRequest = new URLRequest(url);
var mp3:Sound = new Sound(request);
mp3.addEventListener(Event.ID3, id3Handler)
mp3.play();

function id3Handler(event:Event):void {
var song:Sound = Sound(event.target);
var songInfo:ID3Info = ID3Info(song.id3);
trace("ID3 loaded");
trace("\t artist: " + songInfo.artist);
trace("\t track: " + songInfo.track);
trace("\t comment: " + songInfo.comment);
trace("\t songName: " + songInfo.songName);
trace("\t album: " + songInfo.album);
trace("\t genre: " + songInfo.genre);
trace("\t year: " + songInfo.year);
textArea.text += "album" + ":\t" + song.id3.album + "\n";
textArea.text += "artist" + ":\t" + song.id3.artist + "\n";
textArea.text += "comment" + ":\t" + song.id3.comment + "\n";
textArea.text += "genre" + ":\t" + song.id3.genre + "\n";
textArea.text += "songName" + ":\t" + song.id3.songName + "\n";
textArea.text += "track" + ":\t" + song.id3.track + "\n";
textArea.text += "year" + ":\t" + song.id3.year + "\n";
textArea.text += "---------------------------------";
}

No luck with this. Anyone else have a problem with ID3? I think a more common practice is to get the info from an XML file. The problem with that is now you have to continuously update or change the XML file.

Anyhow, let me know what you think.

Labels: ,

Wednesday, November 12, 2008

Flash CS4 Trial Now Available

Adobe has released the trial version of Flash CS4 and other CS4 products. Get them at www.adobe.com

Labels: ,

Wednesday, September 24, 2008

Motion Tweening in CS4

Flash CS4 has a new Motion Tween feature that's object based, instead of timeline-based. This is very much like the tweening in After Effects. Depending on where you are in the timeline and what object you have selected, you can right-click (control-click) on the timeline and choose Motion Tween. Then you can change the properties of that object in the properties panel. Move to another spot on the timeline and continue to change the properties. All of the tweening is done for you.

Labels: ,

Thursday, July 03, 2008

Flash CS4 Sneak Peek

Flash Magazine has posted some pics and details on the new Flash CS4 interface and features, revealed at a conference in Sydney. The new interface features a larger properties inspector that sits on the right dock and not at the bottom anymore. The rationale? More space for more access to parameters.

Also new is the timeline, which now allows you to control object in the Z-depth. The new IK (inverse Kinematics) option looks fantastic and I can't wait to try it. In general, new 3D features will be awesome to play with in this release.

Labels: ,