Results 1 to 18 of 18
  1.    #1  
    I tried the following code but got an error:
    Object function anonymous() { { this.initialize.apply(this, arguments);} } has no method 'setWindowProperties'

    Code:
    var props = {blockScreenTimeout: true};
    Mojo.Controller.StageController.setWindowProperties(props);
    I know I'm doing something completely stupid but I can't figure it out. Help?
  2. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #2  
    your variable appears to be set up wrong.

    try...

    Code:
    var props = "blockScreenTimeout: true";
    Mojo.Controller.StageController.setWindowProperties({props})
    Then again, the error suggests that there is an incompatiblity or mismatched versions.
  3. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #3  
    Then again, the documentation makes no mention of any squiggly brackets...

    Code:
    Mojo.Controller.StageController.setWindowProperties(props) 
    Change properties of the window.
    
    Parameters:
    {Object} props 
    A map representing the properties to change. Keys are the property names, and values are the new values. 
    
    Possible values include: 
    
    blockScreenTimeout Boolean. If true, the screen will not dim or turn off in the absence of user activity. If false, the timeout behavior will be reinstated. 
    
    setSubtleLightbar Boolean. If true, the light bar will be made somewhat dimmer than normal. If false, it will return to normal.
  4. #4  
    Did anyone get this working?
  5. #5  
    Maybe try Mojo.Controller.stageController (lower case s)?
  6. #6  
    Tried a lowercase S. No go.
  7. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #7  
    Well the reference says that the setWindowProperties method has properties are supposed to be an object.

    So instead of instantiating a variable per se, instantiate an object, like this ....

    Code:
    this.blkScrTime = {property: true};
    Mojo.Controller.stageController.setWindowsProperties(this.blkscrTime)
  8. #8  
    Tried that already. It errors out and stops the rest of my .setup code from running.
  9. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #9  
    did yo also try,

    this.blkScrTime.property

    as the variable to pass to setWindowProperty?

    ...

    also just try passing the word 'true' ...

    if that works then it means your variable setup is at fault.

    if it doesn't thenyou know to look somewhere else.
  10. #10  
    Yes, no go. Still hangs.
  11. #11  
    Nevermind, for some reason it is only hanging in my one scene. It worked fine in another.

    Thanks
  12. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #12  
    yea, I had nothing else. The only other thing I could think of was to check syntax. I had one of my scenes hang cuz I left out an extra '=' out of a conditional if-then statement.

    I busted my head against the keyboard for hours trying to figure that out.
  13.    #13  
    So can anybody post the actual code that works? Help!
  14. #14  
    Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: true, setSubtleLightbar: false});

    Good luck. I cannot get consistant results out of it. Sometimes the screen will get stuck on (even the homescreen when my app isnt running) and the only way to get it to go off is to restart the device.
  15.    #15  
    Quote Originally Posted by X7JAY7X View Post
    Good luck. I cannot get consistant results out of it. Sometimes the screen will get stuck on (even the homescreen when my app isnt running) and the only way to get it to go off is to restart the device.
    ***?! Really. I guess I'm not going to use this after all. Thanks for posting.
  16. #16  
    I would assume you would need to disable that property in your cleanup function so the OS knows that you're done needing the screen to be on. How to disable it? Beats the heck outta me.
  17. #17  
    Quote Originally Posted by SirataXero View Post
    I would assume you would need to disable that property in your cleanup function so the OS knows that you're done needing the screen to be on. How to disable it? Beats the heck outta me.
    i use this in my activate():
    Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: true, setSubtleLightbar: false});

    and this in my deactivate()/cleanup():
    Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: false, setSubtleLightbar: true});

    Seems to be working for me. I run them at the top of a try{} block in each instance.
  18. #18  
    Quote Originally Posted by MrJspeed View Post
    i use this in my activate():
    Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: true, setSubtleLightbar: false});

    and this in my deactivate()/cleanup():
    Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: false, setSubtleLightbar: true});

    Seems to be working for me. I run them at the top of a try{} block in each instance.
    Could you provide the full code with the try block? I still recieve no results when running this code:

    Code:
    activate: function() {
        Mojo.Controller.stageController.setWindowProperties({blockScreenTimeout: true, setSubtleLightbar: false});
    }
    Update: Since 1.4 you need to put this line somewhere else but activate() or setup() then it works as it should.
    Last edited by JuJulian1987; 03/11/2010 at 02:18 PM.

Posting Permissions