var frameVar:Number = 1; function loadImageLarge(event:MouseEvent):void { //////////trace button /////////////goes to the scene of the button clicked var myString:String = (event.target.name); mediaData_mc.photosFadeUp_mc.photosData_mc.photoLargeLoad_mc.gotoAndStop(myString); var mySubstring = (myString.substring(5,7)); var myNewNumber:Number = (mySubstring); //myNewNumber = Number(frameVar); var frameVar:Number = (myNewNumber); trace("this is myString "+myString);//////output///this is myString image9 trace("this is the Substring "+mySubstring);/////output///this is myString image9 trace("this is the myNewNumber "+myNewNumber);/////output///this is myNewNumber 9 trace("this is the frameVar "+frameVar);/////output///this is the frameVar 9 }