69 posts
  • Has been part of the Envato Community for over 7 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 7 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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by