Hi. It's been a while since I've used Flash/Actionscript, and I've been having trouble figuring out the proper way to do this. I'm hoping someone here can outline the proper methods.
Basically, I'm creating a Flash project where it will play a video, then at a certain point, stop and display some buttons, and then go to the appropriate video based on what button was pressed. Sort of a choose your own adventure type of thing.
Without knowing the current/ideal way of doing it, how I tried it was by having the first video (embedded into the project) on one layer, and at the end of that video, I have a stop() on another (script) layer (on the last frame of the video in the timeline), and I had the buttons (which appear on top of the video) on another layer at that same frame. So, in theory, it plays the video, hits the last frame, stops the timeline, and waits for one of the buttons to be clicked. Each button triggers and gotoAndPlay(), which takes the timeline to one of the other two videos that are located one after the other, after the first video, on the same (video) layer.
Problem is, I have a bit of a catch-22... I was aware that there would be sync issues between the video and it's audio (addressed by doing the audio as Sync or something in the audio properties)... however, I was suprised to see that the video does not maintain sync with the other layers (script). So, what happens is that it plays the video, but SEEMS to play it faster than the script layer, so it reaches the end of the video before reaching the (identical frame) location of the actionscript. As a result, the video loops, and the stop() is hit sometime during the start of the second playing of the video. The buttons act similar, appearing sometime AFTER the point in the video where they should.
I had embedded the video with the assumption that this would give me hard sync between it and the timeline, since it's physically there in the timeline, and you can see the frame at which it ends... and I thought then putting a stop() on that frame (but on a different layer), would guarantee that the stop code gets hit at the same time the end of the video was.
I've tried a number of things, like putting the actionscript code on the frame after the video on the same layer, figuring a single layer can't go out of sync with itself... but that didn't work either.
Looking into it, I saw that one option was to not embed the video, but to have it reference an external file (which, supposedly, would result in no sync issues). But, in doing that, I'm not aware of how the rest of the timeline would know when the video has reached certain spots of the video.
I'm sure the proper method is entirely different from what I'm doing, but I'm not familiar with other methods. I'm hoping someone can outline the proper procedures (in as much detail as possible, since I probably won't know about much of what you are explaining).
Keep in mind, again that this is basically what I want to do:
-Play video 1
-Stop timeline, display buttons, wait for response
-Based on which button is pressed, jump in the timeline to video 2 or 3 (...I'm assuming all the vids will be on one layer, one after the other, with a label at the start of each one)
Hope you can help. Thanks.