AN.Controller.startSceneById no longer recognized in version 1.3
Hey, I am using this animator for half of my project and the other half I'm writing by hand. I need to tie into the controller to tell it which scene to go to directly from the page select screen I made. I had this working perfectly in in version 1.2 but last night I upgraded to 1.3 (build 171)and everything that used the AN.Controller broke and throws the error "Object has no method 'startSceneById'"
This confuses me as I've looked at the new controller object and it should still return that method correctly. Any help on how to get startSceneById() working correctly would be greatly appreciated
Yeah, there is a slight change. The AN.Controller is a "class" that is instantiated into separate objects that are the actual controller(s). To tie into your existing code you could for example try either of these approaches
1) Set the project property panel -> actions -> start action to store the controller in a global variable e.g.
"myController = controller;"
Then you can access the controller from the global "myController" object.
2) If you load your js before the animation js loaded, you could add a method for connection e.g
"yourFramework.setController(controller)" in the same project start action method.
Thanks for the speedy response. I just got a chance to read it and I'm sort of confused. I've gotten the controller in a global variable already. When I reference it by myController.startSceneById(''), I am told startSceneById('') isn't a method of the myController object. I have looked at the code and that method should still be valid as myController should be returning the whole AN.Controller.
I guess my question should of been, what is the new syntax for calling controller.startSceneById('').
If there are any other ways I can dictate which scene is started by an ID number, that'd be great also .
I was setting my global variable to controller but not getting an error that it didn't exist. I moved where I set my variable to the bottom of the setTimeout that sets the config data for the controller and that seemed to do it. Most likely I was setting it before controller loaded. Thanks a lot for your help!