This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Flash Site Design > March 2006 > Please help with Button onRelease command
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Please help with Button onRelease command
|
|
|
| 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
| |
|
| I figured it out.
For those who need help with the same thing, you need to use gotoAndStop not
gotoAndPlay.
"Rich" <my_junk_mailbox@comcast.net> wrote in message
news:-eudnZbxMd9u1IHZRVn-pg@comcast.com...
> 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
>
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|