Copy link to clipboard
Copied
Hi,
I have a WebGL animation and I'm trying to switch between scenes using buttons. I want to goto a scene and play from a certain frame.
I got as far as:
player.play('Scene 1');
Which plays the scene but:
player.play('Scene 1', 20);
won't play the scene from frame 20.
Does anyone know what I'm missing and how to achieve this??
Thanks
1 Correct answer
According to the Adobe Animate CC documentation for the WebGL API, it looks like player.play() only takes one argument (the scene to be played), and not the frame number in that scene.
Flash Professional Help | Player
That's still one up on the regular canvas 2d export, which does not support scenes at all.
If you define a variable in one scene.
this.frameDesired = 45;
...then go to scene...
player.play('Scene 2');
... in that scene's first frame ...
this.gotoAndPlay(this.frameDesired);
This worked for m
...Copy link to clipboard
Copied
According to the Adobe Animate CC documentation for the WebGL API, it looks like player.play() only takes one argument (the scene to be played), and not the frame number in that scene.
Flash Professional Help | Player
That's still one up on the regular canvas 2d export, which does not support scenes at all.
If you define a variable in one scene.
this.frameDesired = 45;
...then go to scene...
player.play('Scene 2');
... in that scene's first frame ...
this.gotoAndPlay(this.frameDesired);
This worked for me in testing.
Copy link to clipboard
Copied
Thanks!
Always seems to need a workaround...

