Results 1 to 2 of 2
  1.    #1  
    How do you you dynamically disable a button?
    I need to have the button start out enabled but at some point in the program I need it to become disabled.
    hit up that thanks button
  2. #2  
    Quote Originally Posted by tjmarkham3 View Post
    How do you you dynamically disable a button?
    I need to have the button start out enabled but at some point in the program I need it to become disabled.
    cookie in stage-assistant:

    Code:
    this.saveCookie = new Mojo.Model.Cookie("saveState");
    this.controller.saveState = this.saveCookie.get() || null;
    button setup in menu-assistant:

    Code:
    this.controller.setupWidget("continueGame"),{},this.continueButtonModel={
         buttonLabel: "Continue Game",
         disabled: true
    });
    activate in menu-assistant:

    Code:
    this.continueButtonModel.disabled = this.controller.stageController.saveState == null;
    this.controller.modelChanged(this.continueButtonModel,this);
    setup in game-assistant:

    Code:
    this.controller.stageController.saveState = 1;
    setup in lose-assistant:

    Code:
    this.controller.stageController.saveState = null;
    hopefully you can follow that. if not, let me know and i'll explain. just note the 'disabled: true' part... you just need to toggle that between true and false to do what you need.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix

Posting Permissions