Skip to main content
Known Participant
June 6, 2006
Question

resizing picture border to an externally loaded picture

  • June 6, 2006
  • 1 reply
  • 239 views
i'm working on a photo gallery.

1) What script do i need to make a movieclip load an external picture once a specific buttons is clicked?
-also, I'd like to keep the picture to a maximum of 400 pixels wide and 300 pixels high-without distorting the proportions.

2) What script do i need to make a graphic serving as a border resize to the size of the loaded picture?

Let me know if that isn't clear enough - Thanks.
This topic has been closed for replies.

1 reply

June 6, 2006
Hmmm.... questions are fairly general. I'll give you areas of ActionScript to look into. You'll need to learn about MovieClip/Button events, specifically onPress: http://www.quip.net/blog/2006/flash/event-handlers-listeners

Also, MovieClip.loadMovie: http://www.quip.net/blog/2006/flash/how-to-tell-when-external-swf-loaded (using swf is same idea as using image)

To make it resize, once it has loaded, you can do some thing like:

if(container._width>400 && container._width>=container._height){
container._width = 400;
container._yscale = container._xscale;
}
if(container._height>300 && container._height>container._width){
container._height= 300;
container._xscale = container._yscale;
}

For question 2, you can set the _width and _height of the border (should be movieclip) to a little bit more than your container clip.
Known Participant
June 6, 2006
I'll see what I can do. Thank you very much for your help.