custom cursor not disappearing in safari
Hi,
I made a custom cursor for a photo gallery. It works. But when I go off of the gallery, my custom cursor disappears (good), but the "normal" cursor is gone too. So if I go off of the gallery, I don't see a cursor.
Any ideas?
Thanks!
Please post the code that turns your cursor on and off.
Please use [php] or [code] tags, and mark your threads resolved 8)
Here's a test file - thanks for checking it out!
Attached Files
Try something like this:
PHP Code:
var _cursor : MovieClip = new NextPrevImg ();
_cursor . prev . visible = _cursor . next . visible = false ;
_cursor . mouseEnabled = false ;
_cursor . mouseChildren = false ;
addChild ( _cursor );
var overMC : Boolean = false ;
mc . addEventListener ( MouseEvent . ROLL_OVER , imageOver );
mc . addEventListener ( MouseEvent . ROLL_OUT , imageOut );
stage . addEventListener ( Event . MOUSE_LEAVE , imageOut );
mc . mouseChildren = false ;
function imageOver ( e : MouseEvent ): void {
if( overMC ) return;
overMC = true ;
Mouse . hide ();
addEventListener ( Event . ENTER_FRAME , updateCursor );
}
function imageOut ( e : Event = null ): void {
if(! overMC ) return;
overMC = false ;
Mouse . show ();
_cursor . prev . visible = false ;
_cursor . next . visible = false ;
removeEventListener ( Event . ENTER_FRAME , updateCursor );
}
function updateCursor ( e : Event = null ): void {
_cursor . x = mouseX ;
_cursor . y = mouseY ;
_cursor . prev . visible = Boolean ( mc . mouseX < mc . width / 2 );
_cursor . next . visible = ! _cursor . prev . visible ;
}
function updateSize ( e : Event = null ): void {
mc . x = ( stage . stageWidth - mc . width ) / 2 ;
mc . y = ( stage . stageHeight - mc . height ) / 2 ;
}
stage . scaleMode = StageScaleMode . NO_SCALE ;
stage . align = StageAlign . TOP_LEFT ;
stage . addEventListener ( Event . RESIZE , updateSize );
updateSize ();
Please use [php] or [code] tags, and mark your threads resolved 8)
Thanks - I'll check this out!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width