--This needs to be put on the movie level script -- or on the exitframe script --- first one shows simple version --**** note revised from previous - the keycodes were mapped wrong -- on keyhandlereset - more complex -- resets the moving object when it goes too far -- check the registration point - on paint window it is usually in the middle -- it would effect when you reset -- if the point were in the middle you would reset when the object is past the edge by half the width -- a 50 pixel object would be reset when its loch (registration point) were 640+26 -- in this example they are put back to the opposite side of screen -- with other code you could do other interesting things like make it bounce - just move opposite direction on keyDown --keyhandlerarrow -- pick which routine you want keyhandlerarrowreset end on keyhandlerarrow if (the keycode) = 124 then --rightarrow sprite(4).loch = sprite(4).loch+1 end if if (the keycode) = 123 then -- leftarrow sprite(4).loch = sprite(4).loch-1 end if if (the keycode) = 126 then -- uparrow sprite(4).locv = sprite(4).locv-1 end if if (the keycode) = 125 then -- downarrow sprite(4).locv = sprite(4).locv+1 end if -- end on keyhandlerarrowreset if (the keycode) = 124 then --rightarrow sprite(4).loch = sprite(4).loch+1 end if if sprite (4).loch > 640+26 then -- test right sprite (4).loch = -25 updatestage end if if (the keycode) = 123 then -- leftarrow sprite(4).loch = sprite(4).loch-1 end if if sprite (4).loch < -26 then -- test left sprite (4).loch = 640+26 updatestage end if if (the keycode) = 126 then -- uparrow sprite(4).locv = sprite(4).locv-1 end if if sprite (4).locv < -26 then -- test up sprite (4).locv = 480 +26 updatestage end if if (the keycode) = 125 then -- downarrow sprite(4).locv = sprite(4).locv+1 end if if sprite (4).locv >480 +26 then -- test down sprite (4).locv = -26 updatestage end if end