0

some elegant way to create a shadow trail of a object ,e.g a plane? this answer i can't understand this ,im a starter for as3 . so , some directly code should be very good for me .

Community
  • 1
  • 1
mh29110
  • 23
  • 3

1 Answers1

1
  var dis : DisplayObject;
    var prevDis : DisplayObject;
    for ( var i:int = _displayList. length -1; i >= 1; i-- ) //reverse recursive
    {
        dis = _displayList[ i ];
        prevDis = _displayList[ i -1 ] ;
        dis . x = prevDis .x;
        dis . y = prevDis .y;     //create ghost shadow effect 
    }

    // need to locate the  first displayObject's position by tween .
    prevDis . x = int (_tween . target. x );
    prevDis . y = int (_tween . target. y );

    _tween . tick( delta );  
phantomjia
  • 76
  • 3
  • this is a simple solution for a starter . you can change those displayobjects's color or alpha gradually to make it better . Another solution is BitmapData copy , you will contact it in future – phantomjia Jul 28 '14 at 07:04