A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loadMovie() / jpg / adjusting MC size

  1. #1
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886

    loadMovie() / jpg / adjusting MC size

    hey folks,

    i'm making a flash photo gallery, displaying 2 dynamically loaded jpgs (via loadMovie(filename+".jpg")) at a time next to each other.
    i'm loading these jpgs into 2 different MCs created by attachMovie();
    so far so good...

    problem is: jpgs have different sizes which i do not know in advance. i can't seem to find out the size of the loaded pics; getBounds() only returns the size of the MC i have loaded 'em into which is no use for me since it is not the size of the actual jpg.

    i would like to resize the respective MC by getting the actual size of the pic, but i can't even resize the MCs at all after the jpgs have loaded.

    any ideas ?

  2. #2
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    When you load a jpg image into a movieclip that movieclip will take the dimenssion of the image. But not until a the image has loaded. until then i belive the dimension is 0, 0.

    /Mirandir

  3. #3
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    yeah well, that's what i thought. but it turns out to be like this:
    when i attach (w/ attachMovie()) an empty clip "photoMC" (dimensions 0,0 of course since it's empty) to the stage and then load a jpg into photoMC and THEN use getBounds() on photoMC i get really absurd numbers, although the jpg is only, say, 350x350.

    how do i get to the jpgs actual size then ? is getBounds() the wrong way to do it ?

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    The mc's _width & _height?

  5. #5
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    i was horsing around with getBounds() all the time....but oh man, life can be so simple sometimes.

    ok, _width works fine.

    thank you guys for helping...

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