A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: button

  1. #1
    Member
    Join Date
    Sep 2002
    Posts
    50

    button

    HI all Iam khader agin in this time i have anther subject and i hope to help me in it , i am trying to make button active and not active exactlly i want to press on the button then i want to be inactive and if i press on onther button the first one return active
    i just need to know hoe to do that using action script
    abseco

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    I think you could do this by setting 2 variables in your main timeline like this

    buttonOneActive = true;
    buttonTwoActive = false;

    on the actions for button 1 use

    on (press) {
    if (_root.buttonOneActive) {
    // do any actions you want button 1 to do and then make button 2 the active button
    _root.buttonOneActive = false;
    _root.buttonTwoActive = true;
    }
    }

    then on button 2 use

    on (press) {
    if (_root.buttonTwoActive) {
    // do any actions you want button 2 to do and then make button 1 the active button
    _root.buttonOneActive = true;
    _root.buttonTwoActive = false;
    }
    }

  3. #3
    Member
    Join Date
    Sep 2002
    Posts
    50

    button

    thanx and i want to continou help me
    relly it's good ,but ineed put button1 over button2 and i need to press on button 1 then disappear and press on button2 (which is below button 2 ) and so
    ok
    abseco

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    How about this,

    create movie clip, in frame 1 of this clip add a stop(); acrion and put your button 1 on button 1 attach the actions

    on (press) {
    // do whatever you want button 1 to do
    nextFrame();
    }

    in frame 2 of the clip put button 2 and on button 2 use

    on (press) {
    // do whatever you want button 2 to do
    prevFrame();
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center