# External XML flash video gallery

**URL:** https://forum.kirupa.com/t/external-xml-flash-video-gallery/260129
**Category:** flash
**Created:** [May 12, 2008, 8:11pm UTC](https://forum.kirupa.com/t/external-xml-flash-video-gallery/260129 "2008-05-12T20:11:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nerozik](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@nerozik](https://forum.kirupa.com/u/nerozik)
#### Post date: [May 12, 2008, 8:11pm UTC](https://forum.kirupa.com/t/external-xml-flash-video-gallery/260129/1 "2008-05-12T20:11:01Z")

</div>

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;  
}

---

<div class="post-metadata">

### Author: ![dharmveer](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@dharmveer](https://forum.kirupa.com/u/dharmveer)
#### Post date: [July 15, 2008, 7:37am UTC](https://forum.kirupa.com/t/external-xml-flash-video-gallery/260129/2 "2008-07-15T07:37:23Z")

</div>

Thanks but I could not found the code which attach the xml file
