hey guys, since this is my first post, and im a newbie, i need help with one of my scripts. so the thing is that im trying to change backgrounds by using the left/right arrows, and by using variables by doing so. heres a part of the code
when [right arrow v] key pressed change [background v] by [1] if <(background) = [0]> switch to background [background2 v] end if <(background) = [1]> switch to background [background4 v] end if <(background) = [2]> switch to background [background5 v] end when [left arrow v] key pressed change [background v] by [-1]the problem is that when i try going back a page, it will remain on the current page, unless you press left twice, and right arrow once. please i really need help on this one!!!
Offline
Here's the problem with your original script: the "update background image" section of the script ("if background = 0, switch to background2, etc.") only is under your "right arrow" hat, so it never even gets called when you press the left arrow. The variable updates, but not the image. I would use gfchll's script, posted above. It'll work fine.
Offline
new problem, i realized that i want a background to flash from one background to another, creating an effect, so i have to use variables. so its like a have a beginning page, that flashes "press right arrow to begin", and that works by switching from two backgrounds. can somebody help me out?
Offline
kavinda wrote:
new problem, i realized that i want a background to flash from one background to another, creating an effect, so i have to use variables. so its like a have a beginning page, that flashes "press right arrow to begin", and that works by switching from two backgrounds. can somebody help me out?
If I understand your problem, I think you can try this:
when gf clicked repeat until <key [right arrow v] pressed?> switch to background [press right arrow1 v] wait (whatever amount of time you want between flashes) secs switch to background [press right arrow2 v] wait (whatever amount of time you want between flashes) secs end switch to background [background after the 'press right arrow2' background v]And use the other scripts people have given you as well. Make sure to just ADD this script, not REPLACE the other suggestions.
when [right arrow v] key pressed next background when [left arrow v] key pressed switch to background ((background #)-(1))Or make the flashing words a separate sprite.
Last edited by awesomeness321 (2012-10-13 22:20:49)
Offline