all groups > macromedia flash sitedesign > march 2006 >
You're in the

macromedia flash sitedesign

group:

Please help with Button onRelease command


Please help with Button onRelease command Rich
3/18/2006 9:57:10 AM
macromedia flash sitedesign:
Greetings!

I am fairly new to Flash and I am designing my first website. I have some
buttons that I have created that onRelease I want to go to a certain frame
(1, 10, 20, etc). The buttons are linked to an AS file that contains all the
actions so I don't have to keep repeating the script for each button. This
is what I was told to do since I use the same button throughout my site, and
it seems to work good. My problem is that in my actions layer for the site
I have an onRelease command and it isn't working for me.



Here is my script:

b1.buttText.buttonText.text = "PORTFOLIO"; (

on(release){

gotoAndPlay("1");

}

b2.buttText.buttonText.text = "PHOTOGRAPHS"; (

on(release){

gotoAndPlay("10");

}



The error I receive is:

**Error** Scene=Scene 1, layer=actions, frame=1:Line 2: Unexpected 'on'
encountered

on(release){



I tired:

b1.buttText.buttonText.text = "PORTFOLIO";

this.onRelease = function(){

gotoAndPlay("1");

}

b2.buttText.buttonText.text = "PHOTOGRAPHS";

this.onRollOver = function(){

gotoAndPlay("10");

}

But nothing happens.



I would greatly appreciate any help



Thanks in advance

Re: Please help with Button onRelease command Rich
3/21/2006 6:50:58 AM
I figured it out.

For those who need help with the same thing, you need to use gotoAndStop not
gotoAndPlay.

[quoted text, click to view]

AddThis Social Bookmark Button