Wow! It has been a while since I asked an AS related question here, but that's what I love about FK, If in need go to the ol' faithful yellow.
I am starting to dive into AS3, phew seems different/more difficult on so many levels, and have hit a wall. Usually Google is my friend but it seems I am not the only one with issues and I am having a hard time finding an answer in the sea of questions.
I have a timeline that I would like to keep simple and just have movieclips per frame. At the end of each movieclip I would like the timeline to progress one frame on the main/root timeline.
So far in the root file I have stop(); actions on each frame, on its own actions layer, and a layer per MC. Each MC has an instance name, lets just say 1, 2, 3. I have tried several methods by adding AS to the final frame in the MC but keep getting errors. I don't even think it is worth showing those due to the nature of the methods, pretty much just taking stabs in the dark.
Can anyone point me in the direction of a tutorial or provide me with an example of how to do what I am trying to accomplish?
Well, if I understand correctly, you're trying to have each of the root timeline's frames contain one (or more?) MCs which in turn have their own timelines? If that is what's got you stumped, I suppose you could just add something along the lines of:
on each frame of the main timeline, because where you really want the code to be here is not on the movie clips (except for a stop statement on the final frame).
I'm not sure if that's what you were asking for or not..
You are right about my set-up. I have a timeline that has movieclips with their own timelines. I do have a stop(); on the final frame of the movieclips. I added the AS you provided and the first MC played but it did not advance to the next frame of the main movie timeline when the MC finished.
Am I doing something wrong below? The first MC's instance name is intro which I need to go to the next which is productPan.
Oh wow, sorry about that... you put exactly what I told you to put but I failed to realize that that code doesn't even make sense! *facepalm* In fact, you barely need ANY code.
Here's an actual solution (tested):
The picture is above shows the main timeline. On the first keyframe, I placed an instance of Square1 called sq1 and created 19 frames to follow it (since the Square1 movieclip has 20 frames all together in its timeline).
Next, I placed an instance of Square2 called sq2 at frame 21 (which is a keyframe, as you can see, that does not contain sq1) and kept it on the timeline for 19 more frames as it too has 20 frames all together in its timeline.
Finally, I added a blank keyframe at the end on which I dropped a stop() statement. I know this works and I attached the .FLA to prove it yet I'm not entirely sure that this is the best solution. However, I am pretty tempted to say it is, seeing as matching the timeline frames to the movieclip keyframes seems logical enough.
Hmm I can't open it, I am running CS3, seems to have issues opening newer versions.
That will make for a cleaner timeline and it does work but I was hoping for a more condensed solution. One keyframe for each MC with no frames in between. That is why I figured there would be code in the MC telling the main timeline to progress by one frame. I am just having issues figuring that part out.
Yes, I see what you mean. I suppose you could try stopping each keyframe on the main timeline that contains a movieclip (MC A) whose timeline you want to play. But to have it resume and move on to the next keyframe, where MC B is located, I guess you'd have to code it to tell its parent ("root", in this case, but you can type parent as well) to gotoAndStop at the next frame (ex: frame #2).
To be honest, I don't know if that's possible, but it's worth trying (place on the final frame of the MC):
Actionscript Code:
MovieClip(parent).gotoAndStop(2);
EDIT: Yep, this works and it's condensed, as you wanted it to be! Is this what you were looking for?