Τετάρτη 3 Ιουνίου 2009

Drag tutorial or Hide Mouse tutorial







Create a new document in action script 2

Drag a rectangle with these values:


Convert it to a movie clip with (f8) and give it the name InMovie_mc. Go to the properties panel and write an instance name InMovie_mc.

Now make your new cursor (for this tutorial will be just do a rectangle, but you can also insert a bitmap or whatever you want). So insert a new layer and Drag a rectangle with these values:

Convert it to a movie clip and name it Drag_mc. Go again to the properties panel to give an instance name Drag_mc.

So now create a new layer, name it actions and write the bellow code:

Drag_mc._visible = false;

InMovie_mc.onRollOver = function() {

Mouse.hide();

startDrag(Drag_mc,true);

Drag_mc._visible = true;

}

InMovie_mc.onRollOut = function() {

Drag_mc._visible = false;

Mouse.show()

}

Press CTRL+Enter to see your movie.

You can also download the fla source from here

So what the code means:

Drag_mc._visible = false; - this is mean that our yellow rectangle it will hide

InMovie_mc.onRollOver = function() { - this is mean that when we go over from our movie clip (InMovie_mc) flash will do the bellow action:

Mouse.hide(); - our mouse will be hide

startDrag(Drag_mc,true); -We will drag our rectangle

Drag_mc._visible = true; -Our rectangle it will be visible from now

InMovie_mc.onRollOut = function() { - this is mean that when we go out from our movie clip the flash will do these actions:

Drag_mc._visible = false; - Our yellow rectangle will be invisible again

Mouse.show() - Our mouse will visible again


So it's a simple code to make your own cursor or to make many effects with your flash bg...


Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου