John Giotta wrote:
> I've started my own framework and two of the first UI components I've
> created are a ComboBox and List.
> 
> A List is actually nested inside the ComboBox.
> 
> However, when I compile a movie with a List and a ComboBox on the
> stage they are some how sharing information.
> 
> Has anyone experienced this? Its driving me crazy!

My best guess is that you've somehow got your dataProvider reference 
scoped to the class prototype rather than the instance.  Although the 
reference isn't truly static, it behaves as such so that all instances 
will share the same data.

Most typically, this is caused by incorrectly assigning a non-simple 
value to a property in the class definition (e.g. everything other than 
null, undefined, boolean, string and number).  A prime example of this 
is attempting to initialize an array in the class definition.

Nearly every ECMAScript or Actionscript developer I've met has done this 
once or twice by accident, for example:

<code>

class MyBadClass {

     public var foo:Number = 3;           // Okay
     public var bar:Array = new Array();  // Bad!

     public function MyClass() {
         // Constructor
     }

     // More methods

}


// Instead, you should do this:

class MyGoodClass {

     public var foo:Number = 3;           // Okay
     public var bar:Array;                // Initialize Later!

     public function MyClass() {
         // Constructor

         // Initialize the array here, not in the definition!
         bar = new Array();
     }

     // More methods

}
</code>

For an extended discussion on why this happens and what's actually going 
on behind the scenes, see this discussion from the Flashcoders list last 
month:

http://chattyfig.figleaf.com/pipermail/flashcoders/2005-December/thread.html#156816


Jim

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to