00:00
00:00
Newgrounds Background Image Theme

mariobros22 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

moving mc's while playing a mc

923 Views | 6 Replies
New Topic Respond to this Topic

moving mc's while playing a mc 2002-03-15 14:24:12


I'm having a problem where I want my movie clip to play a walking animation when a key is pressed. I'm sort of a newbie but I do know how to move a movie clip. The thing is, if I hold down the key to make it move(in this case left and right keys) it goes back to the first frame of the mc i'm playing. the walking part of the movie is like 10 frames so I'm wondering if maybe I should make the walking animation shorter like 2 frames or if there is some sort of command that will make the walking movie play entirely before starting agian. If anybody knows how to do this could you please reply to this post or possibly e-mail me an example of this.

Response to moving mc's while playing a mc 2002-03-15 15:14:25


Ok, this should work

First, you have your actual walking animation. Copy the 10 frames and make that its own symbol (ie walkingmotion). Then make the actual MC that will be moving. On frame1 put the standing still image there. Then on frame2, put a copy of the walkingmotion MC. Once you have done that, double click on the frame in the time line of the MC so the actions come up and put the stop(); action in on both frames. Once you have done that go back to the main time line of the flash. And put a copy of the final MC on the stage. Right Click and choose actions. Then in the actions, copy and paste this:

onClipEvent(enterFrame)
{

if(Key.isDown(Key.RIGHT))
{
this.gotoAndStop(2);
setProperty(this, _x, this._x + 10);
}

else if(Key.isDown(Key.LEFT))
{
setProperty(this, _x, this._x - 10);
this.gotoAndStop(2);
}

if ((!Key.isDown(Key.RIGHT)) && (!Key.isDown(Key.LEFT)))
{
this.gotoAndStop(1);
}

}

and that should work. Good Luck buuuuuuuuuddy.

moving mc's while playing a mc

Response to moving mc's while playing a mc 2002-03-16 07:39:03


No no no no no no NO!

Don;t use set property. Use:

this._x+=10;

Response to moving mc's while playing a mc 2002-03-17 11:15:37


At 3/16/02 07:39 AM, Uncle_Boris wrote: No no no no no no NO!

Don;t use set property. Use:

this._x+=10;

this guy is a newbie hes not going 2 know fuck about that code

Response to moving mc's while playing a mc 2002-03-18 20:35:39


Thanks a lot you guys. Like I said I didn't really need the code for moving an MC but I like'd some of those methods I saw that I didn't know about. Thanks a lot Frank2982 for suggesting that MC with the moving motion within my main movie. I can't believe I didn't think of that. Must be because I have a lot on my mind.

Response to moving mc's while playing a mc 2002-03-19 05:32:38


At 3/17/02 11:15 AM, stickdeathworld wrote:
this guy is a newbie hes not going 2 know fuck about that code

I told him step by step how to use the code, he doesn't need to know how to use it, just to know how to follow instructions and it seems that he does so shut up and go write more bad reviews about my movie on Fark.com you little whore.

moving mc's while playing a mc

Response to moving mc's while playing a mc 2002-03-19 14:35:54


At 3/19/02 05:32 AM, Frank2982 wrote:
At 3/17/02 11:15 AM, stickdeathworld wrote:
this guy is a newbie hes not going 2 know fuck about that code
I told him step by step how to use the code, he doesn't need to know how to use it, just to know how to follow instructions and it seems that he does so shut up and go write more bad reviews about my movie on Fark.com you little whore.

frank il live on northern ireland ......so dont fuckin mess wif me any more....i also can get ure account deleted with in days