View Full Version : Custom Cursor lags?
scott1969
April 25th, 2008, 12:53 PM
Any way to make this cursor act more like a real cursor?
http://misc.graphxco.net/DDtest/game.html
dzhedzho
April 25th, 2008, 02:21 PM
ActionScript Code:
setMenu();
Mouse.hide();
pointer.mouseEnabled=false;
pointer.visible=false;
addChild(pointer);
stage.addEventListener(Event.RESIZE,resizeBack);
stage.addEventListener(MouseEvent.MOUSE_MOVE,moveP ointer);
stage.addEventListener(Event.MOUSE_LEAVE,hidePoint er);
stage.addEventListener(MouseEvent.MOUSE_OVER,showP ointer);
function movePointer (event) {
pointer.x=mouseX;
pointer.y=mouseY;
}
function hidePointer (event) {
pointer.visible=false;
}
function showPointer (event) {
Mouse.hide();
pointer.visible=true;
pointer.x=mouseX;
pointer.y=mouseY;
}
function setMenu () {
var myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems () ;
myContextMenu.builtInItems.quality=true;
this.contextMenu=myContextMenu;
}
This is a timeline code... pointer is your pointer
this also removes the the annoying case of double pointer after RClick, and removes some context menu items you should not have in that movie...
scott1969
April 25th, 2008, 03:09 PM
Thanks. I seem to be getting this error on resize? access of undefined property
resize back?
magcius
April 25th, 2008, 03:44 PM
Remove
stage.addEventListener(Event.RESIZE,resizeBack);
from the code.
dzhedzho
April 25th, 2008, 03:47 PM
Thanks. I seem to be getting this error on resize? access of undefined property
resize back?
sorry I got that from already ready project, so there was something left...
ActionScript Code:
setMenu();
Mouse.hide();
pointer.mouseEnabled=false;
addChild(pointer);
stage.addEventListener(MouseEvent.MOUSE_MOVE,moveP ointer);
stage.addEventListener(Event.MOUSE_LEAVE,hidePoint er);
stage.addEventListener(MouseEvent.MOUSE_OVER,showP ointer);
function movePointer (event) {
pointer.x=mouseX;
pointer.y=mouseY;
}
function hidePointer (event) {
pointer.visible=false;
}
function showPointer (event) {
Mouse.hide();
pointer.visible=true;
pointer.x=mouseX;
pointer.y=mouseY;
}
function setMenu () {
var myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems () ;
myContextMenu.builtInItems.quality=true;
this.contextMenu=myContextMenu;
}
I guess I also forgot to mention that you should put some movie clip as a background, can be some transparent shape, otherwise it won't work as supposed...
scott1969
April 25th, 2008, 04:59 PM
Thanks again. Still seems to lag though..?
magcius
April 25th, 2008, 05:00 PM
Frame rate maybe?
EDIT: Also, there's a lot happening on stage. Try to reduce the number of tweens.
scott1969
April 25th, 2008, 05:50 PM
I see. Thanks again!
dzhedzho
April 25th, 2008, 05:56 PM
I see. Thanks again!
ActionScript Code:
Mouse.show();
stage.removeEventListener(MouseEvent.MOUSE_MOVE,mo vePointer);
stage.removeEventListener(Event.MOUSE_LEAVE,hidePo inter);
stage.removeEventListener(MouseEvent.MOUSE_OVER,sh owPointer);
You should enable the mouse cursor in the end screen... :D
magcius
April 25th, 2008, 05:58 PM
Also, you can click on the same food multiple times to win the game.
And the lose screen is the same as the win screen.
ptfury
April 26th, 2008, 03:15 PM
optimize the images use as less as onEnterFrame events as possible, and try not to have a lot of mcs appear at once, even so.. on my pc it works nice.
scott1969
April 27th, 2008, 08:15 PM
I need to add a removechild to my .as. There is not supposed to be two separate pages. the kids go to that one page no matter what, you are a winner every time. Kinda silly but thats what the boss wants. Thanks for your input.
scott1969
April 27th, 2008, 08:16 PM
Right On. Thanks.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.