|
-
[F8] ColorTransform only works for one instance? [AS2.0]
Hey everyone. I have a site which I want people to be able to change the colour scheme of. I have 2 questions. One is this: I know how to use the ColorTransform code but this only works for solid colours. What's the best way to remain the gradient? Can I just make the gradient grey and then tint it with AS? Also, I have a code to change the background colour. This works. Now I added a second line which targets the text MC. This is fine since the text only needs to be a solid colour. The thing is, the bg changes, but the text doesn't...Anyone care to help, please? Code:
Code:
import flash.geom.ColorTransform;
import flash.geom.Transform;
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(_root.background1.background2);
var trans2:Transform = new Transform(_root.content.scrollbar_cv.cv_text.cv_text_inside.cv_text_tint);
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
dblue_btn.onRelease = function() {
colorTrans.rgb = 0x5253CF;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
lblue_btn.onRelease = function() {
colorTrans.rgb = 0x76B6C5;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
green_btn.onRelease = function() {
colorTrans.rgb = 0x6DF94A;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
yellow_btn.onRelease = function() {
colorTrans.rgb = 0xEDFF44;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
orange_btn.onRelease = function() {
colorTrans.rgb = 0xFFAA2B;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
red_btn.onRelease = function() {
colorTrans.rgb = 0xD13F3F;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
pink_btn.onRelease = function() {
colorTrans.rgb = 0xFB95FB;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
purple_btn.onRelease = function() {
colorTrans.rgb = 0xA83E93;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
white_btn.onRelease = function() {
colorTrans.rgb = 0xFFFFFF;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
grey_btn.onRelease = function() {
colorTrans.rgb = 0x777777;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
black_btn.onRelease = function() {
colorTrans.rgb = 0x000000;
trans.colorTransform = colorTrans;
trans2.colorTransform = colorTrans;
};
~Senshi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|