import flash.utils.getDefinitionByName;Then add the following function:
//Parameters:
mc - The movieclip to replace
type - The name of the class you want to replace with
keepDimensions - Resize from default dimensions to the dimensions of mc (optional, false by default)
public function replaceWithValveComponent(mc:MovieClip, type:String, keepDimensions:Boolean = false) : MovieClip {
var parent = mc.parent;
var oldx = mc.x;
var oldy = mc.y;
var oldwidth = mc.width;
var oldheight = mc.height;
var newObjectClass = getDefinitionByName(type);
var newObject = new newObjectClass();
newObject.x = oldx;
newObject.y = oldy;
if (keepDimensions) {
newObject.width = oldwidth;
newObject.height = oldheight;
}
parent.removeChild(mc);
parent.addChild(newObject);
return newObject;
}
Once you replaced an element with a valve component you can just manipulate it like any other movieclip, setting properties, adding eventlisteners
(make sure you have the right imports!). These elements have all common properties (x, y, width, height, visible, etc...).
import scaleform.clik.events.*; var slider = replaceWithValveComponent(oldMovieClip, "Slider_New"); slider.maximum = 3000; slider.addEventListener(SliderEvent.VALUE_CHANGE, handler);
Use movieclips with their origin in the top-left corner (not the center!) to position this component! Setting a label will make that label appear to the right of the checkbox.
Properties:label
enabled
Add items like this: combobox.dataprovider = ["Item1", "Item2", "etc"];
Properties:Just a movieclip containing a background image.
Properties:Just a movieclip containing a background image.
Properties:[WIP] component_library
For gray button use ButtonThinSecondary
[WIP] component_library
Properties:[WIP] component_library
Can be closed and dragged around.
[WIP] component_library
Properties:[WIP] component_library
Properties:[WIP] overlay
Properties:[WIP] overlay
Properties:direction can be ScrollBarDirection.HORIZONTAL or ScrollBarDirection.VERTICAL (from fl.controls.ScrollBarDirection)
scrollTarget can be an object like a TextField