The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsOkay, 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?
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?
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?
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)
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.