A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: attach MC

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222

    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.

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Hi,

    Maybe this?

  3. #3
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    It is not working somehow to me...

  4. #4
    Senior Member Dusarn's Avatar
    Join Date
    Mar 2003
    Location
    TX
    Posts
    157
    You need to set the totalbuttons variable ie:

    totalbuttons = 5;

    etc.

  5. #5
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    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...

  6. #6
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    .

  7. #7
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    still not working...

  8. #8
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    Can someone help me please???

  9. #9
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    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);


  10. #10
    Senior Member
    Join Date
    Jul 2003
    Location
    Canary Islands
    Posts
    222
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center