13 Replies Latest reply on Feb 8, 2008 4:05 PM by kglad

    problems with "pick and place"

    fundamentally.flawed
      Hi y'all. I'm a complete beginer at flash and was wondering if i could get some help.
      I'm designing a simple game in cs3 with actionscript 2.0 and i would like to get a second movie clip trailing my "hero" but only when it passes over it (or collects it), and again drop it when the hero comes in contact with another movie clip.

      I can get an object to trail, but thats as far as i've got. i cant think how to only trail once the object has been collected by the "hero".

      code (from a web example) - this is placed in the actions file of the trailing object;

      onClipEvent(enterFrame){
      diffx = _root.herod._x - this._x ;
      diffy = _root.herod._y - this._y ;
      _x += diffx/5 ;
      _y += diffy/5 ;
      }

      this is placed in the player action file "herod"

      diffx = _root._xspeed - this._x ;
      diffy = _root._yspeed - this._y ;
      _x += diffx/5 ;
      _y += diffy/5 ;

      Any help would be hugly appriciated.

      Thanks for looking....