0 Replies Latest reply on Oct 14, 2008 3:42 PM by ccrum

    convert mxml array to as3

      I've got the following array which uses a specail ListItemValueObject pacakage. The array is

      <mx:Array id="arr">
      <vo:ListItemValueObject label="One" isSelected="true" />
      <vo:ListItemValueObject label="Two" isSelected="true" />
      <vo:ListItemValueObject label="Three" isSelected="true" />
      <vo:ListItemValueObject label="Four" isSelected="true" />
      <vo:ListItemValueObject label="Five" isSelected="false" />
      <vo:ListItemValueObject label="Six" isSelected="false" />
      <vo:ListItemValueObject label="Seven" isSelected="false" />
      <vo:ListItemValueObject label="Eight" isSelected="false" />
      <vo:ListItemValueObject label="Nine" isSelected="false" />
      <vo:ListItemValueObject label="Ten" isSelected="false" />
      <vo:ListItemValueObject label="Eleven" isSelected="false" />
      <vo:ListItemValueObject label="Twelve" isSelected="false" />

      and the package is

      * http://blog.flexexamples.com/2008/01/27/using-a-checkbox-control-as-a-list-item-renderer-i n-flex/
      package {
      public class ListItemValueObject {
      public var label:String;

      public var isSelected:Boolean;

      public function ListItemValueObject() {

      this is taken from a list with check box example online.

      What I want to do is convert that array to an AS3 array. I've tried this:

      private var arr:Array =
      [{vo:"ListItemValueObject" label="Routers" isSelected="true"},
      {vo:"ListItemValueObject" label="APs" isSelected="true"},
      {vo:"ListItemValueObject" label="Customers" isSelected="true"},
      {vo:"ListItemValueObject" label="Links" isSelected="true"}];

      but it doesn't work....any ideas?