Hi Mark, I think Alex could bring more on this initialization issue than myself since he's the person how designed it. Maybe he can help on that
El lun., 1 abr. 2019 a las 13:33, Kessler CTR Mark J (<[email protected]>) escribió: > I had a little time over this weekend to try to catch up on some > things. This is a follow up to that issue I was having about the reference > comparison. It was a timing issue on our part that we resolved by moving > up how quickly we store a reference. > > > Here's an example of what I mean. The "initComplete" event handler > that is inside the "MyClass" was being called before the > "addReferenceToList". The instance was getting to its "initComplete" > called faster and was attempting to call a method that uses its stored > reference from a list before the "myMethod" method could store the > reference. We are not talking about a lot of prep either. Interesting > problem to have; no invalidation or heavy lifting before its fully > completed. > > > > public function myMethod():void > { > var newInstance:MyClass = new MyClass(); > > ...do some prep for the new instance... > > addReferenceToList(newInstance); > > addElement(newInstance); > } > > > Changed to: > > > public function myMethod():void > { > var newInstance:MyClass = new MyClass(); > > //swapped > addReferenceToList(newInstance); > > ...do some prep for the new instance... > > addElement(newInstance); > } > > > -Mark K > > -- Carlos Rovira http://about.me/carlosrovira
