Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 573717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:45:13+00:00 2026-05-13T13:45:13+00:00

Im new to this flash and I am using as2 for the action script

  • 0

Im new to this flash and I am using as2 for the action script I wanted to know if there are any good tutorials on how to create a toggle button so far this is all I have.

on (release) {
play ();
}

on (release) {
stop ();
}

I wanted so that when you hit playit would start the animation but showing the pause button and vice versa.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:45:14+00:00Added an answer on May 13, 2026 at 1:45 pm

    You need to keep track of the state of your toggle: ie whether the animation is playing or not when the button is pressed.

    So the code on your button might be:

    on (release){
    _root.toggleMe();//assuming you want to start/stop the main timeline
    }
    

    And then in the main timeline, you could define the toggleMe() function like this:

    var isPlaying:Boolean = false; // track state of animation - paused to start
    
    function toggleMe():Void {
        if (isPlaying) {
            stop();
            isPlaying = false;
        } else {
            play();
            isPlaying = true;
        }
    }
    
    stop();
    

    [EDIT: changed the code to control the main timeline]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to communicate between a flex 4.1 application to a flash action script
I have an AS2 Flash SWF that is calling another AS2 Flash File using
I'm using MovieClipLoader to load an external as2 swf file into my as2 flash
The ide i am using is flash cs3. the as2 swf contains a tween
I'm trying to pull data into flash using JSON but i keep getting this
I'm using Flash CS5's new Text Layout Framework (TLF) for the first time. Whenever
I'm using Flash Professional cs5/AS3 I'll try and describe this the best I can.
I created an flv video player using Flash Builder 4. This BasicVideoPlayer project is
I'm new to this SCM, but since SVN is gaining popularity I was going
I am new to this. I want to design an image gallery in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.