P
ROTOTYPE
I'm Not Only The Prototype, I'm Also A Member.
home
▪
stats
▪
search
▪
linkback
▪
about
▪
FAQ
| user: guest,
login
,
register
Movieclip
:
emboss() - Embosses a movieclip at given height & angle (best with images)
author:
senocular
[+]
,
Submitted: 09.18.02 7p
• Last Edit: 06.26.03 7a
MovieClip.prototype.emboss = function(height, angle, depth){ if (height){ // if first argument is not zero if (arguments.length == 2) depth = 1; // assign optional depth value if not given this.duplicateMovieClip(this._name +"emboss_mc",depth); // create duplicate var dup = this._parent[this._name + "emboss_mc"]; // assign temporary variable to reference duplicate var toRads = 180/Math.PI; // used to convert decimal values to radians dup._x -= Math.cos(angle*toRads)*height; // determine dup offset from angle dup._y -= Math.sin(angle*toRads)*height; var col = new Color(dup); // create temporary color object for dup col.setTransform({ra:-100, rb:255, ga:-100, gb:255, ba:-100, bb:255, aa:50}); // reverse colors and set alpha to 50% }else{ // if height is zero this._parent[this._name + "emboss_mc"].removeMovieClip(); // remove the emboss } } /***************** EXAMPLE *****************\ // generic button: // when pressed, myClip in _root gets embossed // with a height of 2 at 45 degrees on(press){ _root.myClip.emboss(2,45) } // when released, the emboss is removed on(release){ _root.myClip.emboss(0) } \*******************************************/
usage
[big]Movieclip [b]EMBOSS[/b]: Embosses a movieclip using a slightly offset reversed value duplicate of itself at 50% alpha as an overlay[/big] [b]Arguments[/b]: - [i]height[/i]: distance of offset or emboss "height" in pixels - [i]angle[/i]: "angle" of emboss or direction to move emboss by factor of height - [i]depth[/i]: (optional) used to specify depth of duplicated clip if needed. Default is 1 [b]Warnings[/b]: - using this in an onClipEvent(load) event will cause flash to crash as each duplicate will attempt to give itself its own emboss. Also be aware that any other code on the specified clip will similarly be carried over to the duplicate used to make the emboss.
Add Comment
[+]
›opyleft 2001-2013. Layer51 is: Jaime Prado.
@
buy wow gold
abendkleider online
cocktail dresses uk
woolrich outlet
clarisonic pro
long prom dresses