![]() |
Help with a for loop problem?
Okay so, I'm using a for loop to check through a multi-dimensional array, and everything is returning fine, the script is basically doing what I want it to do, no problem. But now within the for loop i'm trying to set an individual this.whatever flag everytime I mouse over an object in the array. (If this makes sense?) But for some reason, I can only set the flag for the last group of variables in the array.. ?
I dunno if what I just said makes any sense, but either way, check out the code and you'll probably see what I mean.. By the way, I am merely providing the pieces of the code that are needed in order for me to get help, the //Mouse Over part is being ran within a timeout loop just to clarify things a bit more.. Also, another clarification: I'm trying to set this.newDebug to true everytime the mouse enters the specified zone, but I can only set it for the "Rifle" array part. It won't set for any others. =/ Thanks in advance to anyone that helps. >_< PHP Code:
|
The reason it only works for the rifle is because it is the last member of the array. It is being set to true properly for the rest of them, but you're also immediately setting it back to false in the next loop iteration.
Try breaking out of the loop after you set it to true (and have performed all of your logic). edit: if you still need to hide remaining images, play with hideImgs(start, end). There's really no need to continue looping to hide the rest of the images because you know exactly how many you have PHP Code:
|
Quote:
|
Quote:
PHP Code:
|
Wow.. stupid of me. When you said to break out of the loop for someone reason I was thinking of something totally different. Forgot all about break; *****. But all I needed to do was assume it false like you said, than break out of the loop. Thanks alot Sales! ily! >_<
|
Quote:
Keep in mind that if you just simply break out of the loop you're no longer hiding the remaining images, so you'll need to do something about that like I showed above. |
Quote:
But aside from that, I've ran into another odd issue.. I'm making this menu fade in/out when opened/closed, using this.menu_alpha, increasing and decreasing the value. It all works fine. Except now i've tried to add an actor into the middle of the menu, but the problem being that I can't seem to get it to fade with the menu: PHP Code:
|
Quote:
thiso.menu_alpha is what you're aiming for. |
Quote:
Any ideas as to what else the problem could be? |
Anyone? No one? !pissed! :cry:
|
You could try using a gani script. I.e:
actor.attr[30] = "alpha.gani,0.5"; Gani: alpha.gani PHP Code:
|
| All times are GMT +2. The time now is 07:04 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.