AS3 Questions

  • Started
  • Last post
  • 2 Responses
  • duckseason

    I'm trying to make a slideshow pulling images from an XML file.

    The slideshow portion itself works fine. Then I got the idea to add thumbnails beneath it so the user can click and choose which picture he or she may want to see. The only thing is, only one of my thumbnails is showing up.

    I am using a for loop to bring in/place the images, yet it only seems like image 1 (out of 0-4) is showing up.

    I'm sure this is probably something stupid; however, I've been staring at the screen for a while, and nothing is jumping out at me. Granted I'm no AS3 wiz.

    Here is my code for the portion in question.

    http://pastebin.com/m19864ca8

    Any help would be much appreciated.

  • goygoygoy0

    try to create a new container for your loader in the thumbloaded listener. So, you'll have a new one at each iteration. For the moment what it does is overriding var thumbLoader = new Loader(); on each iteration, so it adds the last loaded thumb in the last thumbLoader created.

    have you tried
    var thumbs:Loader = Loader(evt.target.loader);
    evt.target..addChild(thumbs);

  • Pupsipu0

    this don't know AS3 bullshit has got to stop. You wouldn't understand what you're doing in AS2 or anywhere.

    http://pastebin.com/m62318e99

    You were changing the position of the clip you were adding things to, but adding things at the same place inside that clip, so they would be right on top of each other. You have to offset the things you add, not what they're being added to.

    And there is no evt.target.loader, evt.target is the loader. evt.target.content is the content it loaded.

    Now for more inevitable questions..