A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: re-align images on the fly

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    194

    Smile

    I've got a banner that is 5 images wide, my client wants to beable to change the images still using 5 images, but the widths may change. For example, the space is 600 px wide (the height is constant) so the images might be 120,200,85,155,40 then he wants to load 5 new images dynamically so now they are 80,120,150,50,200, what I need to happen is when he replaces the images (knowing they have to be 600 pixels total length) that the edges re-align themselves. Any ideas? Thanks

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    the image should load to the same size of the mc it's being loaded to. if you're not loading to movieclip, then you should and whatever size the mc is, that's the size the picture will be.

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    194
    it would be an mc, but if I don't want the iages to stretch and the width sizes may vary I need them to butt up against each other no matter what the sizes are as long as they = 600 pixels. The client will be using a form to uplaod the 5 images to the server and they'll be numbered 1-5 and they must butt up to each other so if image 1 is 85 pixels and image 2 is 100 pixels and they butt up, then next time he loads image one and it's 120 pixels and image 2 is 60 pixels they still need to butt up properly. Make sense?

  4. #4
    Senior Member
    Join Date
    Mar 2002
    Posts
    194
    **Bump** :-)

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    194
    anyone please?? :-/

  6. #6
    Member
    Join Date
    Jan 2001
    Posts
    49
    //place into 1st keyframe

    for(i=0; i<5; i++){
    _root.createEmptyMovieClip("image" add i, i+1);

    actual=_root["image" add i];

    loadMovie("image" add i, actual);
    var offset+=actual._width;

    if(i!=0){
    actual._x=offset;
    }
    }

    haven't tested it, but it should work


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