Sign In
Password Recovery Register

frameOver MovieClip prototype

No description :/

#include "lmc_tween.as"
MovieClip.prototype.frameOver = function(grosor,color) {
    var over:MovieClip = this.createEmptyMovieClip("over", 1);
    var l:MovieClip = over.createEmptyMovieClip("l", 1);
    var escalax = (this._width+grosor*2)/100*grosor;
    var escalay = this._height/100*grosor*2;
    var w:Number = this._width;
    var h:Number = this._height;
    l.lineStyle(0, 0x000000, 0);
    l.beginFill(color, 100);
    l.moveTo(0, -h/2);
    l.lineTo(grosor, -h/2);
    l.lineTo(grosor, h/2);
    l.lineTo(0, h/2);
    l.lineTo(0, -h/2);
    l.endFill();
    l._y = h/2;
    l._xscale = .1;
    var t:MovieClip = l.duplicateMovieClip("t", 2, {_x:w/2, _y:0, _rotation:90});
    var r:MovieClip = l.duplicateMovieClip("r", 3, {_x:w, _y:h/2, _rotation:180});
    var b:MovieClip = l.duplicateMovieClip("b", 4, {_x:w/2, _y:h, _rotation:270});
    t._yscale = b._yscale=w/h*100;
    this.onRollOver = function() {
        l.tween("_xscale", 100, 1);
        t.tween("_xscale", 100, 1);
        r.tween("_xscale", 100, 1);
        b.tween("_xscale", 100, 1);
    };
    this.onRollOut = function() {
        l.tween("_xscale", .1, .5);
        t.tween("_xscale", .1, .5);
        r.tween("_xscale", .1, .5);
        b.tween("_xscale", .1, .5);
    };
};

//Uso:
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.