A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Drawn movieclip X & Y position don't match stage X&Y (not nested) AS2/CS5

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    96

    Drawn movieclip X & Y position don't match stage X&Y (not nested) AS2/CS5

    Hi all!

    I am working on a project where the user can draw a box around a portion of an image, and that image will duplicate and enlarge on the screen and applying the drawn box as a mask showing only the portion they selected. My issue, is that the X&Y position of the drawn box don't seem to correspond to the stage, even though it isn't nested. The Y position might be -250 and it is sitting in the middle of the screen. I want to center the newly masked image on the screen, but since the Y position doesn't match the stage, I can't seem to figure out how to do that.

    I have never used the drawing API for something this complex before, so I am hoping someone with more experience can weigh in on this!

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    If you can attach your *.fla then we can try to help you solve your problem.

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Without seeing any of your code or your *.fla, perhaps this might be of some assistance.

    inside there are some comments which can be uncommented to achieve what I think you were asking for, anyhow, please feel free to exploit it.

  4. #4
    Member
    Join Date
    Aug 2006
    Posts
    96
    Hi fruitbeard! Thanks for the zip! The uncommented version is closer to what I was going for, keeping the original image and then adding the duplicated masked image on top in the center. I think I can noodle it out from what you provided here! Unfortunately, this is for a legal matter, so I can't upload the files, but I will look into this copy pixels function! Didn't know that was a thing!

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Glad you might be able to make it work for you, here is a better version, the last one was limited to drawing only to the right and down, this one can draw through all directions.

    Good luck

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    There is a rogue var in the second one, although you probably could figure it out or don't need it, just replace the "initialY" that is there with "yPoint".

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