In Flash CS3... Say you have a MovieClip instance named "my_mc" on frame 1 and add an event listener and you then create a keyframe in frame 2.
If you move that keyframe in frame 2 to another layer, it no longer has the listener. This action creates a new instance of that symbol
If you move the keyframe in frame 2 to frame 3 and insert a blank keyframe between the two, it no longer has the listener because this action also results in a new symbol instance on frame 3.
If you swap a different symbol, it no longer has the listener (not a surprise).
BUT... If you keep the keyframe in the same layer and don't swap the symbol, the instance still has the event listener. Keyframing on the same layer without breaks retains the same symbol instance.
I suppose not that surprising once I think about it, that by moving the symbol instance to a new layer the result is a different instance of the same symbol. A quick trip through the debugger confirmed this.
Saturday, September 01, 2007
MovieClip Identifiers
Here's something interesting I found in Flash CS3 using ActionScript 3. Say you have the following:
Frame 1:
trace(this.hasOwnProperty("my_mc");
trace(my_mc);
Frame 2:
A MovieClip instance named "my_mc"
trace(this.hasOwnProperty("my_mc"));
trace(my_mc);
The output is:
true
null
true
[object MovieClip]
So Flash assigns the property identifier "my_mc" to the current timeline's instance at the start of the movie, before the actual instance occurs on the stage. Then when it does, that property is populated with a reference to the instance. I assume the identifier is created at compile time.
Frame 1:
trace(this.hasOwnProperty("my_mc");
trace(my_mc);
Frame 2:
A MovieClip instance named "my_mc"
trace(this.hasOwnProperty("my_mc"));
trace(my_mc);
The output is:
true
null
true
[object MovieClip]
So Flash assigns the property identifier "my_mc" to the current timeline's instance at the start of the movie, before the actual instance occurs on the stage. Then when it does, that property is populated with a reference to the instance. I assume the identifier is created at compile time.
Thursday, August 23, 2007
Getting back the hand cursor in AS3
As I migrate from Flash ActionScript 2 (AS2) to ActionScript 3 (AS3), I'm always finding little differences. In AS2, if you set the onPress event of a MovieClip to a value, your MovieClip will then cause the cursor to switch to the hand cursor when you mose over it. I found in AS3, you need to manually set two properties to get this effect (thanks Colin!):
Below is a class that extends from MovieClip, and in its constructor it sets the two properties I'm looking to be set:
myClip_mc.buttonMode = true;That's kind of a drag if you have already created a movie with dozens (or more!) of clickable MovieClip instances. I'd done just that so I was hoping I was missing some global way getting back this functionality easily. There wasn't... so I made one :)
myClip_mc.useHandCursor = true;
Below is a class that extends from MovieClip, and in its constructor it sets the two properties I'm looking to be set:
package {So all I had to do was go into my library and set the Base Class of each of the Symbols I knew I wanted clickable in my movie. One weird thing I found: after typing that in to the base class field, I needed to click the check mark next to it, it you just clicked "OK" then it'd give you an error.
import flash.display.MovieClip;
class ClickableMovieClip extends MovieClip {
function ClickableMovieClip():void {
this.buttonMode = true;
this.useHandCursor = true;
}
}
}

Sunday, August 19, 2007
Great sites for educational DVDs
I found a couple great resource for educational DVDs. Not educational in the "reading, 'riting, 'rithmetic" sense, but along the lines for learning computer programs, traditional arts and crafts, hobbies, and a variety of "do-it-yourself" training.
The first place is SmartFlix.com. SmartFlix rents these types of DVDs. Unlike the similar sounding NetFlix, SmartFlix does not charge a monthly subscription. You pay $9.99 to rent a DVD for a week, which include shipping (to and from). This is a great way to check out DVDs before buying them (which can be expensive).
The next place to check out is LearningByDVD.com. LearningByDVD was recommended to me by the SmartFlix folks. They sell a huge range of DVDs, like the ones you can rent from SmartFlix. I bought a half-dozen from them already and find the customer service to be outstanding. They even ordered some DVDs they don't normally stock to fill my order. If you don't see something in their inventory, make sure you ask!
The first place is SmartFlix.com. SmartFlix rents these types of DVDs. Unlike the similar sounding NetFlix, SmartFlix does not charge a monthly subscription. You pay $9.99 to rent a DVD for a week, which include shipping (to and from). This is a great way to check out DVDs before buying them (which can be expensive).
The next place to check out is LearningByDVD.com. LearningByDVD was recommended to me by the SmartFlix folks. They sell a huge range of DVDs, like the ones you can rent from SmartFlix. I bought a half-dozen from them already and find the customer service to be outstanding. They even ordered some DVDs they don't normally stock to fill my order. If you don't see something in their inventory, make sure you ask!
A few of my favorite things...
There are a few pieces of software, freely available, that I really like. I like them better than some commercial alternatives. For example, Adobe recently came out with version 2 of their Bridge software. Version 1 was useless, but version 2 is much more usable. Still, I find myself going back to the free XnView for browsing images. It launches and runs significantly faster than the Bridge. I find it useful even as a file browser. You can also use it to convert between file formats and make common adjustments to images like rotating, cropping, contrast and levels. An interesting feature is how it deals with a Photoshop file, it allows you to page through the layers. By default it shows the composite version of the visible layers, but you can click through and look at each individually.
Another nice, free program I keep coming back to is Filezilla. It is a ftp client that has a great user interface.
I was recently introduced to XML Notepad 2007. It is built with .NET and has is a fast, simple, well-designed program for editing XML. It makes ftp operations easy. It amazes me the increasing quality of free and open source software.
While not freeware, I like the inexpensive ZuluPad Pro. It does have a free version, ZuluPad, but I feel the pro version for $15 is worth the price. ZuluPad Pro is a great way to keep a hypertext linked set of notes. I find my document often goes beyond what I intend when I started. It's small and fast and easy to use (Can you see a theme here? I guess it from years of being a Mac user since 1986, though I'm on XP now).
Another nice, free program I keep coming back to is Filezilla. It is a ftp client that has a great user interface.
I was recently introduced to XML Notepad 2007. It is built with .NET and has is a fast, simple, well-designed program for editing XML. It makes ftp operations easy. It amazes me the increasing quality of free and open source software.
While not freeware, I like the inexpensive ZuluPad Pro. It does have a free version, ZuluPad, but I feel the pro version for $15 is worth the price. ZuluPad Pro is a great way to keep a hypertext linked set of notes. I find my document often goes beyond what I intend when I started. It's small and fast and easy to use (Can you see a theme here? I guess it from years of being a Mac user since 1986, though I'm on XP now).
Tuesday, August 14, 2007
Bridging Flash 8 to Flash CS3

I was looking for a book or video to bridge between Flash 8/AS2 and Flash 9/AS3. I found just what I needed with Flash CS3 Professional Advanced: Visual QuickPro Guide by Russell Chun. Chun has done an outstanding job with the use of diagrams to explain concepts as well as providing a generous number of screenshots. I've even learned a few unexpected things along the way. Having co-authored two books myself (Director and Lingo Bible versions 7 and 8), I know he must have put a great deal of work into this and it shows.
Thursday, August 09, 2007
Flash Scenes
One thing that I never used with Flash is the Scene feature. I was always aware of it, I'd just never needed it. Plus, scenes don't get much of an buildup from the online help (the emphasis in bold I added):
I've been doing some Savvy Development, following the Allen Interactions way, using Flash. While I was working on the media prototype in Flash, the media prototype is developing the look of the piece. I was getting frustrated with doing different screens for the app and was about to switch to Photoshop to just do a static bitmap representation of the screens. Then I decided to try the scene feature. WOW! Did that make doing different screens easy! In the Scenes panel you can give the scenes meaningful names and keep it open to quickly switch between scenes. Then I saw the Duplicate Scene and things got even easier!
Now I wouldn't recommend them for the final developing the final product, but I would for when you need to develop a series of screens rapidly. If you're not using them, you should give it a try.
- Scenes can make documents confusing to edit, particularly in multiauthor environments. Anyone using the FLA document might have to search several scenes within a FLA file to locate code and assets. Consider loading content or using movie clips instead.
- Scenes often result in large SWF files. Using scenes encourages you to place more content in a single FLA file, which results in larger FLA files and SWF files.
- Scenes force users to progressively download the entire SWF file, even if they do not plan or want to watch all of it. If you avoid scenes, users can control what content they download as they progress through your SWF file.
- Scenes combined with ActionScript might produce unexpected results. Because each scene Timeline is compressed onto a single Timeline, you might encounter errors involving your ActionScript and scenes, which typically requires extra, complicated debugging.
I've been doing some Savvy Development, following the Allen Interactions way, using Flash. While I was working on the media prototype in Flash, the media prototype is developing the look of the piece. I was getting frustrated with doing different screens for the app and was about to switch to Photoshop to just do a static bitmap representation of the screens. Then I decided to try the scene feature. WOW! Did that make doing different screens easy! In the Scenes panel you can give the scenes meaningful names and keep it open to quickly switch between scenes. Then I saw the Duplicate Scene and things got even easier!
Now I wouldn't recommend them for the final developing the final product, but I would for when you need to develop a series of screens rapidly. If you're not using them, you should give it a try.
Subscribe to:
Posts (Atom)