I am trying to set a proper function for retrieving and playing flash video (flv) in a xml gallery. Any help on this matter would be greatly appreciated:
import cn.com.webstudio.util.;
import flash.display.Sprite;
import mx.video.;
var width;
var height;
var cfp:FLVPlayback;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(video);
video.play();
back.useHandCursor = false;
back.onRelease = function() {
btnClose.onRelease();
};
btnPrev.onRelease = function() {
if (this._parent._parent.curItem == 0) {
return;
}
this._parent._parent.curItem = wMath.clamp(0, --this._parent._parent.curItem, this._parent._parent.dataArr.length-1);
btnVision();
};
btnNext.onRelease = function() {
if (this._parent._parent.curItem == this._parent._parent.dataArr.length-1) {
return;
}
this._parent._parent.curItem = wMath.clamp(0, ++this._parent._parent.curItem, this._parent._parent.dataArr.length-1);
btnVision();
};
btnInfo._alpha = 0;
btnInfo.onRelease = function() {
summary.open();
};
btnClose.onRelease = function() {
border._width = 100;
border._height = 100;
border._x = (Stage.width-border._width)/2;
border._y = (Stage.height-border._height)/2;
close();
};
function btnVision() {
loadImage();
loadVideo();
}
/function btnVision() {
loadImage = ();
loadImage = setMedia(this.tlink,“FLV”)();
}/
function init() {
this._visible = false;
back._x = 0;
back._y = 0;
back._width = Stage.width;
back._height = Stage.height;
//
border._x = (Stage.width-border._width)/2;
border._y = (Stage.height-border._height)/2;
//
info._x = (Stage.width-info._width)/2;
info._y = (Stage.height-info._height)/2;
}
function close() {
this._visible = false;
}
function loadVideo() {
this._visible = false;
btnInfo._alpha = 0;
btnInfo._visible = false;
var cur = this;
wtool.loadVideo(this, _parent.dataArr[_parent.curItem].url, wTool.SCALE_MODE_FULL, function (token) {
cur.video.fl._visible = false;
cur.reSize();
cur.summary.init();
});
}
function loadImage() {
this._visible = true;
btnInfo._alpha = 0;
btnInfo._visible = false;
var cur = this;
wTool.loadImage(this, _parent.dataArr[_parent.curItem].url, wTool.SCALE_MODE_FULL, function (token) {
cur.fl._visible = false;
cur.reSize();
cur.summary.init();
});
}
function reSize() {
video._x = (Stage.width-video._width)/2;
video._y = (Stage.height-video._height)/2;
//
width = video._width+10;
height = video._height+10;
//
btnPrev._x = video._x-btnPrev._width-10;
btnPrev._y = (Stage.height-btnPrev._height)/2;
btnNext._x = video._x+video._width+15;
btnNext._y = (Stage.height-btnNext._height)/2;
//
btnInfo._x = video._x;
btnInfo._y = video._y+video._height-btnInfo._height;
//
btnClose._x = (Stage.width-btnClose._width)/2;
btnClose._y = video._y+video._height+10;
//
title.text = _parent.dataArr[_parent.curItem].title;
title._width = title.textWidth+10;
title._x = (Stage.width-title._width)/2;
title._y = video._y-35;
//
delete this.onEnterFrame;
this.onEnterFrame = updateVision;
}
function updateVision() {
border._width += (width-border._width)/6;
border._height += (height-border._height)/6;
//
if (Math.abs(width-border._width)<1&&Math.abs(height-border._height)<1) {
border._width = width;
border._height = height;
//
video._visible = true;
video._alpha = 0;
wEffect.fadeIn(video, null);
//
btnInfo._visible = true;
btnInfo._alpha = 0;
wEffect.fadeIn(btnInfo, null);
//
delete this.onEnterFrame;
}
//
border._x = (Stage.width-border._width)/2;
border._y = (Stage.height-border._height)/2;
}