import flash.display.MovieClip;import fl.transitions.Tween;import fl.transitions.easing.*;star_mc.addEventListener(MouseEvent.CLICK,rotateStar);function rotateStar(e:MouseEvent):void {star_mc.rotation += 5;}addEventListener(Event.ENTER_FRAME, starMove);function starMove(e:Event):void { if (star_mc.x < stage.stageWidth) { star_mc.x += 2; } else { star_mc.x = 0; }}var instrument:MovieClip = banjo;instrument_txt.text = "The Banjo has been selected.";violin.addEventListener(MouseEvent.CLICK,onViolin);banjo.addEventListener(MouseEvent.CLICK,onBanjo);trumpet.addEventListener(MouseEvent.CLICK,onTrumpet);glock.addEventListener(MouseEvent.CLICK,onGlock);function onViolin(e:MouseEvent):void { instrument = violin; instrument_txt.text = "The Violin has been selected.";}function onTrumpet(e:MouseEvent):void { instrument = trumpet; instrument_txt.text = "The Trumpet has been selected.";}function onBanjo(e:MouseEvent):void { instrument = banjo; instrument_txt.text = "The Banjo has been selected.";}function onGlock(e:MouseEvent):void { instrument = glock; instrument_txt.text = "The Glockenspiel has been selected.";}grow_btn.addEventListener(MouseEvent.CLICK, grow);shrink_btn.addEventListener(MouseEvent.CLICK, shrink);rotate_btn.addEventListener(MouseEvent.CLICK, rotate);hide_btn.addEventListener(MouseEvent.CLICK, hideClip);show_btn.addEventListener(MouseEvent.CLICK,showClip);fadeOut_btn.addEventListener(MouseEvent.CLICK,fadeOut);fadeIn_btn.addEventListener(MouseEvent.CLICK,fadeIn);//the grow and shrink functions have tweens applied to them. In the lesson code they have their scaleX and scaleY properties changed instead. function grow(e:MouseEvent):void { var growX:Tween = new Tween(instrument, "scaleX", Elastic.easeOut, .2, 2, 3, true); var growY:Tween = new Tween(instrument, "scaleY", Elastic.easeOut, .2, 2, 3, true);}function shrink(e:MouseEvent):void { var shrinkX:Tween = new Tween(instrument, "scaleX", Elastic.easeOut, 2, .5, 3, true); var shrinkY:Tween = new Tween(instrument, "scaleY", Elastic.easeOut, 2, .5, 3, true);}function rotate(e:MouseEvent):void { var spin:Tween = new Tween(instrument, "rotation", Elastic.easeOut, 0, 360, 5, true)}function hideClip(e:MouseEvent):void { instrument.visible = false;}function showClip(e:MouseEvent):void { instrument.visible = true;}function fadeOut(e:MouseEvent):void { var tweenFadeOut:Tween = new Tween(instrument, "alpha", None.easeOut, 1, 0, 3, true);}/*Rather than set the beginning value of a tween numerically, you can instead use the current value of the property that is being tweened as a starting value. This can avoid sudden jumps in that properties value. In the fadeIn() function below the third parameter is based on the instrument's current alpha value. */function fadeIn(e:MouseEvent):void { var tweenFadeIn:Tween = new Tween(instrument, "alpha", None.easeIn, instrument.alpha, 1, 3, true);}