dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: join elements

  1. #1
    Senior Member creekmonkey's Avatar
    Join Date
    Jul 2006
    Posts
    121

    join elements

    Is it possible to join two elements in flash?

    What I would like to do is check if 2 elements collide, and if they do make them into one draggable element.

    Can this be done?

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    It could work if you could add one to other element child element..!? or if they both are in same layer and make the layer draggable?! (none of these have been tested )

  3. #3
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    You can use a few lines of code - executing on every frame - to make them stick together.

    if (stuck_together){
    sprite_2.x = sprite_1.x;
    sprite_2.y = sprite_1.y;}
    Cheers,
    kusco
    (3DFA Support Team)

  4. #4
    Senior Member creekmonkey's Avatar
    Join Date
    Jul 2006
    Posts
    121
    The example that kusco gave would work fine for just 2 elements.
    But if multiple elements wre used, or an array of elements that wouldnt be practicle.

    I have been trying to find a way to add one element as a child to the other upon collision, or to send them both to a child movie, but if it is possible it is way over my head.

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