View Full Version : Scene selection with IF and ELSE IF
Angelstouch
02-02-2003, 02:32 PM
I try to make scene changes in my movie after a button is clicked.
But the scene first is supposed to fade out.
So I have different buttons that set a variable when clicked.
Like:
on (release) {
szene = 1;
gotoAndPlay("weiter");
}
every button of course has a different number.
Then after the fade that starts at "weiter",
I have a keypicture with the following actions
if (szene=1) {
gotoAndStop("Szene 2", 1);
} else if (szene=2) {
gotoAndStop("Szene 3", 1);
} else if (szene=3) {
gotoAndStop("Szene 4", 1);
}
but the selection is not made,
the film always only continues with the next scene.
Please could someone help me on this matter.
Lots of thanks in advance...
Angelstouch.
Ricod
02-02-2003, 02:44 PM
Hi ! Welcome to the board !
Some things about scenes : They can't be adressed from anywhere except the main timeline. Use framelabels instead of scenes and target these labels (to keep the same setup, just label the first frame of every scene with a unique framelabel).
Anyway, getting used to using framelabels saves you about half the scene troubles you will encounter. But from the looks of it, you are on the main timeline, right ?
So, try to prevent using spaces. I believe programmers will usually opt for something like szene_1 instead of szene 1. Prevents a lot of hassle. :)
If the no spaces thingie doesn't work (make sure the old version isn't still in the cache ... if you test in a browser, refresh it.) Make sure that the variable szene is actually set. Also, I'd go for a different name here, since it probably confuses Flash.
This looks a lot like previous posts I've seen. Chances are, when you have a problem, someone else already had the same one and someone answerd or maybe even wrote a complete solution for the problem at hand. Try using the search button and see if you can find your answer. Is a lot quicker than waiting for someone to answer your post. For now, good luck !
CyanBlue
02-02-2003, 02:51 PM
Yup... As Ricod mentioned already... Use FRAME LABEL instead of SCENE in Flash... Once again, repeat after me... SCENE BAD!!! FRAME LABEL GOOD... :D
Also, I see = in the condition of your if statement which should be == to check if the condition is met or not...
HTH
Angelstouch
02-02-2003, 03:11 PM
Oh, yeah, it was the == instead of = which was the problem.
Thanks alot.
Man, I was going crazy, cause I just couldnīt figure it out.
My background for this was still the old C64 BASIC.
So I didnīt think of something like that to be the problem.
Thousand thanks again...
Angelstouch.
Ricod
02-02-2003, 03:15 PM
Nice one CyanBlue !
*starts grumbling* ... you'd think after doing that myself a million times I'd notice the == thing. Oh well ! :D
CyanBlue
02-02-2003, 08:53 PM
Howdy, Ricod... :)
Don't get mad... I just pay some more special attention to '==' whenever I see if statements... Seen too many of '=' on the forum, and that kinda created this habit... That's all... :)
Ricod
02-07-2003, 01:50 PM
hehe ! I'm not mad (a little annoyed with myself though ... but that's another matter !) Hey, you're nearing the big 1k !
:)
CyanBlue
02-07-2003, 03:12 PM
Hehe.... Just made one...
Lots of :) and :( and yelling really helped... ;)
Ricod
02-07-2003, 03:55 PM
Well, if it gets the job done ... ;)
Congrats on your 'level-up' btw ! *insert some level up music*
CyanBlue
02-07-2003, 04:14 PM
Haha... Level up... Well... Your's are not too long either... Any plan for the day??? Big party maybe??? :D
Ricod
02-07-2003, 05:55 PM
Nah ! *I will if I ever pass Jesse or farafiro though ! Free Actionscript Man dolls for everyone !* <-can easily say this since that would NEVER happen !
CyanBlue
02-07-2003, 07:33 PM
Well... I guess I'll have to do some hacking to shut down the power line to the Jesse and farafiro's house so that we ALL can get the ActionScript action figure... ;) I'll take their power off for a week, so, go ahead and keep posting, bro... :D
Ricod
02-08-2003, 08:21 PM
I doubt anyone could post that much in just a week ... (and if someone can, that person needs to reconsider his / her livestyle !) Ofcourse excluding nonsense *like this ;)*
But how about I arrange an appearance by the ACTUAL ActionScript Man ? And to make it even better : WITH mrs. ActionScript Man ! *somehow, not sold seperately anymore :D*
CyanBlue
02-08-2003, 10:26 PM
Habahabahaba... :eek:
I'll just take the Mrs. ActionScript Man... I don't want both... You know that I am not greedy... :D
Ricod
02-08-2003, 11:29 PM
*lifts right eye brow* Being mrs. Actionscript Man's ex-husband I find it difficult to refer to her as "Habahabahaba...".'Personally I'm more comfortable with "Hubba hubba". ;)
CyanBlue
02-08-2003, 11:52 PM
Oh, That was Hubba hubba??? Excuse my poor English... Being a little Asian boy, English always comes to me as a challenge... :(
I wish my sista could back me up, but she's no where to be found...
Ricod
02-09-2003, 01:54 AM
Oh, wasn't making fun of your English (I do that with farafiro :D !). Where are you from then Jason ? (I'm studying Japanese, was born in Korea but live in the Netherlands at the moment)
CyanBlue
02-09-2003, 06:14 AM
I know that you do that all the time with farafiro... Poor farafiro... :D
Huh... Really??? I was born in Korea and live there till I was 24 and lives in the US ever since... :p How long have you been lived in Korea??? Weird... I feel like this thread is going to the general chat... :D
Ricod
02-09-2003, 07:18 AM
:D I could move it there ... then again, I might not for long ! I lived the first 3 years of my live in Korea, so, unfortunately can't speak it anymore (never could read it in the first place). It's a pity, but I might pick it up after being comfortable with Japanese.
CyanBlue
02-09-2003, 08:11 AM
Well... One of my cousin lived in Korea till he was 3 and he speak no Korean at all, so don't worry too much about it... He do understand some simple Korean conversations since his parents were speaking Korean, but I guess too many American friends spoiled him... :D
Hehe... Japanese... I have studied Japanese for two semesters while I was attending undergraduate courses... Well... I speak no Japanese at all other than Arigato, and I can't read them either... Of course I can kinda guess the characters since it shares Chinese characters, but Japanese characters are too simplified... I see that Japanese language is kinda easy one for Korean people to learn since we share the same grammar structure, but I kinda doubt that you will be learning Korean language faster just because you know Japanese... Well... It all depends on how you study though... Another cousin of mine was born in America, and he had lots of interests in Korea... So, he was trying whatever he can to learn how to speak Korean and such... He is the best among four of my cousins... So... Study harder and you will get there... :)
Just out of curiosity, why did you move to Netherlands??? You hated Korea because I was there too??? :p
Ricod
02-09-2003, 08:44 AM
Nah ! Then I would be leaving this board too !
Actually, I was put in an orphanage. I was adopted by a dutch couple I now consider my parents. I don't know anything about Korea though, except that its a torn country. The common people don't care much about the whole North - South question. Except that it costed too many lives and ripped families apart !
But fortuantely it's slowly restoring ...
I am a game enthusiast, so do know that a few really good looking games are being made in Korea (specifically Magna Carta. Love the character sesigns !)
CyanBlue
02-09-2003, 10:11 PM
Oh, I see... If you need to know anything about Korea, you know where to find me... :)
Yup... That North - South stuff... That was and is a tragic thing we have to live by... Oh, well... We're just hoping that we will get united some day soon... But then, when it happens, we will have lots of problems because of that... Time will heal the wounds, hopefully...
Don't know much about that gaming stuff especially ones from Korea... I might have been working on that industry if I were in Korea, but I am where I am now... Magna Carta... I'll look it up later... Haven't heard of it myself actually... But I guess it won't hurt to look up... :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.