Zurück   Flashforum > Flash und Server > Flash mit XML und Webservices

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-12-2009, 18:14   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 5
Undefined?

hallo zusammen,

ich bin neu hier und werde mich hier bei zeiten noch genauer vorstellen.

Vorweg: Ich bau gerade eine Flash-Seite für unsere Partyreihe am linken Niederrhein.

Projekt: http://enjoi-media.de/****/gs/v3/
(hier wird auf seite 1 - News kein inhalt ausgelesen)

XML: http://enjoi-media.de/****/gs/v3/sebNews.xml (original)
http://enjoi-media.de/****/gs/v3/sebNews.xml.php (verwendetes per php gefüttertes xml)

**** = sh it

bin ich blöd? ich finde einfach den fehler nicht.

danke schonmal ich bin hier fast am verzweifeln
Grafix ist offline   Mit Zitat antworten
Alt 08-12-2009, 20:42   #2 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Und was ist der Fehler? Aus drei URLs geht ja erst mal gar nichts hervor...
  Mit Zitat antworten
Alt 08-12-2009, 22:48   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 5
ach so sorry...also in der ausgabe steht halt immer undefined und nicht der inhalt der da ausgelesen werden soll

Geändert von Grafix (08-12-2009 um 23:01 Uhr)
Grafix ist offline   Mit Zitat antworten
Alt 09-12-2009, 07:50   #4 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Welche "Ausgabe"? Mit welchem Script? Geh mal davon aus, dass unser Hellsehermodus derzeit offline ist und du das ganze etwas genauer erklären solltest...
  Mit Zitat antworten
Alt 09-12-2009, 12:20   #5 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 5
okey - sorry für meinen undeutlichen ausdruck.

ich verwende auf der Seite News das SebNews System, welche hier im Forum unter Stuff steht.

das ganze hat auch wunderbar funktioniert, bis ich die die xml datei mit php generieren und includen wollte.

ich poste mal mein as, wenn erforderlich auch die fla

Code:
// setup stage
// import tween stuff
import mx.transitions.Tween;
import mx.transitions.easing.*;
// array has 9 positions for 7 visible and 2 invisible (fade-in/fade-out) MC
var arrPositions:Array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
var arrPositionY:Array = new Array(0, 3, 4, 9, 14, 15, 16, 17, 21);
// define some colors
var arrColors:Array = new Array(
	["back", "0x333333"],
	["white", "0xFFFFFF"],
	["orange", "0xFF9900"],
	["blue", "0xffffff"],
	["darkblue", "0x0099FF"],
	["gray", "0x999999"],
	["black", "0x000000"],
	["darkgrey", "0x333333"]);
// overall position of news
var numX:Number = 12;
var numY:Number = 10;
// height of one news line
var numNewsLineHeight:Number = 20;
// height of one news line
var numNewsBackHeight:Number = 250;
// init xml content variables
var numLastNewsEntry:Number = 0;
var numThisNewsEntry:Number = 0;
// use a stylesheet
var tfsStyles:TextField.StyleSheet = new TextField.StyleSheet();
// xml objects for loading and parsing xml content
var xmlLoad = new XML();
var xmlRead = new XML();
// boolean to lock mouse clicks
var booLock:Boolean = false;
// boolean for which of the 2 news boxes, a or b, is active
var booNewsBoxA:Boolean = false;
// ignore whitespaces
xmlLoad.ignoreWhite = true;
// if xml has loaded
xmlLoad.onLoad = function(success) {
	if (success) {
		xmlRead.parseXML(xmlLoad);
		numLastNewsEntry = numThisNewsEntry=arrPositions[8]=parseInt(xmlRead.idMap["Properties"].attributes.lastEntry);
		// build the news mc by dublicating mcNewsLine
		fctInitNews();
	}
};
// if css has loaded
tfsStyles.onLoad = function(success) {
	if (success) {
		xmlLoad.load("sebNews.xml.php");
	}
};
// begin by loading css
tfsStyles.load("sebNews.css");
// fctBuildNewsLine
function fctBuildNewsLine():Void {
	for (var i:Number = numLastNewsEntry; i>0; i--) {
		this.attachMovie("mcNewsLine", "mcNewsLine"+i, this.getNextHighestDepth(), {_x:numX, _y:(numY+(arrPositionY[8]*numNewsLineHeight))});
		var mcNewsLine:MovieClip = this["mcNewsLine"+i];
		// make invisible for start
		mcNewsLine._alpha = 0;
		// make inactive
		mcNewsLine.enabled = false;
		// remember the id from xml
		mcNewsLine.var_id = i;
		// add the date from xml
		mcNewsLine.tfNewsDate.textColor = arrColors[3][1];
		mcNewsLine.tfNewsDate.text = String(xmlRead.idMap[i+"D"].firstChild.nodeValue);
		// add the headline from xml
		mcNewsLine.tfNewsHead.textColor = arrColors[3][1];
		mcNewsLine.tfNewsHead.text = String(xmlRead.idMap[i+"H"].firstChild.nodeValue).toUpperCase();
		mcNewsLine.mxt = new Tween(mcNewsLine.mcSelect, "_alpha", Strong.easeIn, 100, 0, 0.5, true);
		mcNewsLine.mxt.fforward();
		// mouse over
		mcNewsLine.btSensor.onRollOver = function():Void  {
			this._parent.mxt.stop();
			this._parent.mxt.rewind();
		};
		// mouse press
		mcNewsLine.btSensor.onPress = function():Void  {
			this._parent.tfNewsHead.textColor = arrColors[2][1];
			this._parent.tfNewsDate.textColor = arrColors[2][1];
			this._parent.mcSelect._visible = false;
		};
		// mouse out and drag out 
		mcNewsLine.btSensor.onRollOut = mcNewsLine.btSensor.onDragOut=function ():Void {
			this._parent.tfNewsHead.textColor = arrColors[3][1];
			this._parent.tfNewsDate.textColor = arrColors[3][1];
			this._parent.mcSelect._visible = true;
			this._parent.mxt.start();
		};
		// mouse click
		mcNewsLine.btSensor.onRelease = function():Void  {
			this._parent.tfNewsHead.textColor = arrColors[3][1];
			this._parent.tfNewsDate.textColor = arrColors[3][1];
			this._parent.mcSelect._visible = true;
			this._parent.mxt.fforward();
			if (booLock == false) {
				fctGotoNewsLine(this._parent.var_id);
			}
		};
		// hide bottom of last mcNewsLine
		if (i == 1) {
			mcNewsLine.mcBottom._visible = false;
		}
	}
}
// fctBuildNewsBack
function fctBuildNewsBack():Void {
	this.attachMovie("mcNewsBack", "mcNewsBack", this.getNextHighestDepth(), {_x:numX, _y:(numY+((arrPositionY[2]+1)*numNewsLineHeight))});
	var mcNewsBack:MovieClip = this["mcNewsBack"];
	// mouse release (scroll up)
	mcNewsBack.btUp.onRelease = function():Void  {
		if (booLock == false) {
			fctMoveNewsLine(-1);
		}
	};
	// mouse release (scroll down)
	mcNewsBack.btDown.onRelease = function():Void  {
		if (booLock == false) {
			fctMoveNewsLine(1);
		}
	};
}
// fctBuildNewsBox
function fctBuildNewsBox():Void {
	// create 2 news boxes, a and b, and initially position them outside news back
	this.attachMovie("mcNewsBox", "mcNewsBoxA", this.getNextHighestDepth(), {_x:numX, _y:numY});
	this.attachMovie("mcNewsBox", "mcNewsBoxB", this.getNextHighestDepth(), {_x:numX, _y:numY});
	// attach masks
	this.attachMovie("mcNewsBackMask", "mcNewsBackMaskA", this.getNextHighestDepth(), {_x:numX, _y:(numY+((arrPositionY[2]+1)*numNewsLineHeight))});
	this.attachMovie("mcNewsBackMask", "mcNewsBackMaskB", this.getNextHighestDepth(), {_x:numX, _y:(numY+((arrPositionY[2]+1)*numNewsLineHeight))});
	// attach frame which contains linear filling for top and bottom fade outs
	this.attachMovie("mcNewsFrame", "mcNewsFrame", this.getNextHighestDepth(), {_x:numX, _y:(numY+((arrPositionY[2]+1)*numNewsLineHeight))});
	// apply styles to tf
	this.mcNewsBoxA.tfNewsFull.styleSheet = tfsStyles;
	this.mcNewsBoxB.tfNewsFull.styleSheet = tfsStyles;
	// set tf to html content
	this.mcNewsBoxA.tfNewsFull.html = true;
	this.mcNewsBoxB.tfNewsFull.html = true;
	// attach mask to 2 news boxes
	this.mcNewsBoxA.setMask(this.mcNewsBackMaskA);
	this.mcNewsBoxB.setMask(this.mcNewsBackMaskB);
	// fill news box b initially with "", this is needed for the first tween
	this.mcNewsBoxB.tfNewsNice.text = "";
	this.mcNewsBoxB.tfNewsHead.text = "";
	this.mcNewsBoxB.tfNewsFull.htmlText = "";
}
// fctUpdateNewsBox
function fctUpdateNewsBox(numUpdateNewsID:Number, numScrollDir:Number):Void {
	// check for valid news id
	if(numUpdateNewsID >= 1 && numUpdateNewsID <= numLastNewsEntry)
	{		
		if (booNewsBoxA == true)
		{
			booNewsBoxA = false;
			fctFillNewsBox(this.mcNewsBoxB, numUpdateNewsID);
			fctMoveNewsBox(this.mcNewsBoxA, this.mcNewsBoxB, numScrollDir);
		}
		else if (booNewsBoxA == false)
		{
			booNewsBoxA = true;
			fctFillNewsBox(this.mcNewsBoxA, numUpdateNewsID);
			fctMoveNewsBox(this.mcNewsBoxB, this.mcNewsBoxA, numScrollDir);
		}
	}
}
// fctMoveNewsBox
function fctMoveNewsBox(mcNewsBox1:MovieClip, mcNewsBox2:MovieClip, numScrollDir:Number):Void {
	// lock buttons while tweening
	booLock = true;
	// the one that moves out
	var mxt0 = new Tween(mcNewsBox1, "_y", Strong.easeOut, numY+((arrPositionY[2]+1)*numNewsLineHeight), numY+((arrPositionY[2]+1)*numNewsLineHeight)-(numScrollDir*numNewsBackHeight), 0.5, true);
	// the one that moves in
	var mxt1 = new Tween(mcNewsBox2, "_y", Strong.easeOut, numY+((arrPositionY[2]+1)*numNewsLineHeight)+(numScrollDir*numNewsBackHeight), numY+((arrPositionY[2]+1)*numNewsLineHeight), 0.5, true);
	// count mxt interations
	var mxtCount:Number = 0;
	// if both tweens are finished
	mxt0.onMotionFinished = mxt1.onMotionFinished = function():Void  {
		if (++mxtCount == 2) {
			// unlock buttons after tweening
			booLock = false;
		}
	}
}
// fctFillNewsBox
function fctFillNewsBox (mcUpdate:MovieClip, numUpdateNewsID:Number):Void {
	mcUpdate.tfNewsNice.text = String(xmlRead.idMap[numUpdateNewsID+"N"].firstChild.nodeValue);
	mcUpdate.tfNewsHead.text = String(xmlRead.idMap[numUpdateNewsID+"H"].firstChild.nodeValue);
	mcUpdate.tfNewsFull.htmlText = String(xmlRead.idMap[numUpdateNewsID+"F"].firstChild.nodeValue);
}
Grafix ist offline   Mit Zitat antworten
Alt 09-12-2009, 12:20   #6 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 5
und teil zwei

Code:
// fctRecursiveNewsLineDown
function fctRecursiveNewsLineDown(arrPosition:Number):Number {
	// if there is a mc at position arrPosition in arrPositions
	if (arrPositions[arrPosition]>0) {
		// make a reference to mc
		var mcNewsLine:MovieClip = this["mcNewsLine"+arrPositions[arrPosition]];
		// switch arrPosition
		switch (arrPosition) {
			// if this mc is at the top (start of arry)
		case 1 :
			// fade out
			mcNewsLine.btSensor.enabled = false;
			var myTween:Tween = new Tween(mcNewsLine, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
			break;
			// if this mc was below newsbox
		case 3 :
			// enable
			mcNewsLine.btSensor.enabled = true;
			//mcNewsLine._visible = true;
			break;
			// if this mc is below newsbox
		case 4 :
			// disable
			mcNewsLine.btSensor.enabled = false;
			//mcNewsLine._visible = false;
			break;
			// if this mc is at the bottom (end of array)
		case 8 :
			// fade in
			mcNewsLine.btSensor.enabled = true;
			var myTween:Tween = new Tween(mcNewsLine, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
			break;
		default :
			break;
		}
		// motion tween
		var myTween:Tween = new Tween(mcNewsLine, "_y", Strong.easeOut, numY+(arrPositionY[arrPosition]*numNewsLineHeight), numY+(arrPositionY[arrPosition-1]*numNewsLineHeight), 0.5, true);
		if ((arrPosition+1)<arrPositions.length) {
			fctRecursiveNewsLineDown(arrPosition+1);
		}
	} else if ((arrPosition+1)<arrPositions.length) {
		fctRecursiveNewsLineDown(arrPosition+1);
	}
	// return the number of mc_n now showing     
	return arrPositions[4];
}
// fctRecursiveNewsLineUp
function fctRecursiveNewsLineUp(arrPosition:Number):Number {
	// if there is a mc at position arrPosition in arrPositions
	if (arrPositions[arrPosition]>0) {
		// make a reference to mc
		var mcNewsLine:MovieClip = this["mcNewsLine"+arrPositions[arrPosition]];
		// switch arrPosition
		switch (arrPosition) {
			// if this mc is at the top (start of arry)
		case 0 :
			// fade in
			mcNewsLine.btSensor.enabled = true;
			var myTween:Tween = new Tween(mcNewsLine, "_alpha", Strong.easeOut, 0, 100, 0.5, true);
			break;
			// if this mc is below newsbox
		case 2 :
			// disable
			mcNewsLine.btSensor.enabled = false;
			//mcNewsLine._visible = false;
			break;
			// if this mc was below newsbox
		case 3 :
			// enable
			mcNewsLine.btSensor.enabled = true;
			//mcNewsLine._visible = true;
			break;
			// if this mc is at the bottom (end of array)
		case 7 :
			// fade out
			mcNewsLine.btSensor.enabled = false;
			var myTween:Tween = new Tween(mcNewsLine, "_alpha", Strong.easeOut, 100, 0, 0.5, true);
			break;
		default :
			break;
		}
		// motion tween
		var myTween:Tween = new Tween(mcNewsLine, "_y", Strong.easeOut, numY+(arrPositionY[arrPosition]*numNewsLineHeight), numY+(arrPositionY[arrPosition+1]*numNewsLineHeight), 0.5, true);
		if ((arrPosition-1)>=0) {
			fctRecursiveNewsLineUp(arrPosition-1);
		}
	} else if ((arrPosition-1)>=0) {
		fctRecursiveNewsLineUp(arrPosition-1);
	}
	// return the number of mc_n now showing     
	return arrPositions[2];
}
// fctInitNews
function fctInitNews():Void {
	fctBuildNewsLine();
	fctBuildNewsBack();
	fctBuildNewsBox();
	// loop to bring latest news to show
	for (var i:Number = 0; i<5; i++) {
		// scroll news down (1)
		fctMoveNewsLine(1);
	}
}
// fctMoveNewsLine
function fctMoveNewsLine(numScrollDir:Number):Void {
	// scroll down news (1)
	if (numScrollDir == 1) {
		// read arrPositions
		var numLowerBound:Number = arrPositions[8];
		var numShowsBound:Number = arrPositions[4];
		if (numLowerBound>1) {
			numThisNewsEntry = fctRecursiveNewsLineDown(1);
			// update the news box
			fctUpdateNewsBox(numThisNewsEntry, numScrollDir);
			arrPositions.push(numLowerBound-1);
			arrPositions.shift();
		} else if (numLowerBound<=1 && numShowsBound>0) {
			numThisNewsEntry = fctRecursiveNewsLineDown(1);
			// update the news box
			fctUpdateNewsBox(numThisNewsEntry, numScrollDir);
			arrPositions.push(0);
			arrPositions.shift();
		}
	} else if (numScrollDir == -1) {
		// read arrPositions
		var numUpperBound:Number = arrPositions[0];
		var numShowsBound:Number = arrPositions[2];
		if (numUpperBound>0 && numUpperBound<numLastNewsEntry) {
			numThisNewsEntry = fctRecursiveNewsLineUp(8);
			// update the news box
			fctUpdateNewsBox(numThisNewsEntry, numScrollDir);
			arrPositions.unshift(numUpperBound+1);
			arrPositions.pop();
		} else if (numShowsBound>0) {
			numThisNewsEntry = fctRecursiveNewsLineUp(8);
			// update the news box
			fctUpdateNewsBox(numThisNewsEntry, numScrollDir);
			arrPositions.unshift(0);
			arrPositions.pop();
		}
	}
}
// fctGotoNewsLine
function fctGotoNewsLine(myGotoNewsID:Number):Void {
	// requested myGotoNewsID must be greater than 0 and less than numLastNewsEntry (news number)
	if (myGotoNewsID>0 && myGotoNewsID<=numLastNewsEntry) {
		var numTempNewsEntry:Number = 0;
		// if requested myGotoNewsID is greater than numThisNewsEntry (news showing)
		if (myGotoNewsID>numThisNewsEntry) {
			while (myGotoNewsID != numThisNewsEntry) {
				fctMoveNewsLine(-1);
			}
		} else if (myGotoNewsID<numThisNewsEntry) {
			while (myGotoNewsID != numThisNewsEntry) {
				fctMoveNewsLine(1);
			}
		}
	}
}
// setup listener for stage resize
objResizeListener = new Object();
objResizeListener.onResize = function() {
	fctResizeStage();
};
// add listener to stage
Stage.addListener(objResizeListener);
// fctResizeStage
MovieClip.prototype.fctResizeStage = function():Void {
	this.gfBack._width = Math.ceil(Stage.width);
	this.gfBack._height = Math.ceil(Stage.height);
};
// fctSetRGB
MovieClip.prototype.fctSetRGB = function(numColor:Number):Void {
	new Color(this).setRGB(numColor);
};
// do an initial resize
fctResizeStage();
// color gfBack with back color
this.gfBack.fctSetRGB(arrColors[0][1]);
Grafix ist offline   Mit Zitat antworten
Alt 09-12-2009, 14:18   #7 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 5
ach habs schon gefunden hab die id in der xml.php nicht in "" gesetzt
Grafix ist offline   Mit Zitat antworten
Antwort

Lesezeichen

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


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
undefined DiNozzo Flash Einsteiger 9 26-07-2008 18:09
Undefined labrar Flash MX 2004 8 28-11-2005 15:58
xml undefined ninjja Flash MX 2004 11 17-11-2005 13:55
undefined? Ballu Flash MX 2004 19 11-05-2005 13:01
undefined? Anfaenger2 Flash MX 2004 3 09-05-2005 16:51


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

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


Copyright ©1999 – 2012 Marc Thiele