flash 5 variable question
- Started
- Last post
- 16 Responses
- yawn
Hi
I have a flash 5 file that needs to pass a variable to play a certain section of a MC.
so it sets the variable in the first frame:
set(var1, "");then the second frame sends the variable via:
gotoAndPlay("/logos:" add var1);I'd like it to go to another part of the MC 'logos' if no variable is passed. How could I get it to do this. Thanks for your help!
- dbloc0
I think you need to explain that a little better.
- dbloc0
I think this is what you're looking for.
logoName = "myLogo"
if ( logoName != "" ) {
logos_mc.gotoAndPlay(logoName);
}
- yawn0
say if there no variable to pass then goto and play 'logos/labelName'
or something like that
basically sometimes there will be a variable and sometiime there won't. If there isn't one to pass goto and play 'here'
- dbloc0
give it the variable "noLogo"
and make a noLogo frame
- yawn0
that what I suggested but that woould require a change in systems beyond my control.
I was hoping that I could do something like
if Var1 is empty(false?) then gotoandplay"novariable"sorry my variable knowledge is limited
- dbloc0
you could do undefined
- kyl30
as the fame label? sorry I am not quite following.
- dbloc0
kyl3 what are you referring to?
- kyl30
sorry dbloc
you mentioned undefined.
Just curious how that would resolve actionscript wise?
- dbloc0
logoName = "myLogo"
if ( logoName != undefined ) {
logos_mc.gotoAndPlay (logoName);
} else {
logos_mc.gotoAndPlay (noLogo);
}
- dbloc0
that needed quotes actually
logoName = "myLogo"
if ( logoName != undefined ) {
logos_mc.gotoAndPlay (logoName);
} else {
logos_mc.gotoAndPlay ("noLogo");
}
- blaw0
if (var1 == undefined){
gotoAndPlay("label")
}
- blaw0
^ what dbloc said.
- yawn0
Thanks dbloc. I'll give it a try.
much appreciated!
- yawn0
thanks blaw as well!
- dbloc0
no problem.