Skip to main content
SuperGibaLogan
Known Participant
January 21, 2024
Question

(smartfoxserver pro, as2, flash 8) how do i make a choose color system in avatarChat.fla?

  • January 21, 2024
  • 1 reply
  • 229 views

hi, i want to add a choose color system so that the player can change it's avatars color (and when the player doesent want to choose the color, it will still select a random color.)

 

so, how do i do it? i want to make the choose color system in the "connect" frame, right here:

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
January 21, 2024

are you trying to use as2 to do this?

SuperGibaLogan
Known Participant
January 21, 2024

yes

SGL
kglad
Community Expert
Community Expert
January 21, 2024

you can use colorF to change an object's color (r,g,b from 0 to 255).

 

import flash.geom.ColorTransform;
import flash.geom.Transform;

 

 

function colorF(mc,r,g,b){
var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(mc);
colorTrans.blueMultiplier = 0;
colorTrans.greenMultiplier = 0;
colorTrans.redMultiplier = 0;
colorTrans.redOffset = r;
colorTrans.greenOffset = g;
colorTrans.blueOffset = b
trans.colorTransform = colorTrans;
}