madmenyo Posted January 9, 2011 Share Posted January 9, 2011 Hey, I hope this is a common problem and don't have to post all of my code. Anyway i made a tile map which auto refreshes with setinterval every couple of seconds. It checks the database for other players in the vicinity. But often when i click the map (which makes a popup with some actions to perform) nothing happens. Any thoughts what this might be and how to fix it? Quote Link to comment https://forums.phpfreaks.com/topic/223850-weird-mouse-click-reaction/ Share on other sites More sharing options...
inversesoft123 Posted January 9, 2011 Share Posted January 9, 2011 It will help us to understand your problem if you give detailed information about this with code. nobody knows how you are refreshing page with cron , popup or in iframe. even we dont know which map you are using API or something else. Quote Link to comment https://forums.phpfreaks.com/topic/223850-weird-mouse-click-reaction/#findComment-1156974 Share on other sites More sharing options...
madmenyo Posted January 9, 2011 Author Share Posted January 9, 2011 Well i'm using settimout (not setinterval, srry mistake) from java within that i'm calling a jquery function to communicate with PHP and the mysql db. The tilemap is generated with PHP and some tiles are fetched from the database. Currently the player can move around, center, scroll and dock into a station by clicking on a tile wich gives a popup with the available actions. But sometimes if i click it does not pop up, most of the time it does but there are moments i have to click several times before that popup shows. I think it has to do with the "setinterval" but im not sure. The page refreshes with the setimeout which cals a php page that queries the server and load the new generated map into my map div. Like this: <script> function turnlistener() { $.post('flightscript.php', { go: 'first'}, function(data) { $('#flightcontroll').html(data); }); $('#map').load('mapgenerator.php'); }; $(function() { setTimeout('turnlistener()', 1000 ); }); </script> flightscript.php sets the destination the player wants to go in the database. Then mapgenerator.php generates the tiles that need to be displayed. Once the script finishes it loops again so every second ( setTimeout('turnlistener()', 1000 ); ) the map refreshes to see if there is a player nearby, or an NPC which need to be implemented yet. -edit- If things are still unclear on what map i'm using, i'm generating my own using tile divs with a fixed size and float them next to eachother within a map div with a fixed size. Currently you can only see 11x11 tiles. Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/223850-weird-mouse-click-reaction/#findComment-1156981 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.