|
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2002
Posts: 270
|
[F8] promblem with a path. Can someone take a quick a look?
I having a problem with my paths, I think. I had this code working fine on the movieClip itself but something has gone wrong now that I have made it into a function on the root.
Code:
xMin = 0;
xMax = 500;
yMin = 0;
yMax = 280;
function masking() {
for (i=0; i<20; i++){
randomX = Math.random() * ( _root.xMax - _root.xMin );
randomY = Math.random() * ( _root.yMax - _root.yMin );
orgClip = "_root.mcMask.mcItem";
dupClip = "_root.mcMask.mcItem" + i;
//trace("dupClip = " + dupClip);
duplicateMovieClip(orgClip, dupClip, this.getNextHighestDepth());
trace(dupClip);
eval("_root.mcMask.mcItem"+i)._x = randomX;
eval("_root.mcMask.mcItem"+i)._y = randomY;
}
}
Thanks!
__________________
Erik Peterson Project o3 |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Nov 2002
Location: Chicago, IL
Posts: 374
|
Try this code:
Code:
xMin = 0;
xMax = 500;
yMin = 0;
yMax = 280;
function masking() {
for (i=0; i<20; i++) {
randomX = Math.round(Math.random()*(xMax-xMin));
randomY = Math.round(Math.random()*(yMax-yMin));
orgClip = "mcMask.mcItem";
dupClip = "mcMask.mcItem"+i;
clipDepth = mcMask.getNextHighestDepth();
mcMask.mcItem.duplicateMovieClip(dupClip, clipDepth,{_y:randomY, _x:randomX});
trace(dupClip);
trace(clipDepth);
trace(randomX+" : "+randomY);
}
}
masking();
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2002
Posts: 270
|
caroach,
THANKS! that was very helpful and seemsto be working great.
__________________
Erik Peterson Project o3 |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Nov 2002
Location: Chicago, IL
Posts: 374
|
Glad to help
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|