-
scale image to fit movieclip
Hi,
I have a movieclip that I'm loading an image into dynamically. I'm using Chris' picView example:
Code:
//Thanks for the help from Chris Seahorn and gotoandlearn.com
var x = new XML();
x.ignoreWhite = true;
var urls = new Array();
var captions = new Array();
var whoIson;
x.onLoad = function() {
var photos = this.firstChild.childNodes;
for (i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIson = 0;
}
x.load ("picview.xml");
What I want to do is somehow thru code, scale my images to fit the movieclip. Currently, I have to size my images first manually to the size of the movie clip. That will be a bit tedius for my client. I just want him to be able to download his images in the specified folder and have flash resize and load into the movieclip. How do I acheive that task?
-
You will have to monitor the loading of the image and scale it once it has been initialized. Width and height properties of the image are not ready before that.
-
Are there any tutorials on this topic? I'm not that skilled yet. I also want some transition effects to the gallery.
-
There is another approach that might save you some work...KoolMoves has slide show and media player components, which can scale images. And if you need to use an external play list, check out:
http://board.flashkit.com/board/show...rnal+play+list
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|