69 posts
  • Has been part of the Envato Community for over 6 years
  • Has collected 1+ items on Envato Market
Scooby says

The Question..

How would I go about getting the ball to stay in the X in the square?? It has to stay there when the square scales, and when the square is dragged.

I have this code to get the coordinates of the loc mc (which is the X) which is inside the square mc.. As you can see it places the ball on the main stage in that location, and I need it to be on the X.. I have no idea what to do here..

ball._x = square.loc._x; ball._y = square.loc._y;

Here is an example page with .fla:

http://www.rickdu.net/test/

Thank you much!!

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

try this

ball._x = square._x + square.loc._x;
ball._y = square._y + square.loc._y;

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says
on a second thought… maybe you should use something like this…
this.onEnterFrame = function(){
      ball._x = square._x + square.loc._x * square._xscale/100;
      ball._y = square._y + square.loc._y * square._yscale/100;
}

instead of your line…

69 posts
  • Has been part of the Envato Community for over 6 years
  • Has collected 1+ items on Envato Market
Scooby says
on a second thought… maybe you should use something like this…
this.onEnterFrame = function(){
      ball._x = square._x + square.loc._x * square._xscale/100;
      ball._y = square._y + square.loc._y * square._yscale/100;
}
instead of your line…

YOUR MY HERO !!!!! HAHAHA

Thanks so much!!

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

:D

by
by
by
by
by
by