• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

need some help

New Here ,
Dec 14, 2010 Dec 14, 2010

Copy link to clipboard

Copied

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.

TOPICS
ActionScript

Views

354

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 14, 2010 Dec 14, 2010

Copy link to clipboard

Copied

LATEST

Hi,

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

Best.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines