button functionality

Posted on 2006-04-12
Last Modified: 2010-04-03
how can make if i click in button1 make the functionality to button2
Question by:newnewmommon
    1 Comment
    LVL 34

    Accepted Solution


    I am replying on the following assumption
    - you have two buttons, button1 and button 2
    - button two does not have any function on any of its event in start,
    - you want that on button1 click, button2 event gets populated.

    in simple words, if user presses button two in start, it does not reaches,
    but if user first click button1 and then click button2 , in this case button2 give response.

    if I am correct, here is the solution.
    you have two buttons, button1 and button 2 on the first frame of new FLA, no action has been written anywhere till now

    now here we will write the code on frame not on buttons,
    click on the frame.

    press F9 to open action panel..

    enter the following code
    button1.onPress = function()
          trace("button1 pressed");
          _root.button2.onPress = function()
                trace("button2 pressed");

    press CTRL+ENTER to test it



    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now