Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Swap image in loop

Author
Message
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 24th Feb 2010 20:19
I have a very annoying problem. I want to swap an image when I press on it. I get it to work so it swaps from 1 to 2, but when I try to press again to swap from 2 to 1 it wont work.

It has to do with the mouseclick() in the loop, its like an evil circle.

You dont have to give me a code, I only seek advice.

Code attached:



Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 24th Feb 2010 20:28
Inside both your "if" statements, make mouse=1

If you don't you will always be making the second "if" statement true when you click. Even though you load the image in the first one, the second "if" condition is true after you load in the first "if".....

The fastest code is the code never written.
NightX
17
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 25th Feb 2010 11:39 Edited at: 25th Feb 2010 11:39
Heeeyy, i edited your code, and made it better, hope fully you will understand it, if not just ask.





Login to post a reply

Server time is: 2026-07-28 19:07:03
Your offset time is: 2026-07-28 19:07:03