A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Detect A-Attach B-Release B-Attach to C ?

  1. #1
    Member
    Join Date
    Oct 2000
    Posts
    41

    Detect A-Attach B-Release B-Attach to C ?

    Ok here's something that sounds simple.

    I have mc A moving slowly across the screen.
    I would like to detect it's position x and y, and then at a certain coordinate(let's say x= 200 and y=300) attach mc B(which is just floating around) to attach itself to and follow mc A movement.
    And then at some point attach mc B to attach itself to another mc(C).

    Is it also possible to attach mc B to a certain pixel (xy) on mc A (or C).

    Any ideas

    Cheers

    Trinitee

  2. #2
    Senior Member
    Join Date
    Feb 2006
    Location
    Portland OR
    Posts
    138
    - maybe it could work something like:
    this.onEnterFrame = function(){
    if (A._x == 200 && A._y == 300){
    B._x = A._x-50 // or whatever distance you want it to be from A's._x
    B._y = A._y-50 // or + 50 or however far away it should be
    }
    }
    //if you want a specific point to attach maybe you put another instance name inside of A and tell B._x to = A.instanceName._x;
    Last edited by knottyDJ; 03-24-2006 at 02:55 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