• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 601
  • Last Modified:

Flash CS3 AS2 load external jpg

I am migrating from AS2 to AS3. There's a big learning curve.
Anyhow, I can't figure out how to load an external .jpg. I've searched the forum and I've pulled the code below. I have 2 empty movieclips on stage and want to load one image in each.  

movieclip names: gallery_mc /  archive_mc

The error said to load a package. I had one in there and still couldn't get it to work.
stop();
gallery_mc.loader = new Loader();
gallery_mc.loader.load("gallery/gallery-image.jpg");
gallery_mc.loader.addEventListener(Event.COMPLETE, onLoadComplete);
 
public function onLoadComplete(event:Event):void {
 var thumbnail:Sprite = new Sprite();
 thumbnail.addChild(this.loader);
}

Open in new window

0
crittle1
Asked:
crittle1
1 Solution
 
crittle1Author Commented:
nevermind....
stop();
var pictLdr:Loader = new Loader();
var pictURL:String = "gallery/gallery-image.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
this.addChild(pictLdr);

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now