A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: scale image to fit movieclip

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146

    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?

  2. #2
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    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.

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    146
    Are there any tutorials on this topic? I'm not that skilled yet. I also want some transition effects to the gallery.

  4. #4
    Member
    Join Date
    Sep 2010
    Posts
    32
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center