PDA

Volledige versie bekijken : filmtitel weergeven


Eddie B
%Europe/Berlin %644 %2007, 15:28
Even een vraagie. Ik heb de complete videoplayer gemaakt van Lee Brim. Van gotoandlearn. Ik heb hem een beetje aangepast met wat extra dingen die gasten in het forum van gotoandlearn gaven. En het werkt allemaal perfect.
Nou lijkt het me alleen wel geinig om boven m地 video scherm nog een keer de titel van het spelende filmpje te geven. Dus heb ik een dynamic textfield boven het scherm gezet met de instance name filmTitel. De bedoeling is dus dat hij de titel van het filmpje uit m地 xml haalt. Maar dat krijg ik dus niet voor elkaar. Ik heb een aantal dingen geprobeerd uit andere post van dit forum. Zoals bijvoorbeeld deze (http://www.flashfocus.nl/forum/showthread.php?t=20274&highlight=xml+titel) .

Maar als ik die erin verwerk krijg ik m地 textvak of undifind, of alleen de titel van m地 laatste filmpje. Maar dus niet het filmpje dat nu speelt. Heeft iemand wat tips voor me?

M地 complete as code voor de speler (zonder filmTitel!!):
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(10);
ns.onStatus = function(info) {
if (info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if (info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if (info.code == "NetStream.Play.Stop") {
v = whoIsOn+1;
if (v>=listClips.length) {
v = 0;
}
getNewVid(listClips[v]);
}
};
pauseKnop.onRelease = function() {
ns.pause();
};
rewindKnop.onRelease = function() {
ns.seek(0);
};
this.createEmptyMovieClip("vFrame", this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function (obj) {
duration = obj.duration;
};
function videoStatus() {
amountLoaded = ns.bytesLoaded/ns.bytesTotal;
loader.loadbar._width = amountLoaded*274.8;
loader.scrub._x = ns.time/duration*253.8;
}
var scrubInterval;
loader.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false, 0, this._y, 253, this._y);
};
loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
};
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/253)*duration));
}
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var item1:ContextMenuItem = new ContextMenuItem("..:: ObsCure Movies ::..", trace);
theMenu.customItems[0] = item1;
var item2:ContextMenuItem = new ContextMenuItem("Play / Pause Movie", pauseIt, true);
theMenu.customItems[1] = item2;
var item3:ContextMenuItem = new ContextMenuItem("Replay movie", restartIt);
theMenu.customItems[2] = item3;
var item4:ContextMenuItem = new ContextMenuItem("ゥ 2006 ObsCure", trace, true);
theMenu.customItems[3] = item4;
function pauseIt() {
ns.pause();
}
function stopIt() {
ns.seek(0);
ns.pause();
}
function restartIt() {
ns.seek(0);
}
_root.createEmptyMovieClip("vSound", _root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
mute.onRollOver = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("onOver");
} else {
this.gotoAndStop("muteOver");
}
};
mute.onRollOut = function() {
if (so.getVolume() == 100) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("mute");
}
};
mute.onRelease = function() {
if (so.getVolume() == 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
} else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
};
tooltip._visible = false;
var tipInt;
kruisKnop.onRollOver = function() {
tipInt = setInterval(showTip, 100, "Sluit scherm");
};
kruisKnop.onRollOut = function() {
hideTip();
};
pauseKnop.onRollOver = function() {
tipInt = setInterval(showTip, 100, "Play/Pause");
};
pauseKnop.onRollOut = function() {
hideTip();
};
rewindKnop.onRollOver = function() {
tipInt = setInterval(showTip, 100, "Spoelt 't zooitje terug");
};
rewindKnop.onRollOut = function() {
hideTip();
};
mute.onRollOver = function() {
tipInt = setInterval(showTip, 100, "Mute");
};

mute.onRollOut = function() {
hideTip();
};
var count = 0;
function showTip(tiptext) {
if (count == 2) {
clearInterval(tipInt);
count = 0;
tooltip.tiptext.text = tiptext;
tooltip._x = _root._xmouse;
tooltip._y = _root._ymouse;
tooltip._visible = true;
_root.onMouseMove = function() {
tooltip._x = _root._xmouse;
tooltip._y = _root._ymouse;
updateAfterEvent();
};
} else {
count++;
}
}
function hideTip() {
clearInterval(tipInt);
tooltip._visible = false;
delete _root.onMouseMove;
}

var vlist:XML = new XML();
vlist.ignoreWhite = true;
var listClips:Array = new Array();
var whoIsOn:Number = 0;
var yBegin:Number = videoList._y;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for (i=0; i<videos.length; i++) {
var a = videoList.attachMovie("listEntry", "listEntry"+i, videoList.getNextHighestDepth());
listClips.push(a);
a._y = a._height*i;
a._alpha = 66;
loadMovie(videos[i].attributes.thumb, a.tHolder);
a.vName.text = videos[i].attributes.name;
a.vDesc.text = videos[i].attributes.desc;
a.numb = i;
a.urlLink = videos[i].attributes.url;
a.yLoc = (yBegin+(mask._height/2))-(a._y+(a._height/2));
a.onRelease = function() {
getNewVid(this);
};
a.onRollOver = function() {
if (this.numb<>whoIsOn) {
this._alpha = 100;
this.accent._alpha = 100;
this.back._alpha = 0;
}
};
a.onRollOut = a.onReleaseOutside=function () {
if (this.numb<>whoIsOn) {
this._alpha = 66;
this.accent._alpha = 0;
this.back._alpha = 100;
}
};
a.onRelease = function() {
if (this.numb<>whoIsOn) {
getNewVid(this);
}
};
}
yEnd = yBegin-videoList._height+mask._height+5;
getNewVid(listClips[whoIsOn]);
};
vlist.load("videos.xml");
videoList.onRollOver = scrollPanel;
function panelOver() {
speed = 10;
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = mask.getBounds(_root);
function scrollPanel() {
if (_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
var yDist = _ymouse-250;
videoList._y += -yDist/speed;
if (videoList._y>=yBegin) {
videoList._y = yBegin;
}
if (videoList._y<=yEnd) {
videoList._y = yEnd;
}
}
function getNewVid(who) {
ns.play(who.urlLink);
whoIsOn = who.numb;
z = who.yLoc;
if (z>=yBegin) {
z = yBegin;
}
if (z<=yEnd) {
z = yEnd;
}
easeList(z);
for (i=0; i<listClips.length; i++) {
if (listClips[i].numb == whoIsOn) {
listClips[i]._alpha = 100;
listClips[i].frame._alpha = 100;
listClips[i].back._alpha = 0;
listClips[i].accent._alpha = 0;
} else {
listClips[i]._alpha = 66;
listClips[i].frame._alpha = 0;
listClips[i].back._alpha = 100;
listClips[i].accent._alpha = 0;
}
}
}
function easeList(where) {
delete videoList.onRollOver;
delete videoList.onEnterFrame;
videoList.onEnterFrame = function() {
yDist = (videoList._y-where)/7;
videoList._y -= yDist;
if ((videoList._y<(where+2)) && (videoList._y>(where-2))) {
delete videoList.onEnterFrame;
videoList.onRollOver = panelOver;
}
};
}