Groups | Blog | Home
all groups > flash (macromedia) > july 2005 >

flash (macromedia) : Playing animated graphic while movie is Stopped


InfusedEMP
7/30/2005 11:21:19 PM
I've spent the past day learning how to get the position of a sound so that I
can coordinate my animation with it. Now I've discovered a new problem. I've
got it so that the whole movie stops, other than the sound, once a particular
bit of animation has played, and then it doesnt start again until the sound
reaches a certain position. I have one graphic that I need to have
continuously playing even when the movie is stopped. I assume this can be done
by setting up the graphic as a movie file and linking it similarly to the way I
did with the sound, but I can't find any tutorials on this, and I don't know
exactly what bit of scripting it takes. I've been using the tutorial located
at http://www.flashkit.com/tutorials/Audio/Flash_MX-Kenny_Be-824/index.php ,
but it only deals with sounds, not movies or graphics. I'd appreciate any help
anyone can give me on this, or any links to tutorials that deal with it.
Thanks.
abeall
7/31/2005 12:00:00 AM
InfusedEMP
7/31/2005 12:00:00 AM
What I need help with is learning how to fix the movie so that it plays when I
call on it. As you said, playing seperately from the scenes timeline. I don't
know exactly what I need to put in the actions to attach the movie when the
scene loads, and I don't know what actions I need to use to make the movie play
and stop, from within the scenes timeline.
For the sound I use:
firstSound = new Sound();
firstSound.attachSound("firstSound01");
And then to call on the sound and make it play I use:
{
if (playing!=true) {
_root.firstSound.start();
playing=true;
}
_root.firstSound.onSoundComplete = function() {
playing=false
}
}
What is the equivilent of this to attach and play a movie instead of a sound?
abeall
7/31/2005 12:00:00 AM
Look up the MovieClip in the help files, it will show you all available
methods. There is an attachMovie method
MovieClip.attachMovie(idName,newName,depth)
which will attach a movie from you libray to the specified MovieClip(the
linkage identifier under export for actionscript is what the idName is), and
the attached movie will play as soon as it's attached, unless otherwise
directed.

MovieClip.play()
MovieClip.stop()
InfusedEMP
7/31/2005 12:00:00 AM
Thanks, that helps...I've only got one problem with it now. The flash help
files dont seem to be very clear on exactly what the idName, newName, and depth
are supposed to be. I assume the idName is the name I gave it in the linkage,
but I have no clue what the newName is supposed to be, or how exactly to set
the depth. On the flash help files it only shows a "2 " in the depth, and
doesn't give an example of where the 2 is. I don't know if it's "scene 2", or
the name of something in the library, or something completely different.
abeall
7/31/2005 12:00:00 AM
These things are explained in the reference, but only very straightforward, not
like a tutorial. The duplicateMovieClip methods explain a little better some of
the dynamic movieclip aspects:

depth A unique depth level for the duplicated[or any dynamic] movie clip. The
depth level is a stacking order for duplicated movie clips. This stacking order
is much like the stacking order of layers in the Timeline; movie clips with a
lower depth level are hidden under clips with a higher stacking order. You must
assign each duplicated movie clip a unique depth level to prevent it from
replacing movies on occupied depths.

newName is the instance name for the newly attached/duplicated movieclip.

_root.attachMovie('myMC','newMC',1);
_root.newMC.play();
AddThis Social Bookmark Button