69 posts
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
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!!

3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 more
wickedpixel says

try this

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

3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 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
  • Bought between 1 and 9 items
  • Has been a member for 6-7 years
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!!

3058 posts
  • Community Superstar
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
+1 more
wickedpixel says

:D

by
by
by
by
by
by