A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Loader Object instances

  1. #1
    Senior Member
    Join Date
    Feb 2000
    Posts
    226

    Loader Object instances

    Hi,

    It has been a while since I worked with flash and I am picking up AS 3.0 now.

    I have this project that should load jpegs from a server. I found that properties like x,y position etc are accesible through the loader object and that you can add a click event to it. Let's say I want to display a list of jpegs in thumbnail format, when the user clicks on it, it should show a full size version.

    I am not sure what the best approach is to achieve this as I assume that when using the same loader object to download all images the click event will reference the last downloaded image, correct?

    Should I create a seperate class for all of this and load all images by instantiating this class for each image or is there an easier approach?

    Thanks,
    Raoul

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If you re-use the same loader, then you will not be able to load two things at once. You will also need to put the loaded images in another container so that you can detect the clicks (Bitmap does not dispatch click events).

    You can create a new Loader for each thumbnail, which will let you load them all without waiting for the previous one to finish (this might make spacing them properly more difficult), and will let you add the click listener to the Loaders.

    You may also want to look into BulkLoader or QueueLoader.

    However you do it, you will also need to associate the url for the full version with each thumbnail.

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    226
    Thanks 5TonsOfFlax, I decided to use a seperate class for this, it works well.

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