Hallo , ich habe eine XML Galerie und möchte diese per Buttin aktivieren.Jedioch werden die Bilder nicht angezeigt..und ich habe keine ahnung warum??
Vielleicht kann mir jemand von euch helfen?
in meinem film, wo der button ist kommt ins 1 schlüsselbild:
PHP-Code:
this.createEmptyMovieClip("cont_filme",1);
cont_filme._x = 150;
cont_filme._y = 20;
unda auf den Button kommt:
[PHP]on (release) {
cont_filme.loadMovie("gallery.swf");
}
[/PHP]
Im galleryfile komt dann:
PHP-Code:
//Creates a unique ID number for each bounce function call
uniqueBounceID = 0;
function bounce(param, endingVal, clipName, speedFactor, bounceFactor) {
//Do not run if the clipName does not exist
if (clipName<>false) {
//Clear old setIntervals with same param name that might still be firing - prevents the clipName movie from being caught between two different parameter values
clearInterval(_root["bounceInterval"+clipName[param+"ID"]]);
//Reassign variables to make them private variables of the movie clip
var bounceID = _root.uniqueBounceID++;
clipName["param"+bounceID] = param;
clipName["endingVal"+bounceID] = endingVal;
clipName["speedFactor"+bounceID] = speedFactor;
clipName["bounceFactor"+bounceID] = bounceFactor;
clipName["startingParamVal"+bounceID] = clipName[param];
clipName["changedParamVal"+bounceID] = 0;
//Store the bounceID for this parameter into a variable in the clipName movieclip - used to clear the setInterval if the movie clip is removed before the function completes
clipName[param+"ID"] = bounceID;
//Bounce function called from the setInterval
clipName["callBounce"+bounceID] = function () {
//If the clip no longer exists, clear the setInterval
if (clipName._x == undefined) {
clearInterval(_root["bounceInterval"+bounceID]);
} else {
// Don't fire if the destination position is met
if (clipName["endingVal"+bounceID]<>Math.round(clipName[clipName["param"+bounceID]])) {
// Modify the changedParamVal by using a simple friction equation
clipName["changedParamVal"+bounceID] = clipName["changedParamVal"+bounceID]*clipName["bounceFactor"+bounceID]+
(clipName["endingVal"+bounceID]-clipName["startingParamVal"+bounceID])/clipName["speedFactor"+bounceID];
// Increment the startingParamVal by the new changedParamVal
clipName["startingParamVal"+bounceID] += clipName["changedParamVal"+bounceID];
// Snaps bouncing object to the pixel to reduce blinking effect and keep fonts pixelized
clipName[clipName["param"+bounceID]] = Math.round(clipName["startingParamVal"+bounceID]);
} else {
//Ensure final destination
clipName[clipName["param"+bounceID]] = clipName["endingVal"+bounceID];
// Clear the setIntervaly
clearInterval(_root["bounceInterval"+bounceID]);
}
}
//trace(clipName+" "+bounceID+":"+clipName["param"+bounceID]+" = "+clipName[clipName["param"+bounceID]]);
};
//Call the bounce function 100 times per second
_root["bounceInterval"+bounceID] = setInterval(clipName["callBounce"+bounceID], 10);
}
}
dann wird das xmlfile geladen:
PHP-Code:
this.importXML = new XML();
this.importXML.ignoreWhite = true;
this.importXML.onLoad = function(success) {
if (success) {
// pointer to the root node
var root = this.firstChild;
// fill in the multi-dimensional menu array
menuA = new Array();
for (var i = root.firstChild; i != null; i=i.nextSibling) {
menuA[menuA.length] = [i.attributes.name, i.attributes.image];
}
//Once the XML is loaded, build the bottom menu
buildMenu();
} else {
trace("ERROR loading xml");
}
};
this.importXML.load("gallery.xml");
und in das 3 schlüsselbild in der zeitleiste kommt dann:
PHP-Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
// AUTHOR: Charles Miller, Simon Hooper, Braingiants.com
// CREATED: June 6, 2006
// LAST MODIFIED: June 8, 2006
// Design, Learn, Educate, Inspire.
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Turn off controls in the beginning
menuBack._visible = false;
menuNext._visible = false;
//Functions to build the bottom menu
function buildMenu() {
//Create a photoMenu movie clip to hold the menu items
this.createEmptyMovieClip("photoMenu", this.getNextHighestDepth());
//position the photoMenu
photoMenu._x = 160;
photoMenu._y = 370;
//Attach the photoMenu mask
this.createEmptyMovieClip("photoMenuMask", this.getNextHighestDepth());
photoMenuMask.attachMovie("menuMask", "menuMask", this.getNextHighestDepth());
//position the photoMenuMask
photoMenuMask._x = 160;
photoMenuMask._y = 370;
//Apply the mask
photoMenu.setMask(photoMenuMask);
//The number of menu elements in the menuA array
menuLength = menuA.length;
//If there are less than 7 menu items, set photoMenu._x to center all elements
if (menuLength<7) {
// Position in center (450 is the center of this swf)
photoMenu._x = Math.round(450-(menuLength*97)/2);
} else {
recordNumber = 1;
//If there are more than 7 menu items, set the records text and turn on the controls
records.text = recordNumber+" - "+(recordNumber+5)+" of "+menuLength+" photos";
menuBack._visible = true;
menuNext._visible = true;
//Set the menuX variable that the buttons Move buttons use to position the photoMenu movie clip
menuX = photoMenu._x;
}
//Spacer between elements
menuSpacer = 7;
//Starting x for each element
startX = 0;
//Build the bottom menu
for (var i = 0; i<menuLength; i++) {
//attach an element for each menu item
photoMenu.attachMovie("element", "e"+i, i);
e = photoMenu["e"+i];
e.name = menuA[i][0];
e.image = menuA[i][1];
e.alreadyViewed = 0;
e.thumbnail.loadMovie("photos/"+e.image+"_thumb.jpg");
e._x = startX;
startX += e._width+menuSpacer;
e.onRollOver = function() {
bounce("_alpha", 0, this.menuOver, 5, 0);
_root.playOverSound();
};
e.onRollOut = function() {
bounce("_alpha", 60, this.menuOver, 10, 0);
};
e.onPress = function() {
//Call the new photo and info
changePhoto(this.name, this.image);
//Display viewed if needed
if (this.alreadyViewed == 0) {
this.viewed.gotoAndPlay(2);
}
this.alreadyViewed = 1;
};
//When the last menu element is added, display the first photo
if (i == (menuLength-1)) {
//Set initial record number and counter
recordNumber = 1;
// Display the first photo in the set
name = menuA[0][0];
image = menuA[0][1];
photoTitle.autoSize = "left";
changePhoto(name, image);
}
}
}
//Set photoNum to 0 at start
photoNum = 0;
// Change Photo function
function changePhoto(name, image) {
photoTitle.text = "";
//Store the image name to be read into the new photo
currentPhoto = image;
photoName = name;
//Simulate the previous photo falling off the screen (460 is off the bottom of this swf)
bounce("_rotation", 15, this["photo"+photoNum], 5, 0);
bounce("_y", 460, this["photo"+photoNum], 8, 0);
bounce("_alpha", 30, this["photo"+photoNum], 8, 0);
photoNum++;
this.createEmptyMovieClip("photo"+photoNum, getNextHighestDepth());
this["photo"+photoNum].attachMovie("photo", "photo", getNextHighestDepth());
//remove old photos
oldPhoto = this["photo"+(photoNum-2)];
oldPhoto.removeMovieClip();
//***** The positioning script is located within the photo movie clip
}
stop();
Im XML File steht:
PHP-Code:
<?xml version="1.0"?>
<gallery>
<photo name="Grand Tetons panoramic [May 2006]" image="tetonsbw"/>
<photo name="Yellowstone bog [May 2006]" image="bog"/>
<photo name="Last light [May 2006]" image="lastlight"/>
<photo name="Old Faithful sunset [May 2006]" image="faithful"/>
<photo name="Lower Falls [May 2006]" image="lowerfalls"/>
<photo name="Flowing glow [May 2006]" image="flowing"/>
<photo name="Moran barn [May 2006]" image="moran"/>
<photo name="Historic barn panoramic [May 2006]" image="oldbarn"/>
<photo name="Tetons sunset [May 2006]" image="tetonsunset"/>
<photo name="Grazing at dusk [May 2006]" image="grazing"/>
</gallery>
vielen dank im vorraus
P.S. Soory für den Wortumbruch aber das FLA ist zu groß zum uploaden.