Results 1 to 13 of 13
  1.    #1  
    Does anyone know how to get the name of the active scene?

    I've tried:

    var currentScene = this.controller.activeScene();

    but

    currentScene.name

    ...returns undefined.

    I'm guessing this is completely wrong, so would appreciate any help!

    Thanks

    TheBounder.
  2. #2  
    I haven't used the activeScene method yet; however, since it's a part of the stage controller, you would call it like this:

    this.controller.stageController.activeScene()
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  3.    #3  
    Hi Dan

    var currentScene = this.controller.activeScene() works fine as it's called from within the stage assistant and returns the object correctly.

    That's not what I'm asking.

    I want to know what, or even if there is one, is the method used to get the active scene name.
  4. #4  
    Sorry I assumed you were trying to call it from the scene assistant which would have also resulted in an "undefined" result.

    Unfortunately I don't know the answer to your question. A dirty way to solve your problem (if there isn't a built-in function to retrieve the name) would be to create your own function within all your scene assistants that returned the name of the scene.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  5.    #5  
    How would that tell the stage assistant what the name of the current top scene was?
  6. #6  
    I assume activeScene returns the controller for the active scene. I believe you can call a function within a scene's assistant by doing this:

    Code:
    var activeSceneController = this.controller.activeScene();
    activeSceneController.assistant.getSceneName();  // Where getSceneName is the function you set up to return the hard-coded name of the scene.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  7.    #7  
    Is that the correct syntax?

    activeSceneController.assistant.getSceneName();
  8. #8  
    Quote Originally Posted by thebounder View Post
    Is that the correct syntax?

    activeSceneController.assistant.getSceneName();
    I think it is, but I wouldn't bet my life on it or anything. Try it out and see if it works.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  9.    #9  
    lol. It doesn't.

    Thanks anyway.

    Actually, instead of me groping around for a solution to this; how about a different approach?

    What I'm trying to do is; depending from which scene it was called, have the AppMenu do different things.
    ...
    Or...

    Once I have changed some preferences I want the calling scene to reflect those new settings; so is there a way of reinitialising the current scene?
  10. #10  
    Quote Originally Posted by thebounder View Post
    lol. It doesn't.

    Thanks anyway.
    I'm fairly sure there is a way to access the assistant object from the controller. Maybe someone else can chime in on the correct syntax.

    Quote Originally Posted by thebounder View Post
    What I'm trying to do is; depending from which scene it was called, have the AppMenu do different things.
    You could always set up the app menu in each scene instead of doing it in the stage assistant.

    Quote Originally Posted by thebounder View Post
    Once I have changed some preferences I want the calling scene to reflect those new settings; so is there a way of reinitialising the current scene?
    Sorry, I'm not following you on this one. Can you reiterate this?
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  11.    #11  
    Scratch that; I've sussed it out.

    Thanks for your help mate.

    TheBounder.
  12. #12  
    Quote Originally Posted by thebounder View Post
    Scratch that; I've sussed it out.

    Thanks for your help mate.

    TheBounder.
    You might want to post your solution just in case someone else was reading you thread and had a similar issue.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  13. PreGame's Avatar
    Posts
    540 Posts
    Global Posts
    550 Global Posts
    #13  
    I use

    Mojo.Controller.stageController.activeScene().sceneName

    which works for me.
    MyFlashlight - The Original Palm Pre Flashlight Application
    fileCoaster - The Original On Pre Application Installer

    Donations are greatly appreciated and can be donated HERE!. Again thank you ALL for your continued support!

    Follow us on Twitter @vertigoapps

Posting Permissions