9 Replies Latest reply on Jul 31, 2009 6:33 AM by Ned Murphy

Place on a particular area of the stage

I want to place my duplicates about one third down from the top and in a small bit from the left.  Roughly centre them on stage.

My code so far:

for (var i = 1; i <= 6; i++)
{
duplicateMovieClip ("fish_mc", "fish_mc" + i, i);
_root["fish_mc" + i]._x = 500 * Math.random ();
_root["fish_mc" + i]._y = 350 * Math.random ();
}

• 1. Re: Place on a particular area of the stage

Then you need to change the values you assign to_x and _y to agree with what you want for these two lines...

_root["fish_mc" + i]._x = 500 * Math.random ();
_root["fish_mc" + i]._y = 350 * Math.random ();
-
What problem are you having determining those values?
-
From your description of what you want it's hard to tell what that is when in one case you say you want them 1/3 and a little in and the other case you say you want them centered and then you show them getting randomly placed anywhere.
1 person found this helpful
• 2. Re: Place on a particular area of the stage

How?   I want to keep them in from the top, bottom and sides.

• 3. Re: Place on a particular area of the stage

How what?  If you haven't the slightest idea of what that code you are using is doing, and have no decided position for these items other than you want them in from the edges, then just take half your stage width and half your stage height and assign those values in those two lines of code you have.

1 person found this helpful
• 4. Re: Place on a particular area of the stage

I don,t know how to manipulate like you can.

• 5. Re: Place on a particular area of the stage

Try:

for (var i = 1; i <= 6; i++)
{
duplicateMovieClip ("fish_mc", "fish_mc" + i, i);
_root["fish_mc" + i]._x = 250;
_root["fish_mc" + i]._y = 175;
}

1 person found this helpful
• 6. Re: Place on a particular area of the stage

That only gives me one fish on the stage, I need a pond in a bit from the left side and down a bit.

• 7. Re: Place on a particular area of the stage

No, that gives you six (plus the one you started with) with those 6 in exactly the same place, so it looks like one.  You are going to have to do a better job of describing what you want - no one can read your mind and your description of what you want is inconsistent and vague.  The code you started off with is your best bet so far... at least you will see all the pieces.  If you can't describe what you want, you will have to figure out for yourself how to use the code to do it yourself.

1 person found this helpful
• 8. Re: Place on a particular area of the stage

Perhaps if you read it you might know what I'm asking.

• 9. Re: Place on a particular area of the stage

If you could only see what you haven't explained, you'd understand why you are not helping anyone to help you.  There are no mind readers here.  If you can define a "particular area" using some boundary numbers, then you might have a chance.