May 5th, 2010
by Jen deHaan
Some people have been asking how to create button code in Flash (CS3, CS4, or CS5) that progresses the playhead in a SWF to the next or previous frame using ActionScript 3.0. This is not too difficult, and is a super simple code modification from any other button in AS3 (and is actually a touch easier than AS2 due to scoping issues).
This post includes an example of how to create two buttons that click between a few different frames. I’ll also include a (CS4) FLA file for you to look at and the AS2 equivalent.
read more »
Posted in ActionScript 2.0, ActionScript 3.0, FLA files, Flash CS3, Flash CS4, Flash CS5, Migration, buttons | 3 Comments »
October 6th, 2009
by Jen deHaan
A “FAQ” about new motion tweens is how to scale the entire animation after you have created it. New motion tweens “auto-keyframe”. This can be very helpful when animating, because it saves you a step – you can just make your changes and everything tweens nicely. However, it also means that you need to think about things when you need to revise the entire animation. You don’t use “Edit multiple keyframes”, since you really only have one keyframe at the beginning of the animation. So I’ll go over a few of the things you may encounter.
1. Moving an entire animation with a motion path.
If you have a motion path, this is easy – you select the motion path (click it, or marquee-select over your instance), and then drag it to a new location on the stage or use the X-Y hot text for the path.
2. Moving an entire animation without a motion path.
If you do not have a motion path and do not want a motion path, you need to make sure your playhead is at frame 1 of the tween span, and then move the instance to a new location. Make sure you haven’t accidentily placed any position keyframes. If you do have a path, delete it or go to the Motion Editor and right-click the X and Y motion paths and choose “Reset Property” (or click the Reset button for Basic motion if you don’t have rotation applied).
3. Scaling an entire animation that doesn’t have Scale X or Scale Y animated.
You can scale the tween with the motion path. Just go to the first frame of the tween, and select the instance and path using the Free Transform Tool (hold Shift to multi-select), or use the Transform panel for each selection. Scale it as you do any path or instance, and because you’re at the first frame the changes will apply across the entire tween.
4. Scaling an entire animation that does have Scale X or Scale Y animated.
If you have previously scaled anything in the tween, doing this is applied to the first keyframe and the tween would animate to the earlier scaling (the auto-keyframing feature can be a detriment in this situation, especially when it comes to scaling due to the percentages being reset – for this reason Motion Presets also won’t help). In this situation, I recommend scaling using the Motion editor:
1. Go to the Scale X and Y properties in the Motion Editor.
2. Press the Alt key while dragging the curve in each graph up and down. This scales the entire scale animation at the same time (same as edit multiple keyframes).
3. If you need to proportionally scale the motion path for the tween as well, select the path on the Stage and use Free Transform or enter a new value in the Transform panel.
Posted in Flash CS4, Flash CS4: motion, Flash CS4: new features, Migration, Motion Editor, animation, motion path, motion tween, new stuff, symbols, timeline, transform, tweens | 17 Comments »
July 24th, 2009
by Jen deHaan
One of my frequently asked questions in the comments is how to control what window a button click opens using ActionScript 3.0. For example, you might want your button to open in the same window, a particular part of your frames layout, or a new window. It’s similar to ActionScript 2.0, but there is a bit of a difference.
In ActionScript 2.0, you set a target for your button using code such as the following:
The following steps for ActionScript 3.0 will apply to either Flash CS3 or Flash CS4, just make sure that your document is an ActionScript 3.0 button and you’re adding the code to a frame.
- Create your button in your FLA, and give it an instance name in the Property inspector, such as
my_btn.
- Select a frame on the timeline at the same frame number of your button.
- Open the Actions panel, and add the following code:
my_btn.addEventListener(MouseEvent.MOUSE_DOWN, myHandler);
function myHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.adobe.com/devnet/flash/"), "_self");
}
- Publish preview your work in HTML (File > Publish Preview > HTML). Note: When testing locally, you will need to set your security to allow access to the SWF. If you haven’t set this up, click Settings in the dialog that opens when you first test your FLA, select a directory on your hard drive, and save the FLA to that same directory and test again.
By default, without adding this parameter, ActionScript assumes _blank which opens a new window. You can modify the _self in the code above to be _top or _parent (or _blank if you want). Here’s what each of them does:
_self opens the link in the current frame of the current browser window.
_blank opens the link in a new window (or tab if that’s what the user has their browser set to do).
-
_parent opens the link in the parent of the current frame.
_top opens the link in the top-level frame of the current browser window.
Posted in ActionScript 2.0, ActionScript 3.0, Flash CS3, Flash CS4, Migration, buttons | 34 Comments »
July 24th, 2009
by Jen deHaan
The Learning Resources team at Adobe is seeking people to partake in a study of your Flash workflow. Those who participate get an Amazon gift card and thanked profusely, and of course will help make Flash better, so if you are a match it should be worth your time.
Please see Jay’s post here for more information:
http://blogs.adobe.com/jayarmstrong/2009/07/seeking_participants_for_a_bri.html
His post outlines:
a) The criteria to meet (many of you could be a match to at least one of them)
b) The contact information if you meet the criteria and want to participate.
Please check out the post if you’re interested in helping make Flash better (and getting something from Amazon)!
Posted in Flash CS4, General, get free stuff, input wanted | No Comments »
May 5th, 2009
by Jen deHaan
Justin Putney at Ajar Productions has created some amazing extensions that you can use with Flash CS4 and the new motion model to help with your tweens or create them. Justin’s extensions are not only useful, but well implemented and documented on his blog.
For some helpful detailed info about the extension creation, check out this post on the Ajar Productions site.
For information/download for the MotionSketch extension, which records/creates a tween based on you drawing in Flash (!), see this post.
For the Motion Blur extension, which analyzes the movement of your tween and then creates a motion blur. see this post.
Many thanks to Justin for your hard work, and excellent extensions.
Posted in Flash CS4, Flash CS4: motion, JSFL, animation, downloads, motion tween, new stuff | 3 Comments »
May 5th, 2009
by Jen deHaan
We wrote an article to help you migrate your skills and tweens from old to new in Flash CS4. It accompanys a new Animation Learning Guide on the Developer Center (they go hand in hand, lots of cross links) – and since it is now out, so is the migration article.
Check them out here:
* Motion Migration Guide for Flash CS4
* Animation Learning Guide
Let us know what you think!
Posted in FLA files, Flash CS4, Flash CS4: motion, Flash CS4: new features, Migration, Motion Editor, animation, articles, motion tween, new stuff, tweens | 2 Comments »
May 5th, 2009
by Jen deHaan
It took awhile to produce this due to its length (over 80 pages in word I think), but the Animation Learning Guide for new motion (introduced in Flash CS4 last fall) is finally out:
http://www.adobe.com/devnet/flash/learning_guide/animation/
It is divided into a bunch of sections based on topic, so click from this page to the topic you want to learn about. Also note that there is a FLA download of samples to help you out.
For more information on whatever, let us know. If you’re upgrading from classic tweens to new tweens, check this other article out too.
Posted in FLA files, Flash CS4, Flash CS4: motion, Flash CS4: motion runtime, Flash CS4: new features, Migration, Motion Editor, Motion Presets, Motion runtime, Tween instance, animation, articles, masking, masks, motion tween, tweens | 8 Comments »
January 9th, 2009
by Jen deHaan
If you’ve created motion tweens in versions of Flash Past, chances are you’ve pressed F6 a few times in order to insert new keyframes. Doing so has probably become very familiar to you as well – you want to change something for an animation, then you press F6. Automatically. It’s a habit.
You can still use F6 to insert static keyframes on the Timeline (that you might turn into a motion tween), and you can even use them to insert property keyframes within a tween span too. However, within a tween span pressing F6 will insert a property keyframe on every single property currently associated with the target instance. This is usually way more keyframes than you actually need at that frame, so using F6 on a tween span is usually not the best thing to do for your animation – especially if you intend to continue modifying it. You’ll likely end up with unexpected things happening in your animation. So in Flash CS4, you might want to work at breaking the F6 habit.
Instead of pressing F6, you can insert keyframes other ways:
- Simply change the instance. Most of the time, this is all you need to do to insert a keyframe at the playhead’s position. If you need to tween to a new location, move the instance there. If you need it to scale or skew, use the Free Transform tool. If you need the instance to blur, change the value in the Property inspector or Motion Editor.
- Right-click the tween span and choose Insert Keyframe > Type. This adds keyframe(s) for the category you select at the current playhead, which reduces the number of keyframes inserted. For example, if you choose Insert Keyframe > Filter it adds a keyframe on all filter properties. To further reduce the number of inappropriate keyframes, use the Motion Editor.
- Use the Motion Editor. You can use the Add Keyframe button (yellow or gray diamond), graph context menu, or Ctrl/Cmd key over the graph to insert a keyframe on individual properties.
Posted in Flash CS4, Flash CS4: motion, Flash CS4: new features, Migration, animation, motion tween, tweens | 19 Comments »
December 18th, 2008
by Jen deHaan
A frequently requested item for Flash is the ability to see a grid over your artwork on the Stage. Flash CS4 now lets you do just that using a new option in the Edit Grid dialog. Let’s look at the change, which you might not have noticed yet because it’s turned off by default. Keep reading to learn how.
read more »
Posted in Flash CS4, Flash CS4: new features, instances, new stuff, symbols | 1 Comment »