Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-08-2009, 19:34   #1 (permalink)
Neuer User
 
Registriert seit: Aug 2009
Beiträge: 7
PROBLEM: Flash Slideshow //XML

Hallo ihr Flash-Profis da draußen,
ich bekomme meine slideshow einfach nicht zum laufen.

Ziel:
- Implementierung der .swf auf meine portfolio page, und das laden der Bilder aus einem definierten Ordner.

Wo es hakt:
- Die Bilder werden aus dem selben Verzeichnis geladen, wie die .swf liegt.
- Offline auf meinem Rechner werden die Bilder aus den definierten Unterordnern angezeigt. Nur online bedient sich die .swf anscheinend dem gleichen Verzeichnis in dem sie liegt.

Die Daten mit .fla und allem anderen habe ich mal online gestellt.


Download meiner Datei: http://www.pc-tro.de/1_semester/gallery.zip

Hier der Code von der .fla:

Code:
MovieClip.prototype.addProperty("onLoad", function () {
	return __onLoadHandler__[this];
}, function (f) {
	if (__onLoadHandler__ == undefined) {
		_global.__onLoadHandler__ = {};
	}
	__onLoadHandler__[this] = f;
});
Math.easeInQuad = function(t, b, c, d) {
	return c*(t /= d)*t+b;
};
Math.easeOutQuad = function(t, b, c, d) {
	return -c*(t /= d)*(t-2)+b;
};
Stage.scaleMode = "noScale";
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function() {
	nodes = myXML.childNodes;
	// ----------------------
	// find first image
	// ----------------------
	if (topimage.length) {
		for (var i = 0; i<nodes.length; i++) {
			if (nodes[i].attributes.src == topimage) {
				var insert = nodes.slice(0, i);
				nodes.splice(0, i);
				nodes = nodes.concat(insert);
			}
		}
	}
	_root.gotoAndStop(2);
};
if (_url.indexOf("http")>-1) {
	myXML.load("gallery.php");
} else {
	myXML.load("gallery.xml");
}
stop();
Hier der Code von der .fla:
Code:
function drawOutline(mc, width, height) {
	var wallx = width/2+10;
	var wally = height/2+10;
	var offset = 4;
	// Shadow
	mc.beginFill(0x000000, 20);
	mc.moveTo(-wallx+offset, -wally+offset);
	mc.lineTo(wallx+offset, -wally+offset);
	mc.lineTo(wallx+offset, wally+offset);
	mc.lineTo(-wallx+offset, wally+offset);
	mc.lineTo(-wallx+offset, -wally+offset);
	// Outline
	mc.beginFill(0xFFFFFF, 100);
	mc.lineStyle(2, 0x333333, 100);
	mc.moveTo(-wallx, -wally);
	mc.lineTo(wallx, -wally);
	mc.lineTo(wallx, wally);
	mc.lineTo(-wallx, wally);
	mc.lineTo(-wallx, -wally);
	mc.endFill();
}
// ----------------------
// build placeholders
// ----------------------
loads = [];
stack = [];
depth = 9999;
for (i=0; i<nodes.length; i++) {
	attrs = nodes[i].attributes;
	img = _root.createEmptyMovieClip("image"+i, depth--);
	drawOutline(img, attrs.width, attrs.height);
	img.createEmptyMovieClip("imgholder", 1);
	img.imgholder._x = -attrs.width/2;
	img.imgholder._y = -attrs.height/2;
	img.imgholder.src = attrs.src;
	totalw += img._width;
	totalh += img._height;
	coverw = (img._width>coverw) ? img._width : coverw;
	coverh = (img._height>coverh) ? img._height : coverh;
	img._rotation = (Math.random()*16)-8;
	img._visible = false;
	img._alpha = 0;
	stack.push(img);
	loads.push(img);
}
stack[0]._rotation = 0;
gox = (totalw/nodes.length)*0.9;
goy = (-totalh/nodes.length)*0.4;
// ----------------------
// load images
// ----------------------
function loadimage(id) {
	if (loads[id]) {
		loads[id]._visible = true;
		loads[id].imgholder.loadMovie(loads[id].imgholder.src);
		loads[id].imgholder.onLoad = function() {
			loads[id].imgholder.onEnterFrame = function() {
				if (this._parent._alpha<75) {
					this._parent._alpha += 25;
				} else if (this._parent._alpha<100) {
					this._parent._alpha += 25;
					loadimage(id+1);
				} else {
					delete this.onEnterFrame;
				}
			};
		};
	}
}
loadimage(0);
// ----------------------
// handle swap
// ----------------------
_root.createEmptyMovieClip("Cover", 10000);
Cover.beginFill(0xFFFFFFF, 0);
Cover.moveTo(-coverw/2, -coverh/2);
Cover.lineTo(coverw/2, -coverh/2);
Cover.lineTo(coverw/2, coverh/2);
Cover.lineTo(-coverw/2, coverh/2);
Cover.lineTo(-coverw/2, -coverh/2);
Cover.endFill();
Cover.onRelease = function() {
	// Shuffle the top image to the side
	stack[0].t = 0;
	stack[0].rot = stack[0]._rotation;
	stack[0].changerot = (Math.random()*16)-8-stack[0].rot;
	stack[0].onEnterFrame = function() {
		this.t++;
		this._x = Math.easeInQuad(this.t, 0, gox, 6);
		this._y = Math.easeInQuad(this.t, 0, goy, 6);
		this._rotation = Math.easeInQuad(this.t, this.rot, this.changerot, 6);
		if (this.t == 7) {
			this.swapDepths(depth--);
			this.t = 0;
			this.onEnterFrame = function() {
				this.t++;
				this._x = Math.easeOutQuad(this.t, gox, -gox, 6);
				this._y = Math.easeOutQuad(this.t, goy, -goy, 6);
				if (this.t == 6) {
					delete this.onEnterFrame;
				}
			};
		}
	};
	// Rotate the next image into view
	stack[1]._x = stack[1]._y=0;
	stack[1].t = 0;
	stack[1].rot = stack[1]._rotation;
Hier der Code von der gallery.xml:
Code:
<?xml version=\"1.0\" ?>
<img src="animal.jpg" width="466" height="548" />
<img src="just_married.jpg" width="389" height="578" />
<img src="richard_mackson.jpg" width="473" height="316" />
<img src="sinister.jpg" width="480" height="360" />
<img src="superdog.jpg" width="500" height="339" />
<img src="st_helens.jpg" width="479" height="480" />
Hier der Code von der .php:
Code:
<?
$xml = '<?xml version="1.0"?'.'>';
$handle = opendir(".");
while ( ($file=readdir($handle)) !== false ) {
	if ( !is_dir($file) ){
		$pic = @getimagesize($file);
		if($pic != false && $pic[2] == 2){
			$xml .= '<img src="'.$file.'" width="'.$pic[0].'" height="'.$pic[1].'" />';
		}
	}
}
echo $xml;
?>
DeSchroe ist offline   Mit Zitat antworten
Alt 11-08-2009, 10:04   #2 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
Zitat:
Zitat von DeSchroe Beitrag anzeigen
Nur online bedient sich die .swf anscheinend dem gleichen Verzeichnis in dem sie liegt.
Sobald die swf in einer html-Datei angezeigt wird,
musst Du den Pfad von der html-Seite aus angeben.

gruß, gaspode
gaspode ist offline   Mit Zitat antworten
Alt 11-08-2009, 10:14   #3 (permalink)
Neuer User
 
Registriert seit: Aug 2009
Beiträge: 7
Ja, das ist mir schon klar. Aber selbst dann funktioniert es nicht!

Kann mir jemand schreiben, wie die Pfadangabe sein sollte? Denn ich hab wirklich alles ausprobiert, und es funktioniert nicht.
PHP, Mysql und alles weitere läuft. Am Server liegts nicht, da ich's auf drei ganz unterschiedlichen Servern getestet hab

Hat niemand eine Idee?
DeSchroe ist offline   Mit Zitat antworten
Alt 11-08-2009, 10:22   #4 (permalink)
Nix Wisser
 
Benutzerbild von nullidee
 
Registriert seit: May 2003
Ort: Würzburg, Kleinstadt
Beiträge: 3.510
ich sehe da aber nirgends eine Pfadangabe!

Die Pfadangabe brauchts aber
__________________
nullidee

Abakus GT 10² Kugeln - 80"Leinwand - CARAN D´ACHE SUPRACOLOR®
nullidee ist offline   Mit Zitat antworten
Alt 11-08-2009, 11:16   #5 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
Hast Du das online irgendwo laufen (nicht zum download)?

gruß, gaspode
gaspode ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
gallery, problem, slideshow, xml

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


LinkBacks (?)
LinkBack zu diesem Thema: http://www.flashforum.de/forum/actionscript-1/problem-flash-slideshow-xml-273994.html
Erstellt von Für Art Datum Hits
Flash Slideshow - Bilder laden online nicht - Das Hilfe, HTML und Webmaster Forum Dieses Thema Refback 29-08-2009 19:44 29
Flash Slideshow - Bilder laden online nicht - Das Hilfe, HTML und Webmaster Forum Dieses Thema Refback 23-08-2009 20:46 1


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:56 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele