I am trying to get a border created dynamically around images that I load in AS3. I have the images showing up fine.
- I have a folder with images
- I have a movie clip which is a graphic that I imported. I want this graphic to be the border for the top and bottom of any image, regardless of image dimensions.
- I load the image and display it on the stage using:
function showImage()
{
var container:Sprite = new Sprite();
var pict:Loader = new Loader();
var [url:URLRequest](http://www.kirupa.com/forum/URLRequest) = new URLRequest("b4sm.jpg");
pict.load(url);
container.addChild(pict);
container.x = mc_photo.x;
container.y = mc_photo.y;
stage.addChild(container);
}
showImage();
mc_photo is a blank movieclip i use as a placeholder to align things.
Then I want to load my custom movieclip MyBorder and align it to the top left corner of the loaded image, and then another instance of MyBorder and align it to the bottom left corner of the loaded image. Then I need to scale the width of MyBorder(both instances) to be the width of the loaded image.
The problem I am having is when I trace the height/width of the loaded image, the container, or anything else I try to load the image into it comes back 0. Can anyone offer a solution for this?