A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Movie clips not moving together...

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    49

    Movie clips not moving together...

    Hello all,

    I have one mc moving with this code:

    class strandT extends MovieClip {

    var dx: Number;
    var dy: Number;

    function strandT(){
    _x = 1050;
    _y = 0;

    }

    function onEnterFrame(){
    move();
    if(_x < 0){
    removeMovieClip(this);
    }
    }
    function move(){
    _x += -.25;
    }


    When mc "A" hits the above mc, I want it to follow it across the screen.
    Here's what I have for that:

    function connectT1(){
    if (this.hitTest(_root["strandT1"])){
    _root[this]._x = _root["strandT1"]._x;
    _root[this]._y = _root["strandT1"]._y;
    }
    }


    When they touch, everything on the screen just disappears!!

    Any reason this code isn't working?

    Thanks in advance!!

  2. #2
    http://pat.theorigin.net cresquin's Avatar
    Join Date
    Jun 2003
    Location
    Los Angeles, CA
    Posts
    685
    PHP Code:
    function connectT1(){
    if (
    this.hitTest(_root.strandT1)){
    this.onEnterFrame=function(){
    this._x _root.strandT1._x;
    this._y _root.strandT1._y;
    }
    }


  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    49
    Cresquin,

    Thanks!!! That code works perfectly....

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