Page 1 of 1

Buttons Creating a button that links to another Frame. Rate Topic: -----

#1 Glorfindal  Icon User is offline

  • Java Enthusiast
  • member icon

Reputation: 23
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Posted 28 July 2009 - 07:42 AM

Requirements
Flash 8 or later
basic understanding of drawing in Flash
--------------------------------------------

Now let's get started:

Start by opening Flash and creating
a new document. Name it A_Button.
Now you should see a white blank rectangle.
First we have to do the background. We start by changing
the Background color for all our frames by going down
to the bottom of the screen where it says Background
then you hit the dropdown and select a color to be the Background
for the all of the current and future frames. I'll pick blue.

NOTE: This choice can be changed at any time by just picking a different Color.

Next draw a rectangle bottom left with the inside color whatever you want to it to be (I'll pick
green) change the thickness to of the outline to 3. And keep the Outline color Black. The Rectangle
will be your play button.


Attached Image

Next add text into the rectangle the using the Text tool. Color can be whatever you want it to be (i'll use black)
but size should be 37. You should now see something like this:

Attached Image

Right now that is just a rectangle with words in it now we need to give
it the actual Properties of a button. We do this y selecting the Background
the outline and the text all togethor and then right clicking on it.
So click the outline Hold shift down, and while holding shift select the color inside
the rectangle and keep shift held down now select the text. You should now have:

Attached Image

Right Click it and click convert to symbol...

Attached Image

Where it says Symbol 1 wirte My_First_button
and make sure button selected. Then hit Okay.

Note: When you click your rectangle(Now button) it should look like this:

Attached Image

Now insert a blank Key frame and draw some random image in it like this:
Attached Image

Next select and right click on the the button you just made:
And click Actions, then copy and paste this code in there:

on(press){
_root.gotoAndStop(2);
}


I will now explain what this code means:

on(press)


This means if the bottom is pressed do this:
gotoAndStop(2);

Which should be self explanatory:

The
_root.

Means that that frame is in this scene.

Now test the code by Control in the top right. Then click Test Movie.
I hope you enjoyed this tutorial!

Is This A Good Question/Topic? 0
  • +

Replies To: Buttons

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1137
  • View blog
  • Posts: 7,099
  • Joined: 07-September 06

Posted 05 August 2009 - 11:42 PM

Pretty nice, simple tutorial.

One more important thing to state is that it is using Actionscript 2, not Actionscript 3.
Was This Post Helpful? 0
  • +
  • -

#3 Glorfindal  Icon User is offline

  • Java Enthusiast
  • member icon

Reputation: 23
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Posted 06 August 2009 - 08:36 AM

Good idea. But it won't let me edit it for some reason. Could you rename it Buttons (Actionscript 2)?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1