heres my problem.

If I try to modify this app so Carousel is default in Viewstack (move to top)...

http://www.adobe.com/devnet/flex/samples/photo_explorer/

Then the Carousel component calls a resize="carousel.reset()"

event on app load which throws an error 1/2 the time referencing null object...

the resize events fits the images on the screen...  how can I load this  
carousel.reset event so that it waits for viewstack to build... or do I set the 
creationPolicy different than it is .. 'queded'

Its a problem.

                public function reset():void
                {
                        var selected:int = gallery.selected;
                        var appWidth:int = Application.application.width;
                        var compHeight:int = 
(Application.application.height)*.90;

                        picDimension = new Array(9);
                        picPos = new Array(9);

                        picDimension[0] = appWidth*.05;
                        picDimension[1] = appWidth*.05;
                        picDimension[2] = appWidth*.10;
                        picDimension[3] = appWidth*.15;
                        picDimension[4] = appWidth*.7;
                        picDimension[5] = appWidth*.15;
                        picDimension[6] = appWidth*.10;
                        picDimension[7] = appWidth*.05;
                        picDimension[8] = appWidth*.05;

                        picPos[0] = new Point(appWidth*(-.075) - 109, 
(compHeight - picDimension[0])/2);
                        picPos[1] = new Point(appWidth*(-.025) - 101, 
(compHeight - picDimension[1])/2);
                        picPos[2] = new Point(appWidth*.025 - 93, (compHeight - 
picDimension[2])/2);
                        picPos[3] = new Point(appWidth*.125 - 85, (compHeight - 
picDimension[3])/2);
                        picPos[4] = new Point(appWidth*.275 - 77 , (compHeight 
- picDimension[4])/2);
                        picPos[5] = new Point(appWidth*.675 + 112, (compHeight 
- picDimension[5])/2);
                        picPos[6] = new Point(appWidth*.825 + 120, (compHeight 
- picDimension[6])/2);
                        picPos[7] = new Point(appWidth - appWidth*(.025) + 80, 
(compHeight - picDimension[7])/2);
                        picPos[8] = new Point(appWidth + appWidth*(.025) + 88, 
(compHeight - picDimension[8])/2);

                        for (var i:int=0; i < 9; i++)
                        {
                            var image:CarouselImage = getChildAt(i) as 
CarouselImage;
                            var pos:int = selected + i - 4;

                            if (pos >= 0 && pos < gallery.photos.length)
                            {
                                image.width = picDimension[i];
                                image.height = picDimension[i];
                                image.x = picPos[i].x;
                                image.y = picPos[i].y;
                                image.source = "galleries/" + 
gallery.photos.getItemAt(pos).source;
                                image.visible = true;
                                }
                                else
                                {
                                    image.visible = false;
                                }
                        }
                }


Reply via email to