Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Movies start/stop 1

Status
Not open for further replies.

edwardsal

Technical User
Nov 3, 2006
13
Hi all I have 2 movies: mc_cow and mc_dance, so I want to first movie mc_cow go from right to left side on screen and... when you click on mc_cow to play on that place mc_dance and after mc_dance finish, mc_cow continue from that place to end of screen!?!? Is anyone can help?!!?
 
There are many ways but here's one solution using purely ActionScript.

The set-up: MovieClips "mc_cow" and "mc_dance" in the Library and their Linkage IDs set to "mc_cow" and "mc_dance" respectably. Nothing on Stage.

Code:
var mc:MovieClip = this.createEmptyMovieClip("mc", 1);
with (mc) {
	_x = Stage.width;
	_y = 100;
}
cow();
function cow():Void {
	mc.attachMovie("mc_cow", "mc_cow", 1);
	mc.onEnterFrame = function():Void  {
		mc._x--;
	};
	mc.onRelease = function():Void  {
		delete this.onEnterFrame;
		this.attachMovie("mc_dance", "mc_dance", 1);
		this.onEnterFrame = function():Void  {
			if (this.mc_dance._currentframe>=this.mc_dance._totalframes) {
				delete this.onEnterFrame;
				cow();
			}
		};
	};
}

Kenneth Kawamoto
 
LOL I cant belive that my settings is for flash 6....but importing is that IT WORKSSSSSSSSSSSSS ;) thx dude
 
hey is there option when I put some sounds like steps for mc_cow that sounds off when is cow out of screen and again play when is on screen?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top