🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.pl.programy.flash-5
3 messages
3 total messages Started by P.W. te Lintel Hekkert Mon, 07 Jan 2002 18:36
Problem with defining variable in FLASH 5
#469
Author: P.W. te Lintel Hekkert
Date: Mon, 07 Jan 2002 18:36
51 lines
2020 bytes
Hello!

I want to create the following:

I have 5 buttons in my menu. When button 1 is pressed, the variable "choice"
must become 1. The other 4 buttons result in "choice" is 2,3,4 or 5.

Then further down the movie I want to check the value of  "choice" --> if
"choice" is 1 then a certain then gotoandplay goes to the label "choice1"
and so on for 2,3,4 and 5.

I have expiremented with some actionscript but it doesn't work correctly:

For the buttons I think the script must be something like this:

on (press) {
choice = "1";
 gotoAndPlay ("choice1");
}

For the valuecheck of  "choice" I think the script must be something like
this:

if ( choice = "1" ) {
gotoAndPlay ( "choice1" );
}

else

if ( choice = "2" ) {
gotoAndPlay ( "choice2" );
}

and so on for 3,4 and 5


But this resulted in all choices playing "choice1" --> I guess because this
is the first next frame the movie runs into.

So I must have done something wrong..... but what?

Can anyone please give some advise?


Thanx!!!!


Greetings,

Peter te Lintel Hekkert
peter.te.lintel.hekkert@planet.nl
Re: Problem with defining variable in FLASH 5
#470
Author: Hubert Muller
Date: Mon, 07 Jan 2002 18:51
33 lines
1773 bytes
Użytkownik "P.W. te Lintel Hekkert" <peter.te.lintel.hekkert@planet.nl>
napisał w wiadomości news:a1cpqq$q1m$1@reader05.wxs.nl...
> Hello!
>
> I want to create the following:
>
> I have 5 buttons in my menu. When button 1 is pressed, the variable
"choice"
> must become 1. The other 4 buttons result in "choice" is 2,3,4 or 5.
>
> Then further down the movie I want to check the value of  "choice" --> if
> "choice" is 1 then a certain then gotoandplay goes to the label "choice1"
> and so on for 2,3,4 and 5.
EHLO,
Look at this:

button =5;
if (button = 1) trace ('*');
trace (button)

And this:

button =5;
if (button == 1) trace ('*');
trace (button)

:-) You must use == (two times =) for logical equation and =(one =) for
assignment. This is fundamental rule of all modern languages :-)

regards,
mrv

Moze i angielski nie najlepszy ale chyba skumal o co chodzi :-)
Re: Problem with defining variable in FLASH 5
#471
Author: P.W. te Lintel Hekkert
Date: Wed, 09 Jan 2002 11:56
50 lines
2184 bytes
Yeah!

Thanx! It works great know!

I am still a newbie you know! :-)


Greetz,

Peter

"Hubert Muller" <hubert@hubertmuller.com> schreef in bericht
news:3c39ef1e@news.vogel.pl...
> Użytkownik "P.W. te Lintel Hekkert" <peter.te.lintel.hekkert@planet.nl>
> napisał w wiadomości news:a1cpqq$q1m$1@reader05.wxs.nl...
> > Hello!
> >
> > I want to create the following:
> >
> > I have 5 buttons in my menu. When button 1 is pressed, the variable
> "choice"
> > must become 1. The other 4 buttons result in "choice" is 2,3,4 or 5.
> >
> > Then further down the movie I want to check the value of  "choice" -->
if
> > "choice" is 1 then a certain then gotoandplay goes to the label
"choice1"
> > and so on for 2,3,4 and 5.
> EHLO,
> Look at this:
>
> button =5;
> if (button = 1) trace ('*');
> trace (button)
>
> And this:
>
> button =5;
> if (button == 1) trace ('*');
> trace (button)
>
> :-) You must use == (two times =) for logical equation and =(one =) for
> assignment. This is fundamental rule of all modern languages :-)
>
> regards,
> mrv
>
> Moze i angielski nie najlepszy ale chyba skumal o co chodzi :-)
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads