ActionScript 2.0 Problems

Need programming help? Want to post programming tips? Are you programming a game and want to show it off? That and more here.

ActionScript 2.0 Problems

Postby entertainment.net » August 17th, 2010, 10:57 am

Space Cow Problem Screenshot.png
(64.33 KiB) Downloaded 24 times
Okay, I have this character in my game here, and I want to make it so that you can click him, and he moves out of the cow's way. But when I when I type in the most obvious coding,
Code: Select all
on(release){
   gotoAndPlay(2);
}
instead of moving forward in the timeline, it goes to frame two inside the actual Sonic movie clip. Which doesn't help.

So I tried
Code: Select all
on(release){
   _root.gotoAndPlay(2);
}
but that made it so that when you clicked Sonic, it went back to the beginning of my Flash Movie, the preloader...

I also tried
Code: Select all
on(release){
   this._parent.gotoAndPlay(2);
}
and that just did the same thing as _root.gotoAndPlay(2)...

Is there any other coding I can use to fix this problem?
Let's Plays!
Image Image
Image Image

Webcomic!
Image
"Stop being so abigig– abigm– armb– confusing! Stop being confusing!"
User avatar
entertainment.net
Veterans

Error contacting Twitter
 
Posts: 331
Joined: April 2nd, 2010, 10:17 am
Location: The Blind Eternities

Thumbs Up given: 0 times
Thumbs Up received: 2 times

Re: ActionScript 2.0 Problems

Postby Buff_ » August 17th, 2010, 11:57 am

Make it a button, and then use the first code.
User avatar
Buff_
A rather stellar gentleman

Error contacting Twitter
 
Posts: 2827
Joined: August 7th, 2009, 6:48 am
Location: Under the sink

The Start of Something Big

Thumbs Up given: 10 times
Thumbs Up received: 104 times

Re: ActionScript 2.0 Problems

Postby entertainment.net » August 17th, 2010, 12:00 pm

But the character has to be animated...
Do I put the movie clip in the button?


EDIT: Tried that, and it worked! Yahoo!

Now I have to do that to every character... :?
Last edited by entertainment.net on August 17th, 2010, 12:07 pm, edited 1 time in total.
Let's Plays!
Image Image
Image Image

Webcomic!
Image
"Stop being so abigig– abigm– armb– confusing! Stop being confusing!"
User avatar
entertainment.net
Veterans

Error contacting Twitter
 
Posts: 331
Joined: April 2nd, 2010, 10:17 am
Location: The Blind Eternities

Thumbs Up given: 0 times
Thumbs Up received: 2 times

Re: ActionScript 2.0 Problems

Postby Buff_ » August 17th, 2010, 12:02 pm

Yup. Looky here.. while it is still up.



EDIT: It's gone.
User avatar
Buff_
A rather stellar gentleman

Error contacting Twitter
 
Posts: 2827
Joined: August 7th, 2009, 6:48 am
Location: Under the sink

The Start of Something Big

Thumbs Up given: 10 times
Thumbs Up received: 104 times


Return to Programming