Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Lack of width/height info on COMPLETED image download (AS 3)

    Hi All,

    I've had a really strange and annoying problem with an image loaded via a Loader() in an XML-driven gallery. (The scenario actually loads in multiple images, but the following problem occurs on the first image, so for simplicity sake I'll just keep it to 'a' image).

    This isn't the EXACT code, but it's very similar...

    Code:
    var thumbloader:Loader = new Loader();
    thumbloader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbDownloadComplete);
    thumbloader.load(new URLRequest("http://www.pathToImage..."));
    
    function thumbDownloadComplete(e:Event) {
     trace(e.target); // [Object Loader]
     trace(e.CurrentTarget); // [Object Loader]
     x_position = e.target.content.width // this is where the code stops. and x_positon is declared globally.
     .
     .
     .
    }
    This is a bit of code that worked perfectly yesterday, and had been for 2+ weeks, so I can only assume whatever is causing my problem is something I've done by accident.

    The most frustrating part is, when I publish my swf it works! But once I look at my swf via a browser it fails, and I'm positive it's not a crossdomain thing (loading image from another domain). So I effectively have no errors being reported to me via Flash. (Argh!)

    Any ideas? I know it's not much info code-wise but there isn't really much more complicated in my code that I've left out.

    I don't understand how the COMPLETE function can be called but then fail on *.content.width.

    Thanks in advance!
    Last edited by hardnrg; 09-11-2008 at 01:43 AM.

  • #2
    New Coder
    Join Date
    Jul 2007
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I've resolved this issue... to a degree.

    I reverted to an older version of my fla/as files, and slowly copy/pasted all the new code into it. It's working now, but I must admit I don't know why, considering the code is exactly the same as the version giving me problems.

    Perhaps my .fla was generating a corrupted swf.

    Big fat waste of time, but atleast it's over =)


  •  

    Posting Permissions

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