Skip navigation
CikiLove
Currently Being Moderated

need some help

Dec 14, 2010 5:37 AM

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.

 

 

 
Replies
  • Currently Being Moderated
    Dec 14, 2010 6:19 AM   in reply to CikiLove

    Hi,

     

    Where is flake_mc? In the code you posted I can only see it as a fuction argument...

     

    Best.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points