0

Hi,

I have a movie clip called dsp_albumcover (Already created and on the stage, instance name is dsp_albumcover)

I also have a variable with a .jpg file (Can be changed to any other though) defined as

var albumimg:String = '/albumcover.jpg';

How do I load this in to dsp_albumcover?
dsp_albumcover is 128 pixles high x wide and the image is the same dimentions.

Thanx,
Sam

P.S. Before anyone says that I should just include it in my libary, /albumcover.jpg?ID={ID} is the actual image that would be called and would be retrieved from a DB

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by samarudge
0

I have been following tutorials all day and none of them work, I just thought that an WEB DESIGN FORUM might be able to help, I didn't see the point in saying "This has taken me the last 8 hours to do but it doesnt work

Some Code

"

2

As Imthwee said, please try to find tutorials too.

Anyway Please follow this to get your work done:

1) Just create an empty movie clip with a instance name (emptyMC)
2) Place your jpeg file in the same location

use this code in timeline:

const IMAGE_URL:String = "followme.png";

var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, ldr_complete);
ldr.load(new URLRequest(IMAGE_URL));



function ldr_complete(evt:Event):void 
{
	emptyMC.addChild(ldr);
}

Hope this helps!

Note: Don't worry about the size of the movie clip, Just an empty movie clip thats it!

Votes + Comments
Although it's a question that could be answered with any actionscript 3.0 resourse, still...props to you.
Soved a problem I had been struggeling with for days :D
0

As Imthwee said, please try to find tutorials too.

Anyway Please follow this to get your work done:

1) Just create an empty movie clip with a instance name (emptyMC)
2) Place your jpeg file in the same location

use this code in timeline:

const IMAGE_URL:String = "followme.png";

var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, ldr_complete);
ldr.load(new URLRequest(IMAGE_URL));



function ldr_complete(evt:Event):void 
{
	emptyMC.addChild(ldr);
}

Hope this helps!

Note: Don't worry about the size of the movie clip, Just an empty movie clip thats it!

Thank you so much, I would buy you a virtual pint but I don't think that is possible =P

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.