Toon posts:

Flash - XML probleempje

Pagina: 1
Acties:
  • 34 views sinds 30-01-2008

Verwijderd

Topicstarter
Hoi,

Kben bezig om wat te stoeien met flash mx en xml.

Kheb een menu en daarnaast een foto proberen te maken maar het lukt niet echt.
De info komt uit test.xml
Onafhankelijk werkt dit:

fotoXML = new XML();
fotoXML.ignoreWhite = true;
fotoXML.onLoad = function(success) {
if (success) {
childs = fotoXML.firstChild.childNodes;
fotos = childs.length;
full = new Array();
for (var i=0;i<childs.length;i++) {
fot = _root.createEmptyMovieClip("foto"+i,i);
dummy = _root.createEmptyMovieClip("dummy"+i, 2*fotos+2+i);
dummy.fot = i;
with(fot) {
_x = 165;
_y = 5 + 80*i;
}

full[i] = childs[i].firstChild.nodeValue;
fot.loadMovie(childs[i].attributes.thumb);
dummy.onEnterFrame = function () {
var tmp = _root["foto"+this.fot];
if ((tmp.getBytesLoaded()>100) && (tmp.getBytesTotal()==tmp.getBytesLoaded()) && (tmp._height>0)) {
delete this.onEnterFrame;
tmp.id = this.fot;
tmp._width=70;
tmp._height=70;
tmp.onRelease = function() {
_root.createEmptyMovieClip("fullfoto", fotos+1);
_root.createEmptyMovieClip("dummy", fotos+2);
fullfoto.loadMovie(full[this.id]);
dummy.onEnterFrame = function() {
if ((fullfoto.getBytesTotal()==fullfoto.getBytesLoaded()) && (fullfoto.getBytesLoaded()>100)) {
delete this.onEnterFrame;
fullfoto._width = fullfoto._width;
fullfoto._height = fullfoto._height;
fullfoto._x = 10;
fullfoto._y = 10;
fullfoto.onRelease = function() {
fullfoto.removeMovieClip();
}
}
}
}
}
}
}
}
}
fotoXML.load("test.xml");


en dit :


menuXML = new XML();
menuXML.ignoreWhite = true;
menuXML.onLoad = function(success) {
if (success) {
menuItem = menuXML.firstChild.childNodes;
for (var i=0; i<menuItem.length; i++) {
item = _root.attachMovie("itemClip", "itemClip" + i, i);
item._x = 0;
item._y = 20*i;
item.itemLabel.text = menuItem[i].attributes.name;
item.myUrl = menuItem[i].attributes.url;
item.onRelease = function() {
getURL(this.myUrl,"_blank");
}
}
}
}
menuXml.load("test.xml");

Maar ik wil ze integreren.
Iemand een idee?
thx

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Ja

Ik heb een idee.

Lezen: HTML, JavaScript en Flash topics *13-01*

edit:
en ik heb het vermoeden dat de rest van de stickies lezen ook wel op zijn plaats zou zijn ;)

[ Voor 32% gewijzigd door drm op 07-03-2003 16:43 ]

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • whoami
  • Registratie: December 2000
  • Laatst online: 23-08 23:02
Ja.
Het idee is dat het hier geen helpdesk is, en je even de quickstart moet lezen. Dit topic is nl. allesbehalve duidelijk. Wat wil je precies? Wat lukt er niet? Wat heb je al geprobeerd? etc....
Flash hoort trouwens ook thuis in W&G, niet in P&W.

https://fgheysels.github.io/


Dit topic is gesloten.