1

I have a flex application that dynamically loads swfs and I want to to use a set of color pickers in an external component within the application to determine a color array in the loaded swf.

I figured that I can use a new array of the colorPickers, i.e.

public var colors:Array  = new Array [ cp01.selectedColor, cp02.selectedColor, cp03.selectedColor, cp04.selectedColor, cp05.selectedColor]

Is it possible for the swf to read the Array if it's set up like that? If so what would I put into the swf to get it? If not what do I need to do?

1 Answers1

0

you can create an array of pickers and use it as follows:

    private var pickers:Array  = new Array [ cp01, cp02, cp03, cp04, cp05];
    public function getColorByPickerNumber(n:int):int {
        return pickers[n] ? pickers[n]['selectedColor'] : 0;
    }

you can also use binding

www0z0k
  • 4,444
  • 3
  • 27
  • 32
  • How do I access the variable from the swf? For instsance if I currently have the array as `var desColors:Array = [0x66CCFF,0x663300,0x996600,0xCCFFFF,0x0099FF]` how would I define the cp1CurrentColor. I tried replacing the colors within the brackets with with the cp1CurrentColor variable and that did nothing. – user1001951 Oct 20 '11 at 19:03