School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,430 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,492 people online right now. Registration is fast and FREE... Join Now!




Button navigation between frames

 
Reply to this topicStart new topic

> Button navigation between frames, Very Simple

icedd
Group Icon



post 5 Mar, 2008 - 10:00 PM
Post #1


Learn how to change frames using buttons, with two alomst identical, but differnt ways.

Flash 8 Pro, AS 1.0 or 2.0
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
Step 1:
Open Flash. Open a new Flash Document. On the stage of Frame 1, of your timeline draw 2 shapes. A circle and a square.

Step 2:
Highlight the circle and convert it to a button.
To do so:
A) Select the circle, right click on it > Convert to Symbol, name
it "circle_btn" and make sure you select "Button".
or
cool.gif Select the circle, Modify > Convert to Symbol, name
it "circle_btn" and make sure you select "Button".

Repeat this step for the square naming it "square_btn"

Step 3:
Click on Frame 2 of your timeline and press "F7" to insert a Blank Keyframe, or click Insert > Timeline > Blank Keyframe. Then, on the stage of Frame 2, draw a circle.

Step 4:
Click on Frame 3 of your timeline and press "F7" to insert a Blank Keyframe, or click Insert > Timeline > Blank Keyframe. Then, on the stage of Frame 3, draw a square.

Step 5:
Now go to Frame 1, and we'll add the simple code so that when you click on the circle, it will bring us to frame 2.
Tip: Make sure that you are entering the code onto the "circle_btn" and not the frame. To do so: Click on a blank spot on the stage, then select your circle. Now open the "Actions" panel and type

CODE
on(release){
      gotoAndStop(2);
      }


Step 6:
Click on frame 3 and in the properties tab where it says "<Frame Label>" type "squarepage". Then go to frame 1 and put this code in the actions panel of your square button

CODE
on(release){
    gotoAndStop("squarepage");
}



YOUR DONE
That should do it, Press "Ctrl + Enter" to test it.

Also: I know it could have been explained much shorter, I just like to be thorough.

ICEDD
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/8/09 12:33AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month