Sign In
Password Recovery Register

frameOver MovieClip prototype

No description :/

 1 #include "lmc_tween.as"
 2 MovieClip.prototype.frameOver = function(grosor,color) {
 3     var over:MovieClip = this.createEmptyMovieClip("over", 1);
 4     var l:MovieClip = over.createEmptyMovieClip("l", 1);
 5     var escalax = (this._width+grosor*2)/100*grosor;
 6     var escalay = this._height/100*grosor*2;
 7     var w:Number = this._width;
 8     var h:Number = this._height;
 9     l.lineStyle(0, 0x000000, 0);
10     l.beginFill(color, 100);
11     l.moveTo(0, -h/2);
12     l.lineTo(grosor, -h/2);
13     l.lineTo(grosor, h/2);
14     l.lineTo(0, h/2);
15     l.lineTo(0, -h/2);
16     l.endFill();
17     l._y = h/2;
18     l._xscale = .1;
19     var t:MovieClip = l.duplicateMovieClip("t", 2, {_x:w/2, _y:0, _rotation:90});
20     var r:MovieClip = l.duplicateMovieClip("r", 3, {_x:w, _y:h/2, _rotation:180});
21     var b:MovieClip = l.duplicateMovieClip("b", 4, {_x:w/2, _y:h, _rotation:270});
22     t._yscale = b._yscale=w/h*100;
23     this.onRollOver = function() {
24         l.tween("_xscale", 100, 1);
25         t.tween("_xscale", 100, 1);
26         r.tween("_xscale", 100, 1);
27         b.tween("_xscale", 100, 1);
28     };
29     this.onRollOut = function() {
30         l.tween("_xscale", .1, .5);
31         t.tween("_xscale", .1, .5);
32         r.tween("_xscale", .1, .5);
33         b.tween("_xscale", .1, .5);
34     };
35 };
36 
37 //Uso:
38 obj_mc.frameOver(15,0x666666);

Comments

Login or Register to comment.


Embed Me!

Feel free to adjust iframe width and height according to your needs.

<iframe width="800px" 
        src="http://www.emoticode.net/embed/actionscript/frameover-movieclip-prototype.html" 
        height="400px" 
        frameborder="0"> 
</iframe>

Here's how it will look like.