A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] [MX04] getting size of external pic?

  1. #1
    Ronze Ronze's Avatar
    Join Date
    Oct 2002
    Location
    Copenhagen, Denmark
    Posts
    185

    [RESOLVED] [MX04] getting size of external pic?

    Hey

    In a loop, I am creating a bunch of empty movieclips and loading jpegs into them. I want to line them up side by side, but the problem is, that some of the pictures is vertical and some horisontal... So I can't just give a specific number to _x the movieclips. Is there some way I can detect how wide my loaded pictures are, or what can I do?

    - Rune
    --- Ronze ---

  2. #2
    Junior Member
    Join Date
    Jun 2006
    Location
    Earth
    Posts
    6
    Consider u r loading the images into movieclip img_holder then u can get the width and height of the images from xWidth & yHeight. Or u can change the width and height to a limit here and u can give the _x directly in the loop.

    code:

    this.onEnterFrame = function()
    {
    if (img_holder._width>0)
    {
    xWidth = img_holder._width;
    yHeight = img_holder._height;
    delete this.onEnterFrame;
    }
    }



    Regards,
    Mike.

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