A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: preloading multiple large images challenge

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    1

    preloading multiple large images challenge

    Hey there,

    This is the best example of what I'm trying to achieve:

    http://www.three60.com.au/

    This site loads in all of the large images behind the scenes, so once you click through a project, the images appear immediately.

    I have a rough concept of how do to this, but I am very new to as3 so I was curious as to how others would approach this?

    Thanks in advance.

    Ben.

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I recently made use of this tutorial for loading a list of images.

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    79
    Hello
    In your Main-constructor, call the function bellow.

    PHP Code:
    public function loadImages()
        {
            for (var 
    0_nrOfImagesi++)
            {
                var 
    loader:Loader = new Loader()
                
    loader.load(new URLRequest("images/image" ".jpg"));
                
    loader.contentLoaderInfo.addEventListener(Event.COMPLETEimageLoaded);
            }
        }
        
        private function 
    imageLoaded(e:Event):void 
        
    {
            
    _loadedImages.push(e.target.content);
        } 
    Before this you have to declare _nrOfImages and _loadedImages.
    These functions will load your images and store them in an array. You can then reach them with _loadedImages[i].
    The order your images are stored in your array will vary. So you have to solve that part yourself.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center