Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2008, 06:54 AM   PM User | #1
hardnrg
New Coder

 
Join Date: Jul 2007
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
hardnrg is an unknown quantity at this point
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..
hardnrg is offline   Reply With Quote
Old 09-11-2008, 01:42 AM   PM User | #2
hardnrg
New Coder

 
Join Date: Jul 2007
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
hardnrg is an unknown quantity at this point
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 =)
hardnrg is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26 PM.


Advertisement
Log in to turn off these ads.