Page 1 of 1

Ajax javascript problem with player going off the screen

Posted: Mon Apr 04, 2011 7:23 am
by AnnaMandos
Hi i was hoping you could help me with this issue... basically in the interface while the player travels to the edge of the screen say the right hand side of the screen, the player transports to the left and same thing in the oppsite manner. Halls explains this well in the second vid i think but i dont believe ive changed much for it to happen ... if i can remember the sprite stopped at the edge of the screen...
If the sprite goes to the top of the screen it disapears, same with the bottom of the screen.

I goto the file from:
Ajax/Javascript Vid Tuts
http://www.mediafire.com/?lpdd5naxh6lo42o

for (i=0;i<=659;i++)
{


var divTag = document.createElement("div");

divTag.id = "div" + i;

//divTag.style.margin = "0px auto";


divTag.className ="dynamicDiv";

//divTag.innerHTML = "HE";

document.getElementById("maparea").appendChild(divTag);

}
document.getElementById("maparea").style.backgroundImage = "url(http://localhost/***********/images/grassback1.png)";
travel(map);


ALSO for some reason i have to insert url(http://localhost/***********/images/grassback1.png) to get the background image not sure why that is?? when originally it worked url(images/grassback1.png)

Any light on this would be extremely greatful

Re: Ajax javascript problem with player going off the screen

Posted: Fri Apr 08, 2011 9:13 pm
by Jackolantern
Moved to Advanced Help and Support (advanced due to dealing with client-side coding and real-time animation effects).

Re: Ajax javascript problem with player going off the screen

Posted: Fri Apr 08, 2011 10:04 pm
by Xaleph
Relative urls are reference problems, so either you went deeper into the code ( maybe sorting out images or the like ? ) and the other one is where you say that the maparea gets the background image. Now, i`m not sure if thats intentional or not, but i think you want the div to have that background image. Could be me tho..