?
Solved

Flash CS3 AS2  load external jpg

Posted on 2009-04-22
1
Medium Priority
?
597 Views
Last Modified: 2013-11-11
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
Comment
Question by:crittle1
1 Comment
 
LVL 3

Accepted Solution

by:
crittle1 earned 0 total points
ID: 24211401
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question