I have no answer to the problem, but maybe recreating the shuffled
array manually could help. I mean creating a new array and filling its
items with a for loop + one extra item.
This is not directly related but I experienced onece wrong sorting
when using sortOn() method. I do not trust completely on array class
methods.
g
Tuesday, November 24, 2009 (7:35:50 AM) Sajid Saiyed wrote:
> Hi,
> Not sure if this is what is causing my problem.
> I have an array called "__viewsArray"
> Then I created 3 new movieclips which I added to the Array.
> Like this:
> __viewsArray = new Array();
> __view1MC = new MovieClip();
> __view2MC = new MovieClip();
> __view3MC = new MovieClip();
> addChild(__view1MC);
> addChild(__view2MC);
> addChild(__view3MC);
> __viewsArray.push(__view1MC);
> __viewsArray.push(__view2MC);
> __viewsArray.push(__view3MC);
> Now, I create new instances of Loader and add them to the three viewMC's.
> .....
> myLoader = new Loader();
> myLoader.name = "MC";
> myLoader.load(fileRequest);
> ...
> ////// I am removing the code of the loader listener, but u can be
> sure that I am checking for the load event to complete here...
> ...
> __viewsArray[i].addChild(myLoader);
> .....
> So far so good.
> When I loop through the "__viewsArray", I can do the :
> __viewsArray[j].getChildByName("MC");
> no errors.
> Now, I decide to shuffle the array.
> So I did:
> var tempArray = __viewsArray.pop();
> __viewsArray.unshift(tempArray);
> Now when I loop through the array, I get a null object reference.
> Is it because I am shuffling the array or is it due to something else?
> Cant figure this one out :(
> Thanks for any help.
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders