A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [as1,as2] Attaching objects

  1. #1
    Member
    Join Date
    Sep 2003
    Location
    Brazil
    Posts
    49

    [as1,as2] Attaching objects

    I need to attach two different movieclips, with different sizes of width and height.
    These two movieclips are main movieclips for its child clips. Each main movieclip, has a child clip.
    This child clip, on the stage, rotates. With the registration point on center.
    The main movieclips whose holds the child clips has top-left registration.
    So, what should I do, to put this two differents main movieclips on the stage, with the condition that they can´t collide visually.
    While this two movieclips are on the stage, with its child clip rotating, they can´t collide visually.
    Thank you.
    Last edited by marcelozep; 09-09-2009 at 03:04 PM.

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    Code:
    mc1 = _root.attachMovie("mc1", "mc1", 0);
    mc2 = _root.attachMovie("mc2", "mc2", 0);
    
    do {
    mc1._x = Stage.width*Math.random();
    mc2._x = Stage.width*Math.random();
    } while(mc1.hitTest(mc2));
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    Senior Member x-death's Avatar
    Join Date
    Aug 2009
    Posts
    175
    Quote Originally Posted by ImprisonedPride View Post
    Code:
    mc1 = _root.attachMovie("mc1", "mc1", 0);
    mc2 = _root.attachMovie("mc2", "mc2", 0);
    
    do {
    mc1._x = Stage.width*Math.random();
    mc2._x = Stage.width*Math.random();
    } while(mc1.hitTest(mc2));
    perhaps you should comment the code. so they can learn what you did as well...

  4. #4
    Member
    Join Date
    Sep 2003
    Location
    Brazil
    Posts
    49
    Being the code above, it´s not possible, because
    when the movieclips rotate they can collide visually.
    Thank you x-death.
    Thank you.
    Last edited by marcelozep; 09-04-2009 at 05:03 PM.

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