Be a Supporter!

help with goto problem

  • 275 Views
  • 7 Replies
New Topic Respond to this Topic
Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
help with goto problem 2008-09-15 00:08:03 Reply

Hokay, so I've got this movie clip that, when you roll over it, will go to this "_over" frame and will make this other movie clip, "words", go to this "_about" frame.

stop();

this.staff_btn.onRollOver = function () {
	staff_btn.goto("_over");
	words.goto("_about");
}

Only the first part works. I'm trying to figure out the second. The path targeting seems right; I got the movie clip to play when I replaced the second "goto" with a "play". Any ideas on what's going wrong, or how to help?

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to help with goto problem 2008-09-15 00:29:39 Reply

Add this above your code:

function goto(where):Void {
gotoAndPlay(where);
}

Sup, bitches :)

BBS Signature
Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to help with goto problem 2008-09-15 10:51:48 Reply

By the "where"s do you mean I need to put my own location or something?

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to help with goto problem 2008-09-15 12:02:46 Reply

At 9/15/08 12:29 AM, liaaaam wrote: Add this above your code:

function goto(where):Void {
gotoAndPlay(where);
}

This looks to me like AS2, and it looks, from his code, he's working with AS3, which I believe has made the gotoAndPlay function defunct.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to help with goto problem 2008-09-15 12:06:52 Reply

Oops I fucked up D: You'd need to add that function as a prototype of the MovieClip class, lol. Oh well, it's easier to just explain: Just change your goto's to gotoAndPlay :P

@hoeloe, he isn't using AS3 because he is using onRollOver.. plus the way he's using it. GotoAndPlay is still in AS3 I'm sure :P


Sup, bitches :)

BBS Signature
Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to help with goto problem 2008-09-15 13:01:24 Reply

Huh. I did think to mention that, but I'm glad I didn't. I think I'm seeing how different 2.0 is from 3.0 now.
They really are, aren't they? Thanks for the help. I'll see if it works soon

Jigganis
Jigganis
  • Member since: Nov. 7, 2003
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to help with goto problem 2008-09-15 13:53:06 Reply

Hmmm. gotoAndPlay isn't quite working out. Well, what's the AS 3.0 solution to this, anyway? I'll be getting CS3 soon enough to implement it.

pseudoDust
pseudoDust
  • Member since: Sep. 8, 2008
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to help with goto problem 2008-09-15 14:14:26 Reply

AS3 still uses gotoAndPlay but everything else you did is different i.e:
instead of writing:
<someMovieClip>.onRollOver = function(){...}
you'll have to write:
<someMovieClip>.addEventListener(MouseEv ent.ROLL_OVER, <someFunction>)
function <someFunction>(e : MouseEvent) : void {
...
}