HitTest and scene problem ?

  • viki9
  • Novice
  • Novice
  • viki9
  • Posts: 16

Post 3+ Months Ago

Hi i'm new here
Ok here is the deal i created a game in Flash and i'm using Scenes. Let's say my Scene 1 is Game Menu and Scene 2 is the game page. So now the problem i have is that my game is the "hit test" type of game.
When the fire hits the hero, it should jump to the "Game over page" which is in the same Scene 2...but the problem is when i use this code
Fire code
if (hitTest(_root.kinko)==true)
{
_x = random(500);
_y = random(500);
_root.gotoAndStop(3); <<<<< This code here is the problem
}

It jumps but it jumps back to the Scene 1 frame 3 instead of Scene 2 frame 3 Where i've put the game over page.
I've tried to change the code like this

gotoAndPlay("Scene 2",3);
but it does not work...By the way i wrote the code in the "fire" Movie clip instead at the frame.....Because i want the hero and the fire to colide so that it can jump to the game over page......
i hope i explained it well .....(i know its confusing) but if you guys can help me i'll be very very happy
just send me a message i'll send u a copy of it ....please help
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

Try going to the first frame in scene 2 and giving it a label (select the first frame and in the properties window it should show up). Then instead of using _root.gotoAndStop("Scene 2",3); simply use the label name. Let's say you gave the first frame of scene 2 a label of 'GameOver'. Then the code would be.

_root.gotoAndStop("GameOver");

Try that and see if it gets what you want. This is how you would do it in AS3 and it's evident from your code that you're working with AS2. But I believe that should work either way.

Also, I would imagine your code would work as well as long as you had it set as:
_root.gotoAndStop("Scene 2",3); but this will not work with AS3 so I imagine its good practice to do it with frame labels.
  • viki9
  • Novice
  • Novice
  • viki9
  • Posts: 16

Post 3+ Months Ago

Thanks alot it worked.....thanks again MUAHHHHH !!!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 13 guests
  • 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.