A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to get x and y co-ordinates after scalling a movie clip+ Problem

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    4

    How to get x and y co-ordinates after scalling a movie clip+ Problem

    Hello,
    I am working on a flash game in which i want to focus the light on some objects. For that I increased the xscale and yscale of the rope. When i rotate the rope I want to increase the xscale and yscale up to the stage.(according to x position ). I tried graphics equation to get the x' and y' after scaling. But it gives wrong values for co-ordinates.

    I used the following equations to find new positions of x and y (x' and y') after scaling.
    x' = ( x * sx) + (xf *(1-sx));
    y' = ( y * sy )+ (yf *(1-sy));

    so if anybody have any idea about how to solve this problem then pls reply soon.

    Thanks in Advance.

  2. #2
    Media Developer CJElven's Avatar
    Join Date
    Jan 2002
    Location
    San Antonio, TX
    Posts
    298
    Perhaps I misunderstand this...but you're scaling an object, and after you scale it, it gives incorrect X,Y coordinates? I'm going to guess that what's happening is that they don't actually change...correct? If so, then perhaps you don't realize that the XY coordinates are always read from 0,0 of the movieClip? If you want to read the XY of the top left corner, even when the topleft of the graphic is not at 0,0 in the movieClip, then either A) it needs to be centered so that you can just take XY and divide it by 1/2 and subtract from the XY, or make the graphic inside the MC ANOTHER MC that you can read the XY of relative to the 0,0 of the main MC, and then subtract from the parent XY.
    Dragontech Media
    Magic.Fire.Content

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    4

    Reply....

    Hello ,
    I have attached a word file which describes my problem in detail. I hope this will help u to understand my problem. any help will be appreciated.
    Attached Files Attached Files

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