Forum Topic: As Help(mc Shit)

(203 views • 8 replies)

This topic is 1 page long.

<< < > >>
None

Andorox

Reply To Post Reply & Quote

Posted at: 8/1/08 03:27 AM

Andorox NEUTRAL LEVEL 04

Sign-Up: 02/09/08

Posts: 8

Ok, I need a code to put in the main frame, that moves to another frame when I hit a certain frame in an MC.

I.e. When the mc hits frame 50, it goes to frame 5 on the main frames. Help much?


None

Eredar

Reply To Post Reply & Quote

Posted at: 8/1/08 07:18 AM

Eredar NEUTRAL LEVEL 17

Sign-Up: 02/24/07

Posts: 369

At 8/1/08 03:27 AM, Andorox wrote: Ok, I need a code to put in the main frame, that moves to another frame when I hit a certain frame in an MC.

I.e. When the mc hits frame 50, it goes to frame 5 on the main frames. Help much?

er..

if(mc._currentframe == 50) {
gotoAndStop(5)
}

that should be it, you might want gotoAndPlay depending on your needs.


None

Vengeance

Reply To Post Reply & Quote

Posted at: 8/1/08 07:20 AM

Vengeance EVIL LEVEL 28

Sign-Up: 03/18/05

Posts: 5,033

At 8/1/08 07:18 AM, Eredar wrote: er..

You'd need an enterFrame event handler assuming that the timeline was stopped - which logically, it would be - so the proper code would be:

onEnterFrame=function(){
if(mc._currentframe>=50){
gotoAndPlay(5);
}
}

========|| WWWWWWWW>[-[Blog] - [Audio] - [Userpage] - [Flash] - [Last.fm]-]<WWWWWWWW ||========

BBS Signature

None

CaiWengi

Reply To Post Reply & Quote

Posted at: 8/1/08 07:27 AM

CaiWengi EVIL LEVEL 07

Sign-Up: 09/17/04

Posts: 1,517

Or, just on the 50th frame of the movieclip put

_root.gotoAndStop(whateverframenumber)

Sig by ApothicFlash <3

BBS Signature

None

Doomsday-One

Reply To Post Reply & Quote

Posted at: 8/1/08 07:30 AM

Doomsday-One EVIL LEVEL 10

Sign-Up: 10/28/05

Posts: 1,385

Alternatively, you could put some code on the MC's 50th frame. Many coders like to keep their code on the main timeline, but this works too:

_root.gotoAndStop(5)

OR

_root.gotoAndPlay(5)

Depending on whether you want it to stop or play. Put that on the 50th frame (or whatever) of a Movie Clip, and when the Movie Clip reaches that frame, the main timeline will go to the 5th frame. Change the number in the brackets to change the frame.

The other suggestions work great too, but I felt like suggesting an alternative =)

Doomsday-One, working on stuff better than preloaders.

By the way, I made the 'Create an Animated Sprite' preloader for Sprite TV 3!


None

Vengeance

Reply To Post Reply & Quote

Posted at: 8/1/08 07:33 AM

Vengeance EVIL LEVEL 28

Sign-Up: 03/18/05

Posts: 5,033

At 8/1/08 07:30 AM, Doomsday-One wrote: The other suggestions work great too, but I felt like suggesting an alternative =)

The only problem with your method is that if he is using scenes, it will go to the 50th frame from the first scene. Which means it would require a lot more to fix, and a lot more to change.

========|| WWWWWWWW>[-[Blog] - [Audio] - [Userpage] - [Flash] - [Last.fm]-]<WWWWWWWW ||========

BBS Signature

None

Doomsday-One

Reply To Post Reply & Quote

Posted at: 8/1/08 07:35 AM

Doomsday-One EVIL LEVEL 10

Sign-Up: 10/28/05

Posts: 1,385

At 8/1/08 07:27 AM, CaiWengi wrote: Or, just on the 50th frame of the movieclip put

_root.gotoAndStop(whateverframenumber)

Do I always have to be beaten to posting an answer? =P

Doomsday-One, working on stuff better than preloaders.

By the way, I made the 'Create an Animated Sprite' preloader for Sprite TV 3!


None

Andorox

Reply To Post Reply & Quote

Posted at: 8/1/08 08:33 PM

Andorox NEUTRAL LEVEL 04

Sign-Up: 02/09/08

Posts: 8

Thanks guys. :)


None

Eredar

Reply To Post Reply & Quote

Posted at: 8/6/08 11:11 AM

Eredar NEUTRAL LEVEL 17

Sign-Up: 02/24/07

Posts: 369

At 8/1/08 07:20 AM, Vengeance wrote:
At 8/1/08 07:18 AM, Eredar wrote: er..
You'd need an enterFrame event handler assuming that the timeline was stopped - which logically, it would be - so the proper code would be:

onEnterFrame=function(){
if(mc._currentframe>=50){
gotoAndPlay(5);
}
}

yeah sorry, i just assumed he'd already had it down on an enterFrame handler :P


All times are Eastern Standard Time (GMT -5) | Current Time: 12:24 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!