home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************
- ADOBE SYSTEMS INCORPORATED
- Copyright 2002 Adobe Systems Incorporated
- All Rights Reserved
-
- NOTICE: Adobe permits you to use, modify, and distribute this
- file in accordance with the terms of the Adobe license agreement
- accompanying it. If you have received this file from a source
- other than Adobe, then your use, modification, or distribution
- of it requires the prior written permission of Adobe.
- ***************************************************************/
- /***************************************************************
- Author: Ken Villines
- ***************************************************************/
-
- /***************************************************************
-
- This is an include file to be used with Scripting swf export.
-
- These functions make using the Color Object a little easier. The file
- should be included in the compositions onload handler. The code below
- shows how to include the file:
-
- #include "Include/swfColor.js"
-
-
- *********Function Definitions***************
-
-
- this.setColor(red, green, blue)
-
- red = 0-255
- green = 0-255
- blue = 0-255
-
- returns the value of the new color
-
-
- this.setTransColor(redA, redB, greenA, greenB, blueA, blueB, alphaA, alphaB)
-
- redA = 0-255
- redB = 0-255
- greenA = 0-255
- greenB = 0-255
- blueA = 0-255
- blueB = 0-255
- alphaA = 0-255
- alphaB = 0-255
-
- returns the value of the new Transform color
-
- this.getColor(colorToGet)
-
- colorToGet = takes a string ("red", "green", or "blue")
- returns the value of the color specified
-
-
- this.getHexColor()
-
- returns the Hex color value of the movie clip specified
-
-
- this.getTransColor(colorToGet)
-
- colorToGet = one of the 8 advanced color properties from setTransColor
- returns the color value of the property handed to the function
-
- ***************************************************************/
-
- /***************************************************************
- DO NOT EDIT BELOW THIS LINE
- ***************************************************************/
-
-
- MovieClip.prototype.setColor = function (red, green, blue)
- {
- var theValue = red*65536+green*256+blue;
-
- theNewColor = new Color(this)
-
- theNewColor.setRGB(theValue);
- }
-
-
-
- MovieClip.prototype.setTransColor = function(redA, redB, greenA, greenB, blueA, blueB, alphaA, alphaB)
- {
- transColorObj = new Object()
- transColorObj.ra = redA;
- transColorObj.rb = redB;
- transColorObj.ga = greenA;
- transColorObj.gb = greenB;
- transColorObj.ba = blueA;
- transColorObj.bb = blueB;
- transColorObj.aa = alphaA;
- transColorObj.ab = alphaB;
-
- theTransColor = new Color(this)
-
- theTransColor.setTransform(transColorObj);
- }
-
-
- MovieClip.prototype.getColor = function(colorToGet)
- {
-
- theNewColor = new Color(this)
-
- theColor = theNewColor.getRGB();
-
- if(colorToGet=="red")
- {
- redNum = (theColor>>16) & 0xFF;
- return redNum;
- }
- else if (colorToGet=="green")
- {
- greenNum = (theColor>>8) & 0xFF;
- return greenNum;
- }
- else if (colorToGet=="blue")
- {
- blueNum = theColor & 0xFF;
- return blueNum;
- }
- }
-
-
- MovieClip.prototype.getHexColor = function()
- {
-
- theNewColor = new Color(this)
-
- theColor = theNewColor.getRGB().toString(16);
-
- return theColor;
- }
-
-
- MovieClip.prototype.getTransColor = function(colorToGet)
- {
-
- theNewColor = new Color(this)
-
- theColor = theNewColor.getTransform();
-
- return theColor[colorToGet];
- }
-