Creating FLVPlayback in AS3 not working

1.5k views Asked by At

If I create a FLVPlayback using ActionScript3 I can't get output, but if I drag on a FLVPlayback 2.5 component and set the source it works.

import fl.controls.Slider;
import fl.events.SliderEvent;
import fl.video.FLVPlayback;

var slider:Slider = new Slider();
slider.minimum = 0.0;
slider.maximum = 1.0;
slider.value = 1.0;
slider.tickInterval = 0.1;
slider.snapInterval = 0.01;
slider.liveDragging = true;
slider.addEventListener(SliderEvent.CHANGE, slider_change);
slider.move(120, 20);
addChild(slider);

var flvPlayback:FLVPlayback = new FLVPlayback();
flvPlayback.autoPlay = true;
flvPlayback.source = "rtmp://xx.xx.xx.xx/test/abc";
flvPlayback.x = 10;
flvPlayback.y = 40;
flvPlayback.isLive = true;
addChild(flvPlayback);

function slider_change(evt:SliderEvent):void {
    flvPlayback.volume = evt.value;
}
1

There are 1 answers

0
case2000 On

Are you seeing any compiler errors? The component has to be in the library for the import to work. If you drag an instance of the component onto the stage, and then delete it, the component will remain in the library. Same goes for your Slider component.

I tested your code with a local .flv after including the components in the lib and it worked for me in CS4.