Motion trace circular movement
Code Actionscript 2.0
this code is only available as Actionscript 3.0
Code Actionscript 3.0
addEventListener(Event.ENTER_FRAME, enterFrame); var myBitmapData ; initScreenshot() ; var centerx= 200; var centery= 200; var angle= 0; var radius = 100; var speed = 5.1; function enterFrame(event : Event){ angle= angle- speed; square.x = centerx+ radius * Math.sin(angle* Math.PI / 180); square.y = centery+ radius * Math.cos(angle* Math.PI / 180); square.rotation=-angle; drawScreenshot(); } function initScreenshot() { myBitmapData = new BitmapData(stage.stageWidth, stage.stageHeight); var drawing:MovieClip = new MovieClip(); var bitmap = new Bitmap(myBitmapData); drawing.addChild(bitmap); this.addChild(drawing); } function drawScreenshot() { myBitmapData.draw(stage); }
Description
This script is drawing a trace of the movement "Circular movement with rotation" by taking a screenshot, and placing it as a bitmap-image onto the drawingboard.
related to: Circular movement with rotation
Download
Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File