| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: Apr 2007
Beiträge: 2
|
Ich habe einen Flash RSS Reader, der mit PHP und einer Txt.Datei arbeitet. In die txt Datei schreibe ich die Newsfeedurls, die dann an das PHP Skript gegeben werden und dann von Flash eingelesen werden. Nun kann ich in Flash entscheiden, welche News eingelesen werden soll. Ich habe nun einige Zeit versucht, das AS in Flash so umzuschreiben, dass nicht eine News eingelesen wird, sondern dass sich Flash alle News, die in die txt geschrieben wurden herausholt und nach Uhrzeit sortiert den letzten neuen Beitrag ausgibt, aber ich schaffe es nicht und bin auch ein Newbie auf dem AS-Sektor. Kann mir irgendjemand erklären, wie ich das Skript in Flash abändern muss, damit ich das mal verstehe? Hier ist das AS: System.useCodePage = true; //Change the style of components globalStyleFormat.face = 0x0099FF; globalStyleFormat.arrow = 0x0000CC; globalStyleFormat.textColor = 0xFFFFFF; globalStyleFormat.background = 0x0099FF; globalStyleFormat.shadow = 0x0000FF; globalStyleFormat.selection = 0x6666FF; globalStyleFormat.scrollTrack = 0x6666FF; globalStyleFormat.applyChanges(); // CLASS news = function(){ this.datos = new LoadVars(); this.datos.ref = this; this.sources = new Array(); this.txt = false; } news.prototype.loadInfo = function(source){ this.datos.load("Rsstxt.php?source="+escape(source )+"&"+Math.random()); //getURL("Rsstxt.php?source="+escape(source)+"&"+Mat h.random(), "_new"); loadingBar._visible = true; this.datos.onLoad = function(succes){ loadingBar._visible = false; this.ref.displayInfo(this); } } news.prototype.displayInfo = function(obj){ this.txt = obj.txt; txtMain.htmlText = this.txt; } news.prototype.init = function(){ this.datos.load("Rssfeeds.txt"); this.datos.onLoad = function(succes){ if(succes){ for(var i=1; i<=this.cant; i++) sourceList.addItem(eval("this.Name"+i), eval("this.Uri"+i)); this.ref.loadInfo(this.Uri1) //first item defaul on init() } else { loadingBar._visible=false; txtMain.text = "Couldn't read the data" } } } myNews = new news(); myNews.init(); sourceList.setChangeHandler("loadInfo"); // ChangeHandler couldn't call directly a class method, // instead should be redirected function loadInfo(comp){ myNews.loadInfo(comp.getSelectedItem().data); } Geändert von marcuse (30-04-2007 um 11:49 Uhr) |
| | |
| | #3 (permalink) |
| Perverted Hermit Registriert seit: Mar 2004 Ort: Delmenhorst
Beiträge: 12.138
|
Benutzt doch lieber XML, das dürfte sich ähnlich schreiben lassen. Dann noch eine Klasse, die die Einträge verwaltet. Ein Eintrag wird in eigenes Objekt geschrieben. Vorteil für XML: einfache Struktur Vorteil für Klassen: Struktur lässt sich 1:1 adaptieren und anzeigen.
__________________ http://icodeapps.net | Meet me at the Flex user group Hamburg talking about CoffeeScript |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |