Thomsa
%Europe/Berlin %382 %2008, 09:11
Hey iedereen,
ik ben een slideshow aan t maken waar de foto's uit een XML geladen worden en van rechts binnen komen schuiven op de stage. De slideshow werkt maar het loopen naar de eerste slide niet:
import mx.transitions.Tween;
import mx.transitions.easing.*;
setInterval(moveContent,1000);
function moveContent() {
var tween:Tween = new Tween(menu_mc, "_x", Strong.easeInOut, menu_mc._x, menu_mc._x-1024, 40, false);
if(menu_mc._x = -(menu_mc.width)+Stage.width){
menu_mc._x = 0;
}
}
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures[i];
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = i*Stage.width;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentP icture.attributes.thumb);
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
if (success) {
GeneratePortfolio(this);
} else {
trace("Error loading XML file");
}// no success? trace error (wont be seen on web)
};
portfolio_xml.load("xmlData.xml");
dit:
if(menu_mc._x = -(menu_mc.width)+Stage.width){
menu_mc._x = 0;
}
stukje zal denk ik anders moeten. Iemand een idee hoe dat te doen?
Thanks!
ik ben een slideshow aan t maken waar de foto's uit een XML geladen worden en van rechts binnen komen schuiven op de stage. De slideshow werkt maar het loopen naar de eerste slide niet:
import mx.transitions.Tween;
import mx.transitions.easing.*;
setInterval(moveContent,1000);
function moveContent() {
var tween:Tween = new Tween(menu_mc, "_x", Strong.easeInOut, menu_mc._x, menu_mc._x-1024, 40, false);
if(menu_mc._x = -(menu_mc.width)+Stage.width){
menu_mc._x = 0;
}
}
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures[i];
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = i*Stage.width;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentP icture.attributes.thumb);
}
}
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success) {
if (success) {
GeneratePortfolio(this);
} else {
trace("Error loading XML file");
}// no success? trace error (wont be seen on web)
};
portfolio_xml.load("xmlData.xml");
dit:
if(menu_mc._x = -(menu_mc.width)+Stage.width){
menu_mc._x = 0;
}
stukje zal denk ik anders moeten. Iemand een idee hoe dat te doen?
Thanks!