Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    qbzz is on a distinguished road

      0  

    Default executing javascript upon switching scene?

    executing javascript upon switching scene?


    I would expect to have the code in the "end" action of my scene to be executed when I switch scenes. However, this does not seem to be the case. So, assuming that this is actually possible, I must be doing something wrong

    My case is something like this:

    - my scene starts and I start some setIntervals and some listeners. I entered this code in the actions panel of my scene in the "Start" section.
    - I switch scenes and now I want to make sure my intervals are cleared and my listeners removed. I entered this code in the actions panel of my scene in the "End" section.

    Is there anything obvious that I must do differently?

    //Edit - to be clear: I want to be able to exit my scene before the animations have ended.

  2. #2
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    10
    arnebech will become famous soon enough

      0  

    Default


    We are planning to make that easier.

    For now, the scene end action will only be called when a scene have actually fully finished. What I'd do in the meantime is to set up a "destroy" function that can be called from anything that switches the scene.

    E.g. in the start action of the scene, you can create something like this
    Code:
    this.destroyScene1 = function() {
        //remove timers
        //do other cleanup
    }
    then from whoever is switching the scene, e.g. an objects click action I'd call something like this
    Code:
    this.destroyScene1();
    controller.goToNextScene();
    also in the end action you could also call the "this.destroyScene1()" function if needed.
    The "this" object should stay the same in all actions.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
    qbzz is on a distinguished road

      0  

    Default


    Thanks for the reply, the message is clear. Unfortunately, it is not a viable option out-of-the-box for me, because I need to work with a Sencha Animator template that is specifically designed by a third party and is used for mobile ads. This template manages scenes based on device orientation, so scenes can switch without me explicitly knowing it.

    I'll take it up with them to see if they can add some events that let me know what's going on.

    Nevertheless, it seems like an important feature to have in the gui. I would see 4 types of actions, maybe. An init action, that is called right before showing the new scene, the start and end actions as they are now and an important exit action, that is called whenever the scene is closed.
    Can you indicate if this is added in the next version of Animator (as you said you're planning on making that easier)?

    //Edit:
    I may have found a good working solution for now. Every start action of every scene I start like so:
    Code:
    if ( this.destroyScene ) this.destroyScene();
    this.destroyScene = null; //or, some function with magic stuff going on
    Last edited by qbzz; 9 Jul 2012 at 1:56 AM. Reason: solution

Thread Participants: 1

Tags for this Thread