Posts Tagged ‘Mouse Tracker’

Eyeblaster Mouse Tracker Example

Thursday, May 14th, 2009

This is a simple example code for using the Eyeblaster MouseTracker component I have added some additional functionality and quotes to explain how it works.


/*
	MouseTracker Example (300x250 Panel) - Kurt Grung 3L3373.com
	Usage: Drop a MouseTracker component to the stage and give it a instance name of "mouseTracker" no quotes.
*/

mouseTracker.onMouseMoveXY = mouseTrackerFunction; //This basically calls the MouseTrackFunction below every time the mouse is moved.

function mouseTrackerFunction(nXPos, nYPos, nRelXPos, nRelYPos) {

	if (nRelXPos<0 || nRelXPos>300 || nRelYPos<0 || nRelYPos>250) {

		//Wait Timer - if you wanted to add a delay before the panel shutdown.
		wait = function(){
			clearInterval(waitCall); //Kills the wait call so doesn't loop.
			EB.CollapsePanel("exp"); //Closes Panel down "exp".
		}
		waitCall = setInterval(wait, 1*1000); // 1*1000 = 1 Second.

		//Or you could comment out the above and call a function to start a end animation sequence rather.

	} else {
		//Do something?
	}
} 
Vote in HexoSearch
  • Categories

  • Recent Comments

  • Recent Posts

  • Tumblr

  • Flickr Recent Photos

    cherry tree woodstonja_gravestonesPockey Chimp FlavourAUTO FTW! :)darkdaystayouttiger kittenbirdofpreyfirst photo i took with my 1000dself_portrait_02
  • XFIRE (wkly hrs pld)

  • Last.FM

  • Tags

    .MP4 Actionscript Action Script Advertising AS2 AS3 backtrack BT4 bug Call of Duty capcom centOS COD count down countdown crossdomain Eyeblaster eyeblaster HD f4v Flash h264 HD high definition Install internet explorer Linux loadMovie MIME MIME Types MW2 Nazi Zombies pc PHP ports preloader release date rich media shared objects SWF SWFOBJECT timer torrents Video video/mp4 win7