1 Reply Latest reply: Dec 14, 2010 6:19 AM by Rui Silva RSS

    need some help

    CikiLove

      i am trying to make some snow..i am new at this and there is some error in my action script can anyone help me?

       

      //number of flakes
      var myFlakes = 200;
      //size of flakes
      var mySize = 2.2;

       

      function dupFlakes(target:DisplayObject, autoAdd:Boolean = false):DisplayObject {
      // create duplicate
      var targetClass:Class = Object(target).constructor;
      var duplicate:DisplayObject = new targetClass();

       

      // duplicate properties
      duplicate.transform = target.transform;
      duplicate.filters = target.filters;
      duplicate.cacheAsBitmap = target.cacheAsBitmap;
      duplicate.opaqueBackground = target.opaqueBackground;

       

      if (autoAdd && target.parent) {
      target.parent.addChild(duplicate);
      }
      return duplicate;
      }

       

      for (var i=0; i<=myFlakes; i++) {
          var r = Math.round(Math.random()*100);
          var myCopiedSprite:MovieClip = dupFlakes(flake_mc,true) as MovieClip;
          var myNum = Math.round(Math.random()*550);
          myCopiedSprite.x = Math.round(Math.random()*1000);
          myNum = Math.round(Math.random()*mySize);
          myCopiedSprite.scaleX += myNum;
          myCopiedSprite.scaleY += myNum;
          myCopiedSprite.gotoAndPlay(r);
      }

       

      errors: 1

       

      1120: Access of undefined property flake_mc.