Flash CS3 AS2  load external jpg

Posted on 2009-04-22
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.

gallery_mc.loader = new Loader();


gallery_mc.loader.addEventListener(Event.COMPLETE, onLoadComplete);


public function onLoadComplete(event:Event):void {

 var thumbnail:Sprite = new Sprite();



Open in new window

Question by:crittle1
    1 Comment
    LVL 3

    Accepted Solution

    var pictLdr:Loader = new Loader();
    var pictURL:String = "gallery/gallery-image.jpg"
    var pictURLReq:URLRequest = new URLRequest(pictURL);

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
    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…
    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.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now