The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 5:36 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 2 posts ] 
Hittest not working. 
Author Message
User avatar

Joined: Sun Mar 07, 2010 8:45 pm
Posts: 8
Location: That place that you can always see but can't get to.
Gender: Male
Here's the code i put on the hero Mc:

Code:
onClipEvent (load) {win=false}
        onClipEvent (enterFrame) {
<all the hero-movement code goes here>
                     if (_root.exit.hitTest(_x, _y, true)) {
      win = true;
   }


Here's the code I put on the exit Mc:

Code:
onClipEvent (enterFrame) {
   if (win=true) {
      _root.gotoAndStop("Scene 3", 1);
   }
}


Why, when the hero touches the exit, you do not go to scene 3, frame 1?


Tue Jul 06, 2010 2:52 am
WWW
User avatar

Joined: Tue Aug 12, 2008 2:07 pm
Posts: 39
if i had to guess id say it has to do with the var not being in that mc
what i would suggest is to either replace
Code:
win=true

with
Code:
_root.win=true

in the exit mc

or by putting the var in the frame and referring it to _root.win for both codes

you could also just put the code from the exit mc into the hero mc

_________________
get free wii points here!


Mon Jul 12, 2010 5:24 pm
Display posts from previous:  Sort by  
 [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.