A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Loaded images 'displaced'

  1. #1
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146

    Loaded images 'displaced'

    I'm trying to load images into an MC called images ... it works fine apart from one little niggle: every image that is imported seems to be displaced one pixel right and one pixel down.

    It normally wouldn't be a problem, except that the images I'm importing have a 1px border, and when imported the displacement makes it look like there's a 2px border on the top and left and none on the right and bottom.

    Any ideas about correcting this?
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    is the whole movie/stage dimensions the same as the images you are using?

    can you move you containerClip up and over 1 px?

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    No ... I'm loading into an empty movie clip, so it doesn't actually have any physical dimensions until the image is loaded. I don't think moving the clip's position will make any difference either ... since the image is loading into the clip, the clip's position on the stage shouldn't matter.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    as long as your empty clip is placed or you create it @ X:0 & Y:0.. then the image should fit.


    I mean if you have your container clip positioned off the stage somewhat, obviously some of the loaded image will be cropped.

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    hmm sounds like the good ol bitmap shift bug ... you may find this useful (if it's what i think you're referring to)

    http://www.misuseit.com/bitmapbug/
    Last edited by silentweed; 09-16-2007 at 09:33 PM.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  6. #6

  7. #7
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    That's it, silentweed ... unfortunately a few of the workarounds won't work because I'm actually loading the image from a URL into an empty movie clip. I'll look into those that don't require doing something with the image during authoring as soon as I get home. Thanks for the link!
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  8. #8
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Okay, just tried a few of the suggestions and ... no luck. As I anticipated, the solutions don't work because they are meant to resolve shifting issues from importing into the authoring environment. I'm trying to load jpegs at runtime using loadMovie().

    Need more help
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  9. #9
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Just Googled the bug and came up with this ... not perfect, but closer than what I had.

    http://www.fatorcaos.com.br/flashimagebug/
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  10. #10
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    can you use a MovieClipLoader and on init extend the movie 1x1 past the current image dimensions?

  11. #11
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Sorry ... not quite with you there. I've tried resizing the movie clip on load to +1 height and width ... didn't work. Is there some other way of doing this?
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  12. #12
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    nope, more or less same way just not using: loadMovie(). bt using the onInit() form the MovieClipLoader class is all..

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