I’m guessing that the name of your scene is wrong; I tested your code and it worked just fine for me when I specifically had a scene named “next”. When that scene didn’t exist, it would just show “now” twice.
Can you take a look to my console?
First time:
“scene = now”
click on < button (prec)
“CHANGE TO NEXT (button PREC)”
“scene = next”
all is ok
click on < button again (prec1)
“scene BEFORE showSceneNamed= now” it should be “next”. Why is “now” again?
“CHANGE TO NEXT (button PREC1)”
“scene AFTER showSceneNamed= now”
“scene = now”
I call my function only loading “now” scene. Is it wrong?
In your last scene you have an action on “prec2” on mouse click “jump to scene”, “now”. So your console is going to show the “now” scene name because you’re back in the “now” scene. Perhaps you want this to go to the “next” scene?
Also, in your “next” scene you have another Mouse Click action pointing to the “now” scene. If you remove this then your javascript will work as asked.
Remember, any changes made in the inspector will override any in the javascript. You should not use the same calls and actions in both environments anyway.
The issue is that you also have mouse click actions on those buttons that will change the scene. If you try to change scenes while in the middle of a scene transition, we'll ignore the other scene change. Thus it is still going to say "now" even if you try to change to the "next" scene.
If you want full programmatic control, then you'll want to first remove the mouse click actions that jump to the scene.
Lol. Yer, I have a 10.6.8 machine that I cannot upgrade yet. And need to be able to maintain a set of pages from it when I am using it… Hopefully i will be able to upgrade the mac in the near future.