|
-
attach MC
Hey all,
I wanna ask, if it's possible to make that with the action attachmovie all the movie clips don't show up all at once, but each by each from up to down. Thanks for any idea.
-
Registered User
-
It is not working somehow to me...
-
Senior Member
You need to set the totalbuttons variable ie:
totalbuttons = 5;
etc.
-
It is working, but I have explained that in a wrong way. I need them to view from left to right and from up to down. Sorry...
-
-
-
Can someone help me please???
-
Senior Member
It sounds like you want a grid. If so, the following script will do it.
code:
var myInterval;
totalXbuttons = 7; // total columns
totalYbuttons = 5; // total rows
leftMargin = 40;
xSpacing = 20;
topMargin = 40;
ySpacing = 20;
kTiming = 50; // milliseconds between buttons
totalButtons = totalXbuttons * totalYbuttons;
function myFunction(i)
{
clearInterval(myInterval);
var x = i % totalXbuttons;
var y = Math.floor(i/totalXbuttons);
var item = attachMovie("btn", "btn"+i, i);
item._x = leftMargin + x*xSpacing;
item._y = topMargin + y*ySpacing;
if (++i < totalButtons)
{
myInterval = setInterval(myFunction, kTiming, i);
}
}
myFunction(0);
-
Good work! I was waiting for that couple of hours.
Thank you verry much!!!
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
|