createScope = function(target,path){ var conListener:Object = new Object(); conListener.onLoadInit = function(target_mc:MovieClip) { target_mc._x = -target_mc._width/2 target_mc._y = -target_mc._height/2 } var conLoader:MovieClipLoader = new MovieClipLoader(); conLoader.addListener(conListener); var d = 1 //direction 1 or -1 var smc = target.createEmptyMovieClip("scope_mc",0) smc._x = Math.round(Stage.width/2) smc._y = Math.round(Stage.height/2) for(var i=0;i<8;i++){ var img = smc.createEmptyMovieClip("img"+i,i) var msk = smc.attachMovie("msk","msk"+i,i+8) img.createEmptyMovieClip("con",0) conLoader.loadClip(path, img.con); img.setMask(msk) msk._rotation = i*45 img._rotation = Math.ceil((i+1)/2)*90 img._xscale = (i%2?1:-1)*100 /* if (i==0||i==1){ img._rotation = 90 }else if(i==2||i==3){ img._rotation = 180 }else if(i==4||i==5){ img._rotation = 270 }else if(i==6||i==7){ img._rotation = 360 } */ img.dr = (i%2?1:-1)*d img.onEnterFrame = function(){ this._rotation += this.dr; } } } createScope(this,"colorlight.jpg")