June 4th, 2010
by Jen deHaan
There are a number of forum posts about code hinting not showing up as expected in Flash CS5 documents. There are a number of possibilities about why code hints do not show up, but the following post will collect some troubleshooting tips that may help you out.
read more »
Posted in ActionScript 3.0, Flash CS5, workaround | 5 Comments »
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 »
May 5th, 2010
by Peter deHaan (ActionScriptExamples.com)
The following examples show how you can get started with the TLFTextField class in ActionScript in Adobe Flash Professional CS5.
read more »
Posted in ActionScript 3.0, Flash CS5, Flash CS5: new features, TLF, text | 7 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 »
December 10th, 2008
by Jen deHaan
In the previous blog entry, I linked to a new JSFL that automatically gives instance names to selected instances in a smart way. You can go read about and download the JSFL from this page. This entry shows you how to use this command along with some of the new features in Flash CS4.
read more »
Posted in ActionScript 3.0, Commands, Easing, FLA files, Flash CS4, Flash CS4: motion, Flash CS4: motion runtime, Flash CS4: new features, General, JSFL, Migration, Motion Editor, Motion runtime, Tween instance, animation, downloads, instances, motion tween, new stuff, tweens | 6 Comments »
November 21st, 2008
by Jen deHaan
Today the Text Layout Framework went live for Flash Player 10. This will help you layout your text in new and much better ways in your applications. You may have seen some demos at MAX (like the Herald Tribune demo) where the text flow, direction, etc was handled way better – now the functionality is on LABS. Check it out here:
http://labs.adobe.com/technologies/textlayout/
Note that you can download FLA examples from the presentation at the top of the page, to help you understand how to use the component.
To quote the page,
“The Text Layout Framework is an extensible library, built on the new text engine in Adobe® Flash® Player 10, which delivers advanced, easy-to-integrate typographic and text layout features for rich, sophisticated and innovative typography on the web. The framework is designed to be used with Adobe Flash CS4 Professional or Adobe Flex®, and is already included in the next version of Flex, code named Gumbo. Developers can use or extend existing components, or use the framework to create their own text components.”
You can download and install the component in Flash CS4, try it out for yourself.
http://labs.adobe.com/downloads/textlayout.html
Posted in ActionScript 3.0, Flash CS4, General, symbols, text | 6 Comments »
October 19th, 2008
by Jen deHaan
You might have created movie clip buttons in Flash CS3 or Flash CS4 (or Flash 8 or 7 or…) before to get those animations on your buttons. Either way, creating one would have proceeded a bit like the following if you used ActionScript 2.0.
* Create a button, and give it an instance name (in the following case, myMc).
* Along the Timeline, add frame labels _up, _over, _down, and _hit (if you want a hit area for the button).
* Put stop actions at each frame label, and change the graphics and/or add some animation at each state.
* Add this code to frame 1 in the actions panel:
myMC.onRelease = function() {
trace ("You clicked me.");
}
(For full instructions on creating a movie clip button, you can refer to something I wrote for docs waaay back in Flash 8 days here updated for CS3).
More after the jump.
read more »
Posted in ActionScript 2.0, ActionScript 3.0, Flash CS3, Flash CS4, Flash CS5, Migration, buttons | 23 Comments »
October 12th, 2008
by Jen deHaan
Yesterday at FlashCamp, I gave a presentation on using the new motion model in Flash CS4. The files are linked on this post. This is a general synopsis of what I covered, and I’ll detail how I did a few things in the presentation. Please comment with any questions you have.
More after the jump.
read more »
Posted in ActionScript 3.0, Easing, 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, motion tween, presentations, symbols | 10 Comments »
October 11th, 2008
by Jen deHaan
Here are the FLA and SWF files (Flash CS4 and Player 10) for today’s presentation at FlashCamp on new motion in Flash and using Tween instance (contains that ActionScript).
FlashCamp files for motion tween presentation
The next post will be a bit more about these files and the stuff used in them.
UPDATE: Here it is! For a bunch of information about the presentation and the files in that ZIP above, read this.
Enjoy!
Posted in ActionScript 3.0, FLA files, Flash CS4: motion, Flash CS4: motion runtime, Flash CS4: new features, animation, presentations | 1 Comment »
September 4th, 2008
by Jen deHaan
You may have tried creating a shape that has a hole in it for a mask in Flash, and it may not have worked. Or maybe it did work and sometimes it didn’t, and you grew some extra gray hairs and threw your laptop at a wall. Or maybe you’re thinking “what the hell is she talking about now?”. I’ll start from (almost) the beginning [if you're not sure about making masks in Flash, read this super old tech support article.. it hasn't changed].
More after the jump.
read more »
Posted in ActionScript 3.0, Flash CS3, animation, instances, masking, masks, symbols, workaround | 9 Comments »