Be a Supporter!

Point n Click help needed

  • 203 Views
  • 5 Replies
New Topic Respond to this Topic
mkmetalhead
mkmetalhead
  • Member since: Aug. 9, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Point n Click help needed 2009-07-30 20:10:24 Reply

Okay, so i resolved to make a Point n Click game a couple of weeks ago, i've done all the basic animations and such, created characters, got an interesting and funny (fingers crossed) storyline and am all ready for scripting.

Here's the snag, i'm stuck on the most basic of functions: pointing and clicking. I have a piece of rope that I have made into a button so that when you click on it, it is supposed to play an animation inside the main character starting on frame 5 of that movieclip.
character instance name = player
rope instance name = rope

Here is the code I have tried to use: (inside the rope)

on(release){
_root.player.gotoAndPlay(5);
}

What am I doing wrong?

Anamethatworks
Anamethatworks
  • Member since: May. 17, 2009
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Point n Click help needed 2009-07-30 20:53:51 Reply

wouldn't it be a lot easier to make a game if you put all the code in one frame... (the answer to that is yes btw)
if I were to do something like that I'd just write something like. (in a separate layer in a single frame on the main timeline)

rope.onPress = function(){
player.gotoAndPlay(5)
}

instead of spreading it all over the place. (you're bound to end up getting confused if its all over the place, and if you accidentally delete an item.. you lose your code)

also.. who actually uses buttons?

mkmetalhead
mkmetalhead
  • Member since: Aug. 9, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Point n Click help needed 2009-07-30 20:58:57 Reply

Thanks, i'll try that.

mkmetalhead
mkmetalhead
  • Member since: Aug. 9, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Point n Click help needed 2009-07-30 21:02:19 Reply

Okay, it didn't work. I've tried god knows how many google searches and every possible way I can think of to get this to work. Can anybody think of anything that would stop this code from working properly?

Anamethatworks
Anamethatworks
  • Member since: May. 17, 2009
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Point n Click help needed 2009-07-30 21:13:23 Reply

well it should work just fine that way. are you sure you set the instance names correctly? I tend to accidentally forget that a lot..
(just double checked.. to see if it works with buttons.. I kinda never use buttons.. and it does)

mkmetalhead
mkmetalhead
  • Member since: Aug. 9, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to Point n Click help needed 2009-07-30 21:21:39 Reply

Yeah, the instance names are all lower case to stop confusion, i've gathered all actionscript into one place and got all that working correctly. It just seems that this won't work, even though every source has told me to put the same code in.

Most likely thing is that I've screwed up somewhere and have a piece of hidden script that's doing something it shouldn't be. I'll start the game again and hope it goes better this time.

Thanks anyway.