i did a slider component, and then added three instances of it (RGB) inside another color picker component im making. Now, if i place the the slider component on _root and for…in-loop through it’s properties/functions and trace them, all the properties and functions are traced. Inside the color picker component thought, when i do that same loop, only the properties are traced, which i think means the slider component instances aren’t initialized. I tried different values for the ‘order’ parameter of #initclip, but it still did not work :hair:
Does anyone know what’s causing this and how to fix it? =)
this.red, this.green and this.blue are instances inside the slider component places inside the the color picker component, and for some reason and i can access the slider’s getValue() method. If the slider is places on _root, outside the color picker, it works fine. . . =)
well basically i wanna be able to call the sliders’ methods through one of the color picker’s methods. so since this.red refers to the ‘red’ slider, i should be able to call red’s getValue through ‘this.red.getValue’, but it doesnt work
right but it will work (or at least should work) as long as you aren’t calling it from the constructor. The constructor is run before the contents of that clip (component) are loaded, meaning before the sliders are loaded meaning before their constructors are loaded and before anything is technically defined for them. This by the way is completely independant of initclip stuff. Thats just defining the class period and the initclip does this before frame 1 and before any clip/component, such as your color picker. The constructors are called for the clips themselves when actual clips load - and thats actually before they load and before their contents load. So the colpicker constructor will be called before any of the sliders are created (though their reference at this time exists) and their constructors are run. So, because of that, any of the sliders arent defined for the constructor and you wouldnt be able to use those methods until after they do load. Now that will be basically anytime after the constructor of the colpicker instance. If you need it right away, use an onLoad prototype which will be called after the constructor and after the sliders are defined and have run.
Otherwise, there’s probably some referencing issues somewhere gone screwy