首页 > 代码库 > 星空添加星星效果

星空添加星星效果

 

private var starNum:int = 100; //星星数量 private var scene_width:int=1440; //星星的舞台范围    private var scene_height:int=500; //星星的舞台范围//星空效果 动态添加星星for(var j:int = 0;j < starNum;j++){var McClass2:Class = loadClassDefinition("star");var mcstart:MovieClip = new McClass2();mcstart.x = Math.random()*scene_width;mcstart.y = Math.random()*scene_height;    mcstart.scaleX = Math.random()*1.5;    mcstart.scaleY = mcstart.scaleX;    //mcstart.gotoAndPlay(int(Math.random()*50));ui2.addChild(mcstart);    }

 

星空添加星星效果