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

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 15-10-2007, 23:07   #1 (permalink)
WHIZZL
 
Benutzerbild von iomondon
 
Registriert seit: Jul 2001
Ort: M
Beiträge: 104
Unhappy Bilder auslesen per XML klappt nicht

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(paramendingValclipNamespeedFactorbounceFactor) {
//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 
root.firstChild!= nulli=i.nextSibling) {
            
menuA[menuA.length] = [i.attributes.namei.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 0i<menuLengthi++) {
        
//attach an element for each menu item
        
photoMenu.attachMovie("element""e"+ii);
        
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"0this.menuOver50);
            
_root.playOverSound();
        };
        
e.onRollOut = function() {
            
bounce("_alpha"60this.menuOver100);
        };
        
e.onPress = function() {
            
//Call the new photo and info
            
changePhoto(this.namethis.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 (== (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(nameimage);
        }
    }
}
//Set photoNum to 0 at start
photoNum 0;
// Change Photo function
function changePhoto(nameimage) {
    
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"15this["photo"+photoNum], 50);
    
bounce("_y"460this["photo"+photoNum], 80);
    
bounce("_alpha"30this["photo"+photoNum], 80);
    
photoNum++;
    
this.createEmptyMovieClip("photo"+photoNumgetNextHighestDepth());
    
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.
__________________
Be there or be Square..
iomondon ist offline   Mit Zitat antworten
Alt 16-10-2007, 10:01   #2 (permalink)
notzucht
 
Benutzerbild von shorty
 
Registriert seit: Nov 2003
Ort: Potsdam
Beiträge: 2.939
Funktioniert denn die gallery.swf im "stand-alone" betrieb?
__________________
.
Flex in a week | Viertel vor halb nach Vollmond | ^^°.°^^ | Waltz with Bashir
.
shorty ist offline   Mit Zitat antworten
Alt 16-10-2007, 19:38   #3 (permalink)
WHIZZL
 
Benutzerbild von iomondon
 
Registriert seit: Jul 2001
Ort: M
Beiträge: 104
Bilder auslesen per XML klappt nicht

HI Shorty,

also im standalone Betrieb funktioniert die SWF.

Ich bin echt verzweifelt..auch wenn ich die einzelnen Zeilen getracet habe..scheint alles in ordnung..

Kannst du mir helfen?


Danke
__________________
Be there or be Square..
iomondon ist offline   Mit Zitat antworten
Alt 16-10-2007, 19:45   #4 (permalink)
notzucht
 
Benutzerbild von shorty
 
Registriert seit: Nov 2003
Ort: Potsdam
Beiträge: 2.939
Anstandshalber sage ich dir auf diesem wege, das ich seit 2 std. im urlaub bin.

Da muss wohl jemand anders übernehmen, sorry
__________________
.
Flex in a week | Viertel vor halb nach Vollmond | ^^°.°^^ | Waltz with Bashir
.
shorty ist offline   Mit Zitat antworten
Alt 17-10-2007, 18:02   #5 (permalink)
WHIZZL
 
Benutzerbild von iomondon
 
Registriert seit: Jul 2001
Ort: M
Beiträge: 104
Bilder auslesen per XML klappt nicht

...ja, kann mir denn jemand weiterhelfen bei meinem problem?
Please...
__________________
Be there or be Square..
iomondon 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



Alle Zeitangaben in WEZ +1. Es ist jetzt 09:36 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele