Position für XML Slideshow (Flash, AS2)

raiuno

Grünschnabel
Hallo, wer kann mir helfen?

Ich habe hier ein AS2 Script für eine Slideshow, die Bilder werden mit einer XML-Datei
aus einem Ordner geladen, und auf der Flash-Bühne in der linken, obere Ecke positioniert.

Ich möchte die Position der Slideshow von links-oben aber verändern (zb. bei einer
anderen Dokumenten/Bühnengröße). Als Anfänger bin ich ratlos: ich habe ein Symbol (Movieclip, leer)
mit dem Instanznamen"container_mc" erstellt und hier das Script eingebunden.

Ergebnis: die Slideshow bleibt in der linken, oberen Ecke (- auch wenn ich den Registrierungspunkt vom MC versetze).

Ich finde in dem Script auch keine " x,y " Position zum verändern. Hier das Script:

// XML-File
var xmlfilename:String = new String("files.xml");

// Standard values
var Path:String = new String("");
var fadeInTime:Number = new Number(1);
var nextPicTime:Number = new Number(2);

// Deklare the variables
var Pictures:Array = new Array();
var Active:Number = new Number(0);
var Act_MC:Boolean = new Boolean(false);
var systemDaten:XML = new XML();

// Ignore whitespace in XML
systemDaten.ignoreWhite = true;

// Function to load the XML data
systemDaten.onLoad = function(success) {
var data_first = systemDaten.firstChild;

// Getting the attributes of the Slider
if(data_first.attributes.folder) Path = data_first.attributes.folder;
if(data_first.attributes.fadeInTime) fadeInTime = data_first.attributes.fadeInTime;
if(data_first.attributes.nextPicTime) fadeInTime = data_first.attributes.nextPicTime;

// Getting the pictures in the XML
for(i1=0; i1<data_first.childNodes.length; i1++){
Pictures.push(data_first.childNodes[i1].attributes.name);
}

// Start the Slider
startIt();
}

// Start the XML-Data-Loading
systemDaten.load(xmlfilename);


// Starting the Slideshow
function startIt(){

// Create the IMG-MC
_root.createEmptyMovieClip("mc_0", 20);
mc_0._alpha = 100;
mc_0.loadMovie(Path + "/" + Pictures[Active]);

// Create the empty Second-IMG-MC
_root.createEmptyMovieClip("mc_1", 10);
mc_1.alpha = 0;

// Start the interval
setInterval(switching, nextPicTime*1000);
}

// Switch the Picture
function switching(){
// Setting the active MC
Act_MC=Act_MC==true?false:true;

// Setting the Key of the new Picture
Active = Active >= Pictures.length-1 ? 0 : Active+1;

// Loading the new Picture
actMC = _root["mc_"+(Act_MC==true?1:0)]; // Setting the relation-variable
actMC.alpha = 0; // Blending-Out
actMC.swapDepths(actMC.getDepth()+20); // Swapping over the past picture
actMC.loadMovie(Path + "/" + Pictures[Active]); // Loading

// Fading the new Picture in
fadePic(actMC);
}

// Fading-IN a picture
function fadePic(pic){
FadeIn = new mx.transitions.Tween(pic, "_alpha", mx.transitions.easing.Regular.easeInOut , 0, 100, fadeInTime, true);
}
 

Neue Beiträge

Zurück