A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Is it possible to get the dimensions of an image after loading?

  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410

    Is it possible to get the dimensions of an image after loading?

    I want to load an external jpg
    Is it possible to get the dimensions of the file loaded after?

    It seems straight forward enough and easy to do - but I don't ever remember seeing such a functionality in Flash before

    Any help would be appreciated

    Thanks


    OM

  2. #2
    Señor Member Mavrisa's Avatar
    Join Date
    Oct 2005
    Location
    Canada
    Posts
    506
    loader.contentLoaderInfo.width (or if you have a seperate LoaderInfo variable, just get its width property)
    The properites become usable when the init event fires.
    Haikus are easy
    But sometimes they don't make sense
    Refrigerator

  3. #3
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410
    thanks a lot
    just to confirm: is this available in *just* as3 or available as standard anyway?

    thanks

  4. #4
    Señor Member Mavrisa's Avatar
    Join Date
    Oct 2005
    Location
    Canada
    Posts
    506
    AS2 doesn't have the Loader and LoaderInfo class. I think it uses a class called MovieClipLoader... which probably has similar ways to get the dimensions... but I haven't used AS2 in a long while now so don't quote me on that.
    Haikus are easy
    But sometimes they don't make sense
    Refrigerator

  5. #5
    Senior Member
    Join Date
    Aug 2004
    Location
    London
    Posts
    410
    thats really really useful
    i would have been stuck for a few hours figuring out myself i'm sure
    thanks

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