Be a Supporter!

Menu Problems

  • 242 Views
  • 5 Replies
New Topic Respond to this Topic
Unteries
Unteries
  • Member since: Jul. 23, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Menu Problems 2008-12-01 20:42:45 Reply

Currently, attempting to code a menu that pops up when you hit an object (hit the finish next level menu pops up) this is the code i have, and i checked my instances.

onClipEvent (enterFrame) {
if (_root.player.hitTest) {
_root.result."Next Level" visible=1
}
}

What's wrong with my syntax?

WhiteWingDemon
WhiteWingDemon
  • Member since: Jul. 8, 2006
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Menu Problems 2008-12-01 20:49:51 Reply

hitTest takes either a single parameter containing an object, or an x coordinate, y coordinate, and true or false.
In this case I think this is what you want:

if (this.hitTest(_root.player)) {

Not to mention your missing a semi colon after your statement inside the if statement. Also, I don't think you reference an instance inside of quotations. Correct me if I'm wrong. And what is result? next level?

Unteries
Unteries
  • Member since: Jul. 23, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Menu Problems 2008-12-01 20:53:10 Reply

At 12/1/08 08:49 PM, WhiteWingDemon wrote: hitTest takes either a single parameter containing an object, or an x coordinate, y coordinate, and true or false.
In this case I think this is what you want:

if (this.hitTest(_root.player)) {

Not to mention your missing a semi colon after your statement inside the if statement. Also, I don't think you reference an instance inside of quotations. Correct me if I'm wrong. And what is result? next level?

Yeah, that was my intention. XD
Never tried hittest's before really. but yes my "result" was to make the box visible when the character touches the end.

Unteries
Unteries
  • Member since: Jul. 23, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Menu Problems 2008-12-01 22:08:52 Reply

One last question. I have my v-cam centered on the player. What would i have to add to this:

to make it center on the menu when the player hits the end?

Unteries
Unteries
  • Member since: Jul. 23, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Menu Problems 2008-12-01 22:09:56 Reply

At 12/1/08 10:08 PM, Unteries wrote: One last question. I have my v-cam centered on the player. What would i have to add to this:
onClipEvent (enterFrame) {
_y += (_root.player._y-_y)/4;
_x += (_root.player._x-_x)/4;
}
to make it center on the menu when the player hits the end?

Sorry, my ctrl+v stuck and it didn't paste, right as i hit enter.

uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Menu Problems 2008-12-02 12:49:22 Reply

Instead of having the camera center on the menu, have the menu center on the camera.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature