In this in-depth tutorial, you will learn how to make a typical 468 x 60 Flash banner ad, from start to finish, with every step thoroughly explained. You will learn how to:
- make an invisible button that acts as a link
- optimize your banner for previous versions of the Flash Player
- learn the basics about events and event handlers in Flash
- what kinds of requirements you can expect from your client
1 Open a new 468 x 60 banner ad template in Flash: choose File > New, then click on Templates tab and select Advertising, then 468×60 (Banner) and click OK. Now, the first thing we’ll do is make a button so that people interested in this banner can click on it, to take them to intended site.
2 Double-click on the layer named content (Flash automatically gives it this name) and type in button, then press ENTER.

Making an invisible button
3 Using the Rectangle Tool (R) draw a borderless rectangle on the stage, the dimensions and color are unimportant.

4 Open the Align panel by pressing CTRL+K or choosing Window > Align. Select the rectangle on the stage by clicking on it with the Selection Tool (V). Now, in the Align panel, turn on the “To stage” option (see “1″ in the image below). Now click the “Match width and height” button (see “2″ in the image below). This will make the dimensions of the rectangle same as the dimensions of the stage, i.e. the dimensions of our Flash banner ad. Next, click the “Align horizontal center” button (see “3″ in the image below). This will center our rectangle horizontally on stage. After that, align the rectangle vertically by clicking the “Align vertical center” button (see “4″ in the image below). That was easy and fun. The Align panel in Flash really helps cut down the work we’d otherwise have to do manually. We got our rectangle the same size as the stage, and exactly overlapping the stage. So when users click, they can’t miss it at all. Let’s make a button symbol of it now.

5 With the rectangle still selected, press F8 or choose Modify > Convert to Symbol. This will bring up the Convert to Symbol dialog. As Type, choose Button. Name it ad button or whatever you like. Click OK. Our newly created button can be found in the library (CTRL+L or F11). So that users can click the button, it needs to be on top of every other content in our banner. Also, because of this, it needs to be invisible, so that the content is visible beneath it. Let’s do it.
6 Double-click on the button on stage. We are now inside the button symbol. You can see that it has its own special timeline consisting of four frames: Up, Over, Down and Hit. These for frames correspond to the four button states:
- the Up state is when the button just stands there, without any interaction on user’s part (no hovering with mouse over it and clicking),
- the Over state is what happens when the user places his mouse over the button,
- the Down happens when the users clicks the button and
- the Hit state defines the clickable area of the button. (it can be greater or smaller than the visible area pof the button).
7 To have an invisible button, all we have to do is drag the Up state keyframe to the Hit state and leave it there. That’s it! If you have problems doing that – if you are clicking but just selecting as you drag your mouse, you need to do the following: click the Up keyframe and let go the mouse, don’t drag at this time. Now click on it again and drag the keyframe to the Hit state. We’ve got an invisible button now.

Click on the “Scene 1″ link just above the timeline or double-click anywhere outside the button to return to the stage. You will notice that our button is colored in cyan now. That is how Flash marks the invisible buttons on the stage. If you press CTRL+ENTER or Control > Test Movie now, you will see an empty movie. But if you roll your mouse over the the button (invisible), you will notice that the cursor will change from arrow to hand. Now we need to myake our button clickable – put a link on it.
By the way, if you haven’t saved your document yet, do it now. Acquire this habit, so that you save yourself a lot of work and nerves if the power goes out or your system crashes.
8 If your button isn’t selected, select it now. To make sure, check the Properties panel below the stage – it should show the button icon in its upper left corner and “Button” should be written next to it. Now, click F9 or click Window > Actions. The Actions panel will open up.
Make sure there is “Actions – button” written in the top left corner of the Actions panel. If not, it means you didn’t select the button and your ActionScript will finish on the main timeline, instead on the button! And that will cause problems – the banner won’t function. Once everything is in place, let’s begin writing ActionScript lines.
Optimizing your flash movie for previous versions of Flash Player
But! But, but, but. There is always a but. One very important thing: the banners you’ll make for your clients will have to reach a wide audience. So you’ll have to adjust your Flash banners for lower versions of the Flash player. You CANNOT go on by just supposing “well, probably everyone by now has the newest Flash player 8 installed. It is so cool and powerful, so why would anyone have an older version?”. That kind of thinking is WRONG, yes, because users DO NOT think like us, web-savvy people (web designers, developers, programmers, etc). Installing a new version of Flash player is not as easy for the average user. Why? The main reason is laziness. People who surf the web are lazy (lazy during surfing, that is). If there isn’t a big interest or value in a site, AND the sites requires the installation of a plug-in, lots of people will close that page and go surf elsewhere.
There a lot of sites on the Internet similar to yours or your client’s. Keep your user base AND expand it by being nice to them. That means BE USER FRIENDLY. This is true, whether your site is a Flash one or HTML one.
The second reason is that the client or the site your client puts hers/his Flash banner on, will REQUIRE of you to make the ad in an older format. There are almost no exceptions to that rule. You will have to comply to their request, otherwise, they will certainly return that Flash banner ad you made if they discover you haven’t followed their guidelines. OK, we sorted that out. But how to make this? Easy.
9 Go to File > Publish Settings or press CTRL+SHIFT+F12 and the Publish Settings dialog will appear. Select the Flash tab and in the Version drop-down menu, choose Flash Player 6 (or whichever is required by the site your Flash banner will be on, it was Flash Player 5 for me for a loooong time, believe it or not). In the ActionScript version drop-down menu choose ActionScript 1.0. That’s it. Press OK and go back to the Actions panel.
It doesn’t matter if you save your document in the Flash 8, Flash MX 2004 or Flash MX format (depending on whichever version you have installed on your computer). The final SWF file will be published for the Flash Player version you specified in the Publish Settings dialog.
Creating a hyperlink with ActionScript
With the Properties panel still showing that the button is selected, click inside the Actions panel – inside the area the code is written in. Type the following code:
on (release) {
getURL("http://www.flashexplained.com/", "_blank");
}
You will notice that as soon as you type the first word, followed by a parenthesis:
on (
Flash will pop-up a menu. This menu shows you the various events to which the button can react.

Choose release. Now, I shall explain what do the different parts of this code mean. The first line,
on (release) {
contains the keyword on, followed by the release event. This is followed by a curly brace { .
An EVENT is something that happens in a Flash movie, be it a mouse click, the mouse moving, the timeline reaching a certain frame, a sound starting, a key being pressed or released. The code on our button is called an EVENT HANDLER. It means that it handles what will happen next after an event is invoked (in this case, when our button is clicked with a mouse). It literally says (translated from code to human language): when the user clicks and releases the mouse button, execute the code which is written between the curly braces. Nearly every program has events and event handlers. What do you think happens when you double-click an icon in Windows or Mac OSX, or move your mouse in a game, or click on a menu in Word, Dreamweaver, Flash? Some event handler executes some code. It opens a menu, starts a program etc. Therefore, events are like “triggers” which start a reaction, if there is one defined in the code.
Pay attention to the event you choose. The description of mouse events follows:
- the release event means that the code between the curly braces {} will be executed when the user has clicked AND released the left mouse button. That is a “normal”, “standard” click. Few users click the mouse and hold on to it, unless they are dragging something,
- if you chose the press event, it means the code will be executed the instant the user clicks the mouse button, before he released it. This may shock some users, because they are used to “normal”, that is, “release” clicking. The press event is excellent for Flash games, when something needs to happen immediately – like a spaceship firing a round, or a character jumping, etc,
- the releaseOutside event happens when the user presses (clicks) the mouse over the button, drags it outside the button area, and releases it,
- the rollOver event happens when the mouse is rolled over the button (can’t be simpler
,
- the rollOut event happens when the mouse is moved over the button and withdrawn from the button area,
- the dragOver event happens when the user clicks the mouse when over the button, drags it outside the button area and returns back over the button,
- the dragOut event happens when the user clicks the mouse over the button, and drags the cursor outside it.
The second line of our ActionScript code,
getURL("http://www.flashexplained.com", "_blank");
contains the getURL command, which makes adding hyperlinks possible. The chunks of code between parenthesis are called parameters. They have to be written between quotation marks and be separated by a comma. The first one is the URL (Uniform Resource Locator, if you’ve always wandered what the acronym means), or the place on the web your banner is pointing to (it can be an e-mail address, also). I have put in my tutorials main page URL, you can put whatever you want. The second one tells where the link will open: in our case, _blank indicates that it will open in a new browser window. The other options serve if you have frames on your pages (personally, I NEVER use frames), they are _self if you want the link to open in the same frame your Flash banner is, _parent for opening in the parent frame and _top opens over all frames, and the frameset disappears. There is a third parameter that can be used, for sending data, but that is beyond the scope of this tutorial.
Press CTRL+ENTER to test your movie. Click on the button, it should take you to the URL you specified.
Before continuing, save your movie, and lock the “button” layer so that you can work more at ease, when we add new layers. Click on the dot beneath the image of the lock to lock it (see image below).

Creating content
Now, we need to put some content in. For the purpose of this tutorial, we’ll make something generic. If you want to know how to create some more sophisticated Flash banners, go to the Flash banners main page and you’ll find lots of tutorials to choose from and learn. Before proceeding to the next step, save your Flash document.
10 Create a new layer. Do this by choosing Insert > Timeline > Layer or clicking the Insert Layer icon left of the timeline (see image below).

Double-click on the layer name and call it “image”. Click and drag it below the “button” layer. Remember, the layer with the button must be on top of every other layer if you want your ad banner to be clickable.
Now, we need an image. The important thing to remember is to optimize your image in Photoshop before importing it to Flash. Why? Because the site your client or you will be putting the banner on, CERTAINLY has a limit on the filesize of banners. Usually, this is a maximum of 15 KB for 468 x 60 banners. So make sure you optimize you image. And, if you are using a JPEG image, DO NOT make it a progressive type of JPEG. Because Flash cannot handle these types of JPEGs. Make it an ordinary JPEG. If you don’t have an image at hand, take this one below.

11 Import the image to your Flash document by pressing CTRL+R or choosing File > Import > Import to Stage. The Import dialog will appear. Find your image and click OK. The image will appear on the stage and will automatically be stored in the library. Now, you can’t design properly because of the button layer. Hide the button layer by clicking on the dot below the eye (see image below).

12 Select the image, center it on the stage by clicking the “Align horizontal center” button and “Align vertical center” button in the Align panel.
13 With the image still selected take a look at the Properties panel. Look at the horizontal (X) and vertical (Y) coordinates of your image (see image below).

Notice that in my case, the X coordinate is not a round value. If you want your image to look sharp, you should always have round values. So click in the X field and type 71. How to round the value? I follow this guideline: if it’s below 0.5, i round it to the lesser value, and if it’s above or equal to 0.5 to the greater value. Use these same guidelines for your text in Flash. Now, this may not be apparent in our case, but if you imported a GIF image with, say, a 1-pixel line or something alike in it, you’d see the difference immediately.
14 Lock the layer “image” and make a new layer. Call this new layer background and position it at the bottom of all layers.
15 Draw a black borderless rectangle on this new layer and make it the same size and position as our stage, by following the technique outlined in step no.4 of this tutorial. Lock the layer. Now we have a black background.
After this, you can add any animation you like. I’ve put another layer with animation in it, you can see it below. If you’re not sure how to make this, check the Animation tutorials main page.
One last thing: you will have to make an animated GIF or just plain JPEG replacement for your Flash banner ad. Why is that? Because some people don’t have Flash player installed at all. And the site the banner will be displayed on will certainly require of you to make a GIF or JPEG and send it to them along with the Flash banner, and sometimes even the source FLA file. Now, using the file manager on your computer, go to the folder where you saved your FLA file and look at the SWF. Look at its filesize and make sure that it doesn’t surpass the requirements set out by your client.
That’s it! I hope you enjoyed this tutorial as much as I enjoyed writing it. Below, you can download the zipped source FLA file for this tutorial.
Download the zipped source FLA file.
Nicely done! Helped me a ton. Thanks!
Good job!!!!!!
Thanks dudes!
that”s what i needed
karolis: Enjoy and spread the word.
Thanks for this – straighforward to follow, cheers, Jamessy
Excellent tutorial. I made my first banner. One suggestion for an add on to this. How do you make multiple ads that scroll based on time. For example, http://www.cnet.com
Thanks.
good
Web Design Glasgow: thanks.
Philip: Good idea. I should make a tutorial on that.
Florian: Stick around and learn some more!
IWay it doesn’t work
the link does’t open
same with the download file
????????????
EUREKA – THANK YOU!
I am a multimedia designer and have been doing this for over 20 years. In my current job I am expected to do it all – video, print, websites and now flash – I can honestly say the interactivity part of flash has dumbfounded me for so long even though I am expected to do flash animation all the time for sites. THANK YOU for such a clear and easy to understand tutorial. You would not believe how many times I have searched for the answer to making a flash banner interactive and come up frustrated and more confused because I could not get my head around the coding nightmare I was expected to navigate – hate code!
Your Tutorial helped me a lot, I been having a problem getting my buttons to work with the on release code, but I was making the button invisible then copying and pasting it in the up and hit area- which was wrong, well I got it to work now, Thanks
Helped me a lot. Thanks!
That was an excellent tutorial, I’ve made my first ever banner ad.
Question is how do i add it to the signature in my emails and when i post on forums, If you could tell me how this is done i would be most grateful, cause i’m not to good with these computers
Nick
You could check this site Nick: http://www.w3schools.com/flash/flash_inhtml.asp
lp
PSS: thanks for this tutorial, it rulls
Thank you, thank you, thank you
. I’ve made my first banner with link inside.
THANKS! It was so helpful!
ok so for some reason after i create the button and drag the Up frame to the Hit frame and test movie, my mouse doesn’t turn into a hand, and also when i got to the action panel while the button is selected (teal border), the panel title is not actions – button, it is merely actions and the script box states ‘current selection cannot have actions applied to it.’ im using cs4, does this make a difference in how i should go about creating the button? cheers
Whoof — what a great tutorial! I was trying to make an animation that would pause/play at mouseover/mouseout, and your tutorial got me most of the way there! I just added a slightly different ActionScript code, and I’m a happy camper. Thanks so much!
Thaks a lot for a great tutorial! Saved me a few hours of my precious time! =)
¡Super!
Thanks for the great tutorial, by far the simplest and easiest to follow. I have never used Flash previously, let alone created a banner in it. Now in just one day thanks to this and few other tutorials on this site, I am Masking and Tweening all over the show. Anyway thanks again keep up the good work!
—- For all the FLASH CS4 USERS —–
In the first part of this tutorial where you are instructed to select ‘Advertising’ templates then select the stage size DON’T. Instead create a new ‘Flash File (Action Script 2.0)’ from the general tab then resize the stage to suit the banner size you want. After that the button will work properly.
Awesome Tutorial, Thanks!
thanks!your tutorials are crytal clear it really helps a lot for beginners like me.
This has been very helpful. thank you. Very Good.
thnx great tutorial !!!
my outcome: http://www.imagehuge.com/out.php/i1201_lolz.swf
I lost you at #8. How do you select the “button”? I thought I selected the button, but when I click F9, the top left corner displays Actions-Frame instead of Actions-Button. Please, point out of my stubbornness. Thanks in advance!
Phong.
Hello,
Thanks for you detailed tutorial !
I’m using Flash CS4 and at #8 i’ve an issue.
In fact, i select the button on stage. So, i have the button with cross in top left corner and Properties tab show Button (with good icon logo). But Actions tab can be used “No action can be apply to the slection”. Do you know why ?
Thanks.
superb totorial, got it the first time. thanks so much!
Julien, and all CS4 users. Don’t use the templates. Start rather from the regular New file, and adjust one to your needs, otherwise you get “No action can be apply to the slection”. Everything just work fine. Thanks to Author
Have done quite a few banner ads but it is good to go back to basics. Have often found images don’t look sharp so your point about images being whole number sizes was helpful.
this is probably the best flash tutorial I have ever read. It explains actionscript in a way that I finally now get.
thank you
this was EXCELLENT – thank you!!!
what program are you using?
hi is there a way i can reduce an swf banner from 682 kb to 15kb or less?
Thanks for the great tutorial mate!
I will use this tuturial to help me with my next project!
Thank you very much for nice tutorial, it helped me to create a good banner for my site.
awesome! Thank you so much for this tutorial, so clear and very helpful!!
this tutorial does not work with Flash CS4. I followed all instructions, including the part about not using a template if in CS4. It will not allow me to apply action script to the button. I really got my hopes up when I saw this and all of the great feedback. Maybe an update is in order?
i found an alternative action script that actually works with action script 3 in CS4. graet tut though thanks
The clearest tutorial I have followed for a long time. Really helpful, really clear, right tone (ie not patronising), appropriately and clearly illustrated… and there’s more help too… can’t wait to do the next one. suddenly Flash seems very easy. Thank you.
PS: I have been following this tutorial in CS4 with no problems
Thanks for posting this. After learning Director, Flash doesn’t seem intuitive at all. The process of simply making the whole stage a button to go to a specific URL wasn’t easy for me to figure out. This post helped a ton!
Hi! And thanks to the author for putting up the tutorial…
I am however having the same problems as other CS4′ers… I can get the cursor to turn into a hand (so it recognizing that I’ve made a button), but I absolutely cannot apply action script to the button. I’ve tried AS1.0, 2.0, and 3.0. Can anyone give any real advice to those of us using CS4?
I’ve read in other tutorials that you have to name the instance. I tried that too, and referenced the instance in the action script, but still nothing.
Any help would be greatly appreciated!!!
Thanks
Another CS4 user with the exact same problem, I can’t add any actionscript to the button. I get “current selection cannot have actions applied to it”. I’ve gone over this tutorial 4 times to make sure I’m doing everything correct and I am, so there is definitely an issue using CS4. Can someone PLEASE shed some light on this….much appreciated.
I also tried opening a new document and I didn’t use the Templates like the author suggested. This still doesn’t fix the issue, I still can’t apply actionscript.
I finally figured it out. My bad I was not opening the new file using actionscript 2.
@ Snerp: I WILL make a tutorial on creating a Flash ad banner in Flash CS3/CS4 from start to finish. It’s time to upgrade the existing knowledge!
For those CS4 users having problems, make sure that your publish setting have the Actionscript set to 2.0 and NOT 3. The whole event handling system has been revamped in Actionscript 3.0 meaning that on(event) on buttons don’t work.
Thanks Bro.
I tried the Tutorial in CS4 and consistent with other users, it does not work. I will try your advice and change the Actionscript set to 2.0.
Flash Actionscript is already confusing, for CHRIST SAKE, why do they have to revamped Action 3.0, and not support the previous EVENT Handling system.
GET IT TOGETHER, IF YOU’RE GOING TO ADD A NEWER VERSION, PLS. ADOPT THE OLD ACTIONSCRIPTS…..
Fantastic tutorial! Very easy to follow and covered everything needed to make a successful banner!
Thank you very much!
Thank you so much it helps me a lot
great tutorial but i have a problem, how can i upload it to my website? thanks in advance for any help
Excellent – thank you. Very clear instructions, worked first time without any hitches, assumptions or confusion – and that takes effort and attention to detail from you which is most appreciated.
I now have a means of creating a linked animated flash by adding the transparent clickable button as described above.
Thank you a lot!
Tutorial was easy to understand and effective.
so nobody is capable to tell me how can i upload it to my website?
Awesome tutorial, only one thing though, when I publish as animated gif it will not publish the link….i can publish in any other format and the link works. Please advise……troubled
Had the same problem as others making the button a working link (and this is using Macromedia Flash MX, 2002 version).
I think if you add the ActionScript hyperlink to the button BEFORE Step 7 (making it invisible), then it works, otherwise you get the “current selection cannot have actions applied to it” error.
Worked for me. Cheers!
Awesome tutorial, thank you very much!