Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : How to control an attachMovie (clip)


914_6
4/9/2004 6:59:35 PM
Hi, ive succeeded into attaching (dont laugh, weve all been beginners..) two
movieClips (as soundtracks), and having only one "trk1_occ" of them play, using
the following lines on frame one on scene1.

_root.attachMovie("trk1_occ", "test", 1);
_root.attachMovie.stop("trk2_occ", "test2", 2);

When i click on gotoScene2, the "trk1_occ" still plays. Thats what i wanted.
Now...

how can i have a button or two control the 2 attached movies? To swap between
soundtracks?

Thanks!



talltyler
4/9/2004 11:27:50 PM
I have never used attachmovie before but I am going to try to answer your
question.
It looks like you have made a variable for each when you attached them.
So you should be able to say

on(press){
_root.test.gotoandplay(1);
_root.test2.stop();
}

then make another to go the other way.

914_6
4/10/2004 12:05:35 AM
Thanks, ive tried that before. Then i tried again with your code. Doesnt work.

Any other way?

AddThis Social Bookmark Button