1 Replies - 1401 Views - Last Post: 27 November 2006 - 07:11 AM

#1 Kara848  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 25-October 06

playing two movie clips at the same time from button

Posted 25 October 2006 - 11:40 AM

Hi. I have a website that I'm designing in Flash and I need a way so that when I press a button it goes to a frame it creates two new emptyMovieClips and plays the two movies at the same time. I have it working with just one movie clip and the code I have is:

on (press) {
	gotoAndPlay("mar");
	this.createEmptyMovieClip("original_mc", depth++);
	mcA = ["IceAd_next_mc", "Marriott_fade_mc"];
	index = 0;
	xx = 448;
	yy = 105;
	mc = this.attachMovie(mcA[index], "mc", 0);
	mc._x = xx;
	mc._y = yy;
	trace(mc);
	this.onEnterFrame = function() {
		if (mc._currentframe == mc._totalframes) {
			index++;
			if (index<mcA.length) {
				mc.removeMovieClip();
				attachMovie(mcA[index], "mc", 0);
				mc._x = this.xx;
				mc._y = this.yy;
			}
		}
	};
}




I also can make it work for the second movie clip alone, but not together the code for the second movie clip is just below. Is there a way to combine the two so that they both play at the same time?

this.createEmptyMovieClip("text_mc", depth++);
mcA = ["ICE_txt_mc", "MAR_txt2_mc"];
index = 1;
xx = 217.5;
yy = 367.5;
mc = this.attachMovie(mcA[index], "mc", 1);
mc._x = xx;
mc._y = yy;
trace(mc);
this.onEnterFrame = function() {
	if (mc._currentframe == mc._totalframes) {
	index++;
	if (index<mcA.length) {
		mc.removeMovieClip();
		attachMovie(mcA[index], "mc", 1);
		mc._x = this.xx;
		mc._y = this.yy;
	}
}
};



Thanks!

This post has been edited by pioSko: 27 November 2006 - 07:04 AM


Is This A Good Question/Topic? 0
  • +

Replies To: playing two movie clips at the same time from button

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: playing two movie clips at the same time from button

Posted 27 November 2006 - 07:11 AM

What's the code with the two movie clips in it?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1