Search code examples
actionscript-3flashflvplayback

How to rotate FLVPlayback around a specific axis ? (ex. Y= 10 , Y = 100)


In my program I have a FLVPlayback to play video and I want to rotate the FLVPlayback with keyboard inputs around X axis. following is the code. Here the FLVPlayback only rotates around Y = 0.that means around top margin of the video. I want to rotate it around the bottom margin of the video.How can I do It?

enter image description here

import fl.video.*;
import fl.transitions.Rotate;

var xval:int = 0;
var yval:int = 0;
var zval:int = 0;


//var videoFront:FLVPlayback = new FLVPlayback();
videoFront.source = "data/Dance.flv";
videoFront.width = 500;
videoFront.height = 500;


videoFront.play();


stage.addChild(videoFront);

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);

function onKeyPressed(evt:KeyboardEvent):void   
{
  trace("Press key");

  if (evt.keyCode == Keyboard.Q)
  {

      xval++;
      videoFront.rotationX = xval;
  }
  else if (evt.keyCode == Keyboard.A)
  {

      xval--;
      videoFront.rotationX = xval;
  }
}

Solution

  • You can put it in another movie clip and put your bottom margin of the flvpalyback in the registration point of the this movieclip then rotate new movie clip so that rotation pivot will change.