Action Script question

Discuss all aspects of programming here.

Moderator: The Mod Squad

Action Script question

Postby localdistortion » Sat Aug 28, 2004 12:24 pm

how do I make it so when one mc runs into another the scene will change to the next one??

heres my code that doesn't seem to be working

onClipEvent (enterFrame) {
if (this.hitTest(_root.characterf))
function() {nextScene();
}
P4 3.0 Ghz
Abit IC7-Max3
40 GB Western Digital
256MB Radeon 9800 Pro
SB Audigy 24 bit
1 Gig Corsair XMS LL Pc3200 DDR
Antec SOHO File Server case 1080 AMD /430 PS
*SELLING* *SEE SALE FORUM*
localdistortion
Green Belt
Green Belt
 
Posts: 249
Joined: Thu Aug 07, 2003 2:06 am
Location: Novato, Ca

Postby localdistortion » Sat Aug 28, 2004 1:51 pm

i think ive found the problem. The action script seems to be trying to tell the movie clip to go to the next scene inside of itself rather then the actual next scene in the entire movie.


I found this out becuase when I run one movie clip into the other, the one that contains the code stops.

this is the code:

onClipEvent (enterFrame) {
if (this.hitTest(_root.characterf)){
nextScene();
}
}

Does someone know how to fix this?
P4 3.0 Ghz
Abit IC7-Max3
40 GB Western Digital
256MB Radeon 9800 Pro
SB Audigy 24 bit
1 Gig Corsair XMS LL Pc3200 DDR
Antec SOHO File Server case 1080 AMD /430 PS
*SELLING* *SEE SALE FORUM*
localdistortion
Green Belt
Green Belt
 
Posts: 249
Joined: Thu Aug 07, 2003 2:06 am
Location: Novato, Ca

Postby hypnotik » Sun Aug 29, 2004 2:49 pm

This ought to solve your problem. You can also replace _root with _parent

onClipEvent (enterFrame) {
if (this.hitTest(_root.characterf)){
_root.nextScene();
}
}
"I disapprove of what you say, but I will defend to the death your right to say it"

-Voltaire
hypnotik
Black Belt
Black Belt
 
Posts: 584
Joined: Tue Oct 22, 2002 9:07 pm
Location: Melbourne, Australia


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests