Я купил ану, чтобы записать мой экран, он использует события скворец. он записывает стадию скворца, что 4 вращающихся круга. но я хочу записать свои видеоклипы. Я могу посмотреть мои видеоклипы на скворечную анимацию. но он записывает только скворец анимации. Как я могу записать свою флеш сцену, которая содержит видеоролики и анимацию? не могли бы вы мне помочь? заранее спасибо.
это файл .as для запуска.
package
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display3D.Context3D;
import flash.filesystem.File;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.system.Capabilities;
import flash.utils.flash_proxy;
import starling.core.Starling;
import starling.utils.RectangleUtil;
import starling.utils.ScaleMode;
[SWF(frameRate="30", backgroundColor="#000")]
public class GameplayRecorderTestAppStarling extends Sprite
{
private var mStarling:Starling;
public function GameplayRecorderTestAppStarling()
{
var stageWidth:int = Constants.STAGE_WIDTH;
var stageHeight:int = Constants.STAGE_HEIGHT;
var iOS:Boolean = Capabilities.manufacturer.indexOf("iOS") != -1;
Starling.multitouchEnabled = true;
Starling.handleLostContext = !iOS;
var viewPort:Rectangle = RectangleUtil.fit(
new Rectangle(0, 0, stageWidth, stageHeight),
new Rectangle(0, 0, stage.fullScreenWidth, stage.fullScreenHeight),
ScaleMode.NONE);
// mStarling.display.stage = Starling.current.stage;
mStarling = new Starling(Game, stage, viewPort);
// mStarling = new Starling(Game, stage);
mStarling.stage.stageWidth = stageWidth;
mStarling.stage.stageHeight = stageHeight;
mStarling.simulateMultitouch = false;
mStarling.enableErrorChecking = Capabilities.isDebugger;
mStarling.showStats = true;
mStarling.antiAliasing = 1;
mStarling.start();
}
}
}
и это файл .as для игры.
public class Game extends Sprite
{
private var quads:Vector.<Quad>;
public function Game()
{
addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded ( e:Event ):void
{
quads = new Vector.<Quad>(5, true);
//creating some quads with different colours
//position the first four of them them in the four courners of the stage
//and the last in the center of the screen
quads[0] = new Quad(200, 200, 0xAA0000);
quads[0].x = 0; quads[0].y=0;
//set rotation center to be in the center of the quad
quads[0].pivotX = 100; quads[0].pivotY = 100;
addChild ( quads[0] );
quads[1] = new Quad(200, 200, 0x00FF00);
quads[1].x = stage.stageWidth; quads[1].y = 0;
//set rotation center to be in the center of the quad
quads[1].pivotX = 100; quads[1].pivotY = 100;
addChild ( quads[1] );
quads[2] = new Quad(200, 200, 0x0000FF);
quads[2].x = stage.stageWidth; quads[2].y = stage.stageHeight;
//set rotation center to be in the center of the quad
quads[2].pivotX = 100; quads[2].pivotY = 100;
addChild ( quads[2] );
quads[3] = new Quad(200, 200, 0xAA00FF);
quads[3].x = 0; quads[3].y = stage.stageHeight;
//set rotation center to be in the center of the quad
quads[3].pivotX = 100; quads[3].pivotY = 100;
addChild ( quads[3] );
quads[4] = new Quad(200, 200, 0xAAAAAA);
quads[4].x = stage.stageWidth *0.5; quads[4].y = stage.stageHeight*0.5;
//set rotation center to be in the center of the quad
quads[4].pivotX = 100; quads[4].pivotY = 100;
addChild ( quads[4] );
this.addEventListener( TouchEvent.TOUCH, onTouch);
this.addEventListener(EnterFrameEvent.ENTER_FRAME, onEnterFrame);
initializeScreenRecorder();
}
// the corresponding event listener
private function onEnterFrame(event:EnterFrameEvent):void
{
for ( var quadID:int = 0; quadID < 5; quadID++ )
{
//rotate each quad with 36 degrees per second
quads[quadID].rotation += 0.0174532925 * 36 * event.passedTime;
}
}
private function onTouch(event:TouchEvent):void
{
var touch:Touch = event.getTouch(this, TouchPhase.BEGAN);
if(touch)
{
//start recording if we didn't do it already
if(!m_isRecording)
{
startRecording();
}
else
{
finishRecording();
}
m_isRecording = !m_isRecording;
trace("StarlingEvent: onTouch");
}
}
/* ***************************
* ScreenCast ANE calls
* ***************************/
private function initializeScreenRecorder() : void
{
m_screenRecorder = new GameplayRecorder();
m_screenRecorder.addEventListener( GameplayRecorderEvent.VIDEO_SAVED, onVideoSaved );
m_screenRecorder.addEventListener( GameplayRecorderEvent.ERROR, onScreenCastError );
}
/* *********************************************************************************
* This is where the magic...ahm...the drawing to the frame's BitmapData happens
* *********************************************************************************/
private function draw3dCallback( _bmp : BitmapData ):void
{
stage.drawToBitmapData( _bmp );
//flash.stage.drawToBitmapData( _bmp );
}