-
shavingcream incarnate
arrays? i think
PHP Code:
X = 160; dupMovie = function () { for (i=1; i<10; i++) { piece.duplicateMovieClip("circle"+i, i,{ _x:X*i, _y:550 }); } }; dupMovie(); button_left.onPress = function(){
i have this code in which circles, with a width of 160 and the rotation point set to the upper right hand corner,
line up side by side starting from the left edge of the screen and i want to be able to move all of the "circles" at once
i also wish to make the code flexible so if i change the number of circles i want to make, those will also be moved
haha and fyi this isnt my 1st post, i jsut lost my password and dont use that e-mail any more
Last edited by gukinator; 07-17-2008 at 12:15 PM.
-
Maybe you can adapt this to what you are trying to do...
Code:
X = 160;
moveAmt = 5;
piecesArray = new Array();
dupMovie = function () {
for (i = 1; i < 10; i++) {
piecesArray.push(piece.duplicateMovieClip("circle" + i, i, {_x:X * i, _y:150}));
}
};
dupMovie();
button_left.onPress = function() {
this.onEnterFrame = function() {
for (i in piecesArray) {
piecesArray[i]._x -= moveAmt;
}
};
};
button_left.onRelease = function() {
delete this.onEnterFrame;
};
button_left.onReleaseOutside = button_left.onRelease;
-
shavingcream incarnate
thanks a lot
that works great, im sure ill be able to work with this
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|