Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

creator2456

macrumors 68000
Original poster
Jul 10, 2007
1,649
2
Chicago
If Mods want to move this to Web Design & Development, go right ahead. May be out of place here, but that is what I get for posting while going on 24 hours awake.

Not sure if this will make since just seeing code, but I am stumped.

Right now Button B is hittable even if Button A has not been hit.
I want Button B to ONLY be hittable AFTER Button A is pressed. Button B will then act like Button A for another dynamic Text Box.

Essentially I want Button A (frame 10) to reveal Button B (frame 20) to reveal Text C (frame 30).


This code is on Button A
on (release) {
door = "this is a clue"
doorvar = door
}

It reveals text in dynamic TextBox A with Var = doorvar

TextBox A is the Up/Over/Down state of Button B.

Code on Button B
on (release) {
door2 = "this is a clue"
doorvar2 = door2
}
 
This should do it:

Code:
// On setup..
buttonB.enabled = false; // This prevents clicks, and over-states

// Button A code:
buttonA.onPress = function()
{
    buttonB.enabled = true;
    // Anything else you want to do here...
}

Things to note:
- That merely sets buttonB to disabled; you might want to hide the button as well (by setting the "_visible" property); or change its appearance to some kind of de-activated state; depending on your needs.

- If the buttonB.enabled = false line is loose in frame one of that clip (as opposed to being inside a function), it may execute again, disabling the buttonB, if you gotoAndStop back to that frame. Just something to be aware of!
 
This should do it:

Code:
// On setup..
buttonB.enabled = false; // This prevents clicks, and over-states

// Button A code:
buttonA.onPress = function()
{
    buttonB.enabled = true;
    // Anything else you want to do here...
}

Things to note:
- That merely sets buttonB to disabled; you might want to hide the button as well (by setting the "_visible" property); or change its appearance to some kind of de-activated state; depending on your needs.

- If the buttonB.enabled = false line is loose in frame one of that clip (as opposed to being inside a function), it may execute again, disabling the buttonB, if you gotoAndStop back to that frame. Just something to be aware of!

Thanks. Got it working in simple terms, but still not quite how I want it. At least I have a starting point to go from now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.