// Lookup the necessary SDT class (note: this only needs to be done once, e.g. during mod init)
var CharacterElementHelper:Class = main.eDOM.getDefinition("obj.CharacterElementHelper") as Class;
...
// Identify the target object which will be involved in the special ARGB activity
var target = TODO; // you'll need to choose the appropriate object
// Identify the mod category whose ARGB sliders will be applied to the target
var elementHelperName:String = "braControl"; // or "topControl", "pantiesControl", "bottomsControl", etc
var elementHelper = (g.characterControl[elementHelperName] as CharacterElementHelper);
// Attach the proxy
if (elementHelper != null) {
// Proxy the SetFill function so that we can react to any ARGB slider activity in the UI
var setFill = (lProxy as Class).createProxy(elementHelper, "setFill");
setFill.addPre(setFill_Special_Wrapper(target, elementHelper), false);
// Perform an immediate "reaction" to ensure that the target object has the correct color-fill
setFill_Special(target, elementHelper, elementHelper.rgb1, "rgbFill");
setFill_Special(target, elementHelper, elementHelper.rgb2, "rgbFill2");
}
...
function setFill_Special(target:Object, elementHelper:Object, argb:Object, targetName:String = "rgbFill") : void {
try {
var argbTransform:ColorTransform = new ColorTransform(1, 1, 1, argb.a, argb.r, argb.g, argb.b);
elementHelper.tryToSetFillChildren(target, targetName, argbTransform);
} catch (myError:Error) { }
}
function setFill_Special_Wrapper(target:Object, elementHelper:Object) {
return function(argb:Object, targetName:String = "rgbFill"):void {
setFill_Special(target, elementHelper, argb, targetName);
}
}