Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Mouse Cursor 1

Status
Not open for further replies.

brainpudding

Technical User
Sep 29, 2002
84
US
OK here is what im trying to do. I have a movie clip with 2 frames, a diff graphic on each frame. on frame one of the main time line (thats where i try to keep all my code now.. thanks to Bill Watson) I have this code

//Mouse
//**************************************************************
Button.prototype.onRollOver = function(){
bluedot.gotoAndStop(2);
}
Button.prototype.onRollOut = function(){
bluedot.gotoAndStop(1);
}

I did this because i want it to change the mouse when ever you mouse over a button. (there is probably a better way to do that)...

ANYWAY the question is what would the code look like if i wanted it so that each time the user depressed the mouse a small movie clip would load at that place and run then disappear.

i am trying to make a cursor that look like a scope and when you click it kinda shoots a bullethole into the flash .. then after like a second it fades away. i can do the fading thing the old way in the movie .. unless there is a easier way..

Thanks
 
just place your clip anywhere on the stage and add to frame actions

someclip._visible = false;
this.onMouseDown = function(){
someclip._visible = true;
someclip._x = _xmouse;
someclip._y = _ymouse;
someclip.gotoAndPlay(1)
}

in the last frame of the clip set the visible property to false
 
cool that worked but it erases each time you click .. what I was wanting is for it to fade out on its own. that way there canbe multiples on the screen at a time .. and it also would be nice if it would just keep placing them if you held the mouse down ... kinda like a machine gun.
 
then you might be better with attachMovie and just pull it from the library as and when you want it

Code:
i=100
this.onMouseDown = function(){
	this.createEmptyMovieClip("clipholder" +i,i)
	this["clipholder"+i].attachMovie("clip",clip-i,i+2)
	this["clipholder"+i]._x = _xmouse;
	this["clipholder"+i]._y = _ymouse;
	i+=5;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top