
just managed to work out how to get flv’s to load up dynamically using xml - it all works well apart from this one problem that i have.
when the thumbnail for the flv is clicked the preloader appears and the flv starts to load - but for some reason the audio begins to play almost immediately - then when the flv actually loads then the audio plays again whilst the initial (unwanted) audio carries on playing!
this is the script for the netstream:
private function onInitialize():void
{
_connection = new NetConnection();
_connection.addEventListener(NetStatusEvent.NET_STATUS, onConnectionNetStatus, false, 0, true);
_connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onConnectionError, false, 0, true);
_connection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onConnectionError, false, 0, true);
_connection.addEventListener(IOErrorEvent.IO_ERROR, onConnectionError, false, 0, true);
_connection.objectEncoding = ObjectEncoding.DEFAULT;
_connection.client = {
onBWDone: onBWDone
};
//_connection.connect(”rtmp://yourfmshere/”);
_connection.connect(null);
}
private function
onConnectionError(…args):void
{
trace(“Test.onConnectionError()”);
}
private function onConnectionNetStatus(event:NetStatusEvent):void
{
trace(“**** code **** ” + event.info.code);
switch (event.info.code)
{
case “NetConnection.Connect.Success”:
_stream = new NetStream(_connection);
_stream.client = {
onMetaData: onMetaData,
onCuePoint: onCuePoint
};
_video = new Video();
_video.smoothing = true;
addChild(_video);
_video.attachNetStream(_stream);
var xscaler:Number = (1 / _video.width) * stage.stageWidth;
var yscaler:Number = (1 / _video.height) * stage.stageHeight;
_video.scaleX = xscaler;
_video.scaleY = yscaler;
_stream.play(videoPath + imageArray[largeImageItem].largeImage, 0);
i really don’t understand why it plays double???
Anyone had this problem before?
If you would like to make a comment, please fill out the form below.
Recent Comments