Be a Supporter!

menu buttons for actionscript

  • 371 Views
  • 11 Replies
New Topic Respond to this Topic
MOC-Productions
MOC-Productions
  • Member since: Mar. 27, 2003
  • Offline.
Forum Stats
Member
Level 15
Filmmaker
menu buttons for actionscript 2008-08-15 22:19:03 Reply

Okay so I don't know if flash 8 actionscript is just near impossible or if i'm just rusty but i'm having the hardest time assigning functions to my buttons. All I want one of them to do is go to and play the next scene, but I get an error message every time saying "statement must appear within on handler". I'm sorry, what the hell does that mean?

Benji
Benji
  • Member since: Aug. 14, 2008
  • Offline.
Forum Stats
Member
Level 15
Melancholy
Response to menu buttons for actionscript 2008-08-15 22:24:20 Reply

is the code "Thingy.onRelease = function(){" or "on(release){" , also, where are you putting it? That's the main problem, it's saying it's not in the right place pretty much


BBS Signature
MOC-Productions
MOC-Productions
  • Member since: Mar. 27, 2003
  • Offline.
Forum Stats
Member
Level 15
Filmmaker
Response to menu buttons for actionscript 2008-08-15 22:28:38 Reply

At 8/15/08 10:24 PM, BeefyBoy12 wrote: is the code "Thingy.onRelease = function(){" or "on(release){" , also, where are you putting it? That's the main problem, it's saying it's not in the right place pretty much

what do i put instead of "thingy". whats supposed to go there?

Benji
Benji
  • Member since: Aug. 14, 2008
  • Offline.
Forum Stats
Member
Level 15
Melancholy
Response to menu buttons for actionscript 2008-08-15 22:54:18 Reply

the instance name which is made by clikin on ur buton n typing something in where it says properties inspector n the code goes inside the frames of the main timeline


BBS Signature
Maxwelldoggums
Maxwelldoggums
  • Member since: Mar. 23, 2008
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to menu buttons for actionscript 2008-08-16 10:09:34 Reply

I use it a little differently... I put the code in the button and say

on(release) {
DO STUFF
}

kiljoy96
kiljoy96
  • Member since: Jul. 2, 2008
  • Offline.
Forum Stats
Member
Level 21
Musician
Response to menu buttons for actionscript 2008-08-16 10:29:23 Reply

it should work if you put this in to go to different scenes

on (release) {
gotoAndPlay("2", 1);
}

the 2 is the scene number and the one is the frame number

but i have flash 6 not 8

SteamID: Fetus

BBS Signature
MOC-Productions
MOC-Productions
  • Member since: Mar. 27, 2003
  • Offline.
Forum Stats
Member
Level 15
Filmmaker
Response to menu buttons for actionscript 2008-08-16 14:10:48 Reply

At 8/16/08 10:29 AM, kiljoy96 wrote: it should work if you put this in to go to different scenes

on (release) {
gotoAndPlay("2", 1);
}

the 2 is the scene number and the one is the frame number
but i have flash 6 not 8

What if I have specific names for my scene, like for instance if the fourth scene was called "chase", what would I put in the script then?

DJMAX
DJMAX
  • Member since: Mar. 11, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to menu buttons for actionscript 2008-08-16 14:16:18 Reply

oh god, i feel ya man i had this same prob with switching scenes, AND THE ANSWER IS SO SIMPLE!! YET SO HARD IF YOU DONT ALREADY KNOW IT! SO HERE YA GO!

put this on ur button --

on(release){gotoAndPlay("BOB");}

than go to the frame of any scene that you want the button to play and single click it, then look down at your fram properties and name the fram "BOB"

and there u go! all done!


!DJ MAX!
Ive gotten great feedback and im quite pleased with it myself! v.3 of my site! GO CHECK IT OUT! ITS AMAZING!

BBS Signature
zrb
zrb
  • Member since: Aug. 8, 2006
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to menu buttons for actionscript 2008-08-16 14:25:13 Reply

At 8/16/08 02:10 PM, MOC-Productions wrote: What if I have specific names for my scene, like for instance if the fourth scene was called "chase", what would I put in the script then?

on (press) {
_root.gotoAndPlay("chase",1)
}
You put your exacts scene name in quotation marks :)


School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature
Cthun
Cthun
  • Member since: Jun. 25, 2008
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to menu buttons for actionscript 2008-08-16 14:33:00 Reply

on(release){
nextScene();
}

zomgz?!

IOUPAIN
IOUPAIN
  • Member since: Jul. 20, 2007
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to menu buttons for actionscript 2008-08-16 14:45:20 Reply

on(release){
gotoandplay("scene","frame");
}

bl00db47h
bl00db47h
  • Member since: Sep. 8, 2008
  • Offline.
Forum Stats
Member
Level 15
Animator
Response to menu buttons for actionscript 2008-09-10 16:00:55 Reply

on (release) {
play();
}

At least that's what i think it is. apply script directly to button!!!!


The Problems of the Future, by Everyone!