-
Loading jpg form external site, not working on server
I'm trying to load a jpg from youtube.com. I load if from my computer, it works.. load it online, doesn't. And it doesn't give me any errors or anything. The completeListener is not working! Is there a problem with flash loading from other domains or what?.. If I test it, it shows in Safari's activity that the jpg was loaded, but it won't display it.
Here's my code:
Code:
var iconLoader:Loader;
function loadThumb(){
iconLoader = new Loader();
iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completePhotoListener);
iconLoader.load(new URLRequest("http://img.youtube.com/vi/8M69nCOJnuk/1.jpg"));
}
function completePhotoListener(e){
iconLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completePhotoListener);
var _image:Bitmap = Bitmap(e.target.content);
container.addChild(_image);
}
loadThumb();
I tried doing error handling, but there's no errors! what in the world!
-
Senior Member
Where do you have addChild(iconLoader); ? You need to add that or it won't work.
- The right of the People to create Flash movies shall not be infringed. -
-
I'm using this:
var _image:Bitmap = Bitmap(e.target.content);
container.addChild(_image);
The weird thing is, it works on my computer, but not on the server, even though Safari shows the photo loaded. Also, when i use event listeners and have them output on a textfield online, it appears the complete listener isn't doing anything.
-
Senior Member
You need to add the Loader object or it won't work.
- The right of the People to create Flash movies shall not be infringed. -
-
within the complete listener, or before?... I'll try, but it doesn't even seem to use the complete listener..
-
ahh, you are amazing! it worked!...
-
why did that work on my comp and not online then?
-
Senior Member
Originally Posted by brentW505
why did that work on my comp and not online then?
Don't know. However, just follow the standard protocol sometimes and it will work.
- The right of the People to create Flash movies shall not be infringed. -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|