5 Replies Latest reply on Sep 20, 2007 1:30 PM by JoeADSK

    Interesting Problem/Puzzle

    JoeADSK Level 1
      I am bringing together several dashboards into one, and allowing the user to select which dashboard they would like to view.
      Because each dashboard uses its own custom remote object, i need to tell the app's components which Remote object to use when loading data into charts.
      Currently each component declares an ro component like:
      [Bindable]
      public var ro:ROComponent = new ROComponent();

      ...and then runs the methods needed, using events to shuttle data around.

      My original solution was to have an if statement that, depending on what number was selected, would
      create an ro of the desired ROComponent type. like this.....

      if( RO_SELECT == 1)
      {
      [Bindable]
      public var ro:Proj1ROComponent = new Proj1ROComponent();
      }
      else
      {
      [Bindable]
      public var ro:Proj2ROComponent = new Proj2ROComponent();
      }

      However that pitched an error... which is pretty obvious to me why.
      If i could declare a pointer, all would be good, but i can't, and ro is called EVERYWHERE in my components... what do i do?!

      Thanks,
      Joe