If Statment
- Started
- Last post
- 10 Responses
- wksp
hey i have an if statement in flash thats works fine locally but when uploaded to a server it fails to work.
I know the variable is being received by the movie....but the if statement is not completing its task
Any Ideas???
- Bluejam0
You might want to show us the code, otherwise it'll get all 'who's-on-first?" rather quickly.
- wksp0
if (itemcount == 1) {
tellTarget ("_root.arrivals.new") {
gotoAndStop(1);
}
tellTarget ("_root.mb.scroll") {
gotoAndStop(1);
}
} else if (itemcount == 40) {
tellTarget ("_root.arrivals.new") {
gotoAndStop(40);
}
tellTarget ("_root.mb.scroll") {
gotoAndStop(8);
}
}
- wksp0
the variables are being pulled in from a text file by the way
- Bluejam0
If 'itemcount' is a variable on the main time line you're missing '_root.' from the code.
Also waht happens if 'itemcount' is neither 1 or 40?
- wksp0
the variable is being pulled into the MC where the if statements reside therefore, no _root
as for the missing else, there are 39 elseif's that go from 2-40
it will always be a number in that range
- autonoma0
Which version of Flash are you using?
- autonoma0
Try this instead:
if (itemcount == 1) {
_root.arrivals.newClip.gotoAndSt...
_root.mb.scroll.gotoAndStop(1);
}
else if (itemcount == 40) {
_root.arrivals.newClip.gotoAndSt...
_root.mb.scroll.gotoAndStop(8);
}Not that I changed 'new' to 'newClip' because 'new' is actually an operator that creates a new object in Flash, probably also creating your problem.
I don't know how you have everything structured, so it's hard to say just looking at this small bit of code.
- autonoma0
I mean "NOTE that I changed..."
- autonoma0
Also, calling a movie clip 'scroll' is a bad idea, too, because 'scroll' is a property targeting a text field.
- monNom0
if((tree.action == "falls") and (location == "forest")){
anybody.hear = ?;
}he he he *snort*