This content has been marked as final. Show 5 replies
The clip does have to be in the timeline to play as you are trying to do. The code cannot occur unless the playback head is where the movie exists. If you try to call DR1.play() at a point where the movieClip does not yet exist on the stage, nothing will happen.
Otherwise, if the movieclip isn't on stage, you have to use actionscript to create an instance of it.
Hard to tell what else might be wrong without more information.
OK - I realize now that I have to actually publish the movie to have the clip play, whether by dragging an instance onto the timeline or loading it via AS.
Now I have another issue. I'm sorry if these are stupid questions, but I have a hard time finding things in the help file - maybe I'm too much of a new Flash user to understand what to look for!
Anyway, when I play the movie, I have three problems:
1) the clip starts playing immediately, even though I don't issue the play() command until the middle of the movie. I do the attachMovie in the first frame so that it has loaded by the time I want to play it, but it starts playing right away even though I don't tell it to play.
2) the clip seems to be centered on the upper left corner of the screen when it plays. I have tried setting the _x and _y properties of the instance to 0,0 but that doesn't seem to make a difference. I want the clip to be centered on the screen (it is sized to take up the whole stage) but can't seem to move it no matter what values I plug into the _x and _y properties.
3) the clip loops continuously. I only want it to play once but can't seem to find a property to control the looping.
Here is the code in the first frame:
mc1 = this.createEmptyMovieClip("DR1", this.getNextHighestDepth());
this.attachMovie("DR1", "mc1", this.getNextHighestDepth());
mc1._x = 500;
mc1._y = 500;
mc1.stop(); (this was added to get it to not play until later, to no avail)
And the code at frame 113:
And finally at frame 412:
Beth, Here's a little help.....
3- You will need to have a stop action on the last frame of your movie clip, otherwise it will loop on the main timeline.
Try something more like this: (This assumes DR1 is the name of your movie clip)
mc1._x = 500;
mc1._y = 500;
Put a stop(); in the first frame of your movie clip and at the frame in the main timeline where you want it to start (113 in this case) put:
Since you will have put a stop(); at the end of the movie clip it will stop on its own.
Okay, your first suggestion, to put a stop() in the last frame of the clip, worked. Thanks.
But putting a stop in the first frame of the clip makes it stop, but it never restarts when it gets to the play() in frame 113.
And I still have the issue with placement on the stage.