Thursday, July 29th 2010, 1:27pm UTC+2

You are not logged in.

  • Login
  • Register

[Flash & XML] Flash --- xml anzeige

Tschdaeff

Super Moderator

Posts: 4,062

Location: Ba-Wü

1

Monday, January 5th 2004, 5:27pm

Flash --- xml anzeige

Hier mal mein xml einstieg... ich hab noch ziemliche probleme mit den pfaden und befehlen firstChild und so kenne ich alles nicht

PHP Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version='1.0' encoding='WINDOWS-1252' ?>
<menue>
    <forum>
        <team>
            <mod>Madokan</mod>
            <mod>Miesel</mod>
            <mod>Ming</mod>
            <mod>Kelor</mod>
            <mod>Sven</mod>
            <mod>Tschdaeff</mod>
        </team>
        <foren>
            <topic>Flash alle Versionen</topic>
            <topic>Flash inkl. Action-Sctipt</topic>
            <topic>ServerSeitiges</topic>
            <topic>Grafik</topic>
        </foren>
        <news>
            <info>Tschdaeffs Xml Menue</info>
            <info>Tschdaeffs Xml Menue</info>
            <info>Tschdaeffs Xml Menue</info>
        </news>
    </forum>
</menue>


ActionScript-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
mods = []
topics = []
info = []

clips = function () {
for (var i=0;i<mods.length;i++) {
    ebene++
    _root.attachMovie("clip","mc"+ebene,ebene,{_x:100,_y:ebene*20+50})
    _root["mc"+ebene].output.text mods[i]
}
for (var i=0;i<topics.length;i++) {
    ebene++
    _root.attachMovie("clip","mc"+ebene,ebene,{_x:100,_y:ebene*20+70})
    _root["mc"+ebene].output.text topics[i]
}
for (var i=0;i<info.length;i++) {
    ebene++
    _root.attachMovie("clip","mc"+ebene,ebene,{_x:100,_y:ebene*20+90})
    _root["mc"+ebene].output.text info[i]
}
}

= new XML ();
f.ignoreWhite true;
f.load ("menu.xml");

f.onLoad = function (ok) {
    if (ok) {
        team this.firstChild.firstChild.childNodes[0]
        for (var i=0;i<team.childNodes.length;i++) {
            mods.push (team.childNodes[i].firstChild)
        }
        foren this.firstChild.firstChild.childNodes[1]
        for (var i=0;i<foren.childNodes.length;i++) {
            topics.push (foren.childNodes[i].firstChild)
        }
        news this.firstChild.firstChild.childNodes[2]
        for (var i=0;i<news.childNodes.length;i++) {
            info.push (news.childNodes[i].firstChild)
        }
        clips ()
    }
}


könnt ja mal reinschaun

cu mfg
Tschdaeff
Tschdaeff has attached the following file:
  • menu.zip (3.08 kB - 249 times downloaded - Last download: Feb 8th 2010, 2:27pm)
  • Go to the top of the page

Sven G.

Administrator

Posts: 3,343

Location: NRW / Bochum

2

Monday, January 5th 2004, 9:18pm

Sieht doch recht gut aus!
Hatte auch mal so was ähnliches gemacht, ist aber schon bestimmt 6 Monate oder noch älter das Coding...

ActionScript-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
_root.createEmptyMovieClip("halter"1000);
mein_xml = new XML();
mein_xml.ignoreWhite true;
mein_xml.load("daten.xml");
mein_xml.onLoad = function(status) {
    if (status) {
        daten_xml this.firstChild.firstChild.childNodes;
        for (i=0i<this.firstChild.firstChild.childNodes.lengthi++) {
            _root.halter.attachMovie("punkte""punkte"+ii);
            _root.halter['punkte'+i]._y i*17;
            _root.halter['punkte'+i].inhalt_txt.text daten_xml[i].attributes.titel;
            _root.halter['punkte'+i].link daten_xml[i].attributes.adresse;
            //trace(daten_xml[i].attributes.titel)
        }
    }
};

Source code

1
2
3
4
5
6
7
8
9
10
11
<?xml version='1.0' encoding='WINDOWS-1252' ?>
<links>
	<inhalt>
		<menu titel="Flashbattle.de" adresse="http://www.flashbattle.de.de"></menu>
		<menu titel="heise.de" adresse="http://www.heise.de"></menu>
		<menu titel="waz.de" adresse="http://www.waz.de"></menu>
		<menu titel="shortnews.de" adresse="http://www.shortnews.de"></menu>
		<menu titel="flashstar.de" adresse="http://www.flashstar.de"></menu>
		<menu titel="zdf.de" adresse="http://www.zdf.de"></menu>
	</inhalt>
</links>
Sven G. has attached the following file:
  • dynmenue.zip (3.82 kB - 197 times downloaded - Last download: Apr 1st 2010, 5:32pm)
Mit freundlichen Grüßen
Sven Gasser @ BountyKiller.de
Flashbattle.deGründer
webmaster@flashbattle.de
Flashbattle.de ActionScript Referenz
DELTA Agentur - Agentur für Werbung & Kommunikation
News aus der Medienwelt & mehr @ Delta Agentur twittert

(Kein Support per eMail, PN oder ICQ)

Irren ist menschlich, aber für das totale Chaos braucht man einen Computer :)
http://twitter.com/deltaagentur
  • Go to the top of the page

Madokan

Super Moderator

Posts: 1,654

Location: US/Germany

3

Monday, January 5th 2004, 10:12pm

Beide Beispiel sind ein guter Einstieg - bin sicher da werde einige Ihre Freude dran haben. :)

Liebe Grüsse
Matze K.
[Flashstar]
Flashstar Site
[ActionScript - Praxis]
ActionScript Praxis - Buchinfo
[Flash 8 - HotStuff Buch]
Bestellung
[Flash 8 - Professional Series Buch]
Bestellung
[Flash CS3 Powerworkshops]
Bestellung
  • Go to the top of the page