开发者

flash lock the mouse in the game

iam planning to make a flashgame that requires the player to aim with his mouse. so there will be a crosshair. now i have the problem that whenever the mouse leaves the embedded flash stage and clicks outside this frame.. the player has to click in the flash field a开发者_如何学编程gain to be able to play again. that sucks. is it possible in flash to lock the mouse in the gamewindow?


MouseLock is now available in the Flash player 11.2 in Beta However it only works in full screen.


The short answer: no.

The long answer: You can only control mouse events and movement constraints within the scope of your SWF; you cannot control what happens outside of it. You can create bounds for your cross-hair movieclip, which will keep it from roaming off the stage, but you cannot prevent a user from clicking outside of the <iframe> or <embed>. The only realistic option you have is to make your game full-screen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜