Copy link to clipboard
Copied
I'm using HTML5 Canvas.
This is frame 1 of the main timeline and there is one movieclip.
this.myMovieclip.gotoAndStop(24);
this.gotoAndStop(2);
/*
Do some stuff here
...
*/
this.gotoAndStop(1);
Now that I am back at frame 1 of the main timeline the movieclip is no longer at frame 24 and it starts playing from 0. I'm pretty sure that this didn't happen in as3...
Thanks for helping.
Why don't you just put this.gotoAndStop(24); in the first frame of myMovieclip itself?
Well anyway, there's a fair bit of discussion in this thread on the subject of accessing uninitialized movie clips:
Copy link to clipboard
Copied
comment all your code except the first line. is this.myMovieclip on frame 24 (or 25)?
Copy link to clipboard
Copied
I actually mentioned something wrong. I'm not stopping the movieclip from the main timeline because "this.myMovieclip.gotoAndStop(24);" simply just doesn't do anything. I'm stopping at the frame of the movieclip itself. My problem is that it will always start from 0 when I come back to the frame it was created.
Copy link to clipboard
Copied
I think I know what the problem is. If you look ate the js file exported (projectname.js) it looks like the movieclip is assigned after the main timeline function.
Because if I immediately do this.myMovieclip.gotoAndStop(24) it won't work. But if i do:
setTimeout(function () {
this.myMovieclip.gotoAndStop(24);
}, 5000);
it stops. Still don't know how to stop it immediately and avoid it starting from 0, though.
Copy link to clipboard
Copied
delay by 100ms.
Copy link to clipboard
Copied
Why don't you just put this.gotoAndStop(24); in the first frame of myMovieclip itself?
Well anyway, there's a fair bit of discussion in this thread on the subject of accessing uninitialized movie clips:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now