Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 25-05-2006, 14:50   #1 (permalink)
Querdenker
 
Registriert seit: Aug 2003
Ort: Berlin
Beiträge: 32
movie funktioniert nicht wenn ich es mit loadmovie lade

hallo...

ich habe eine swf diese eine xml liest und anschliessend einige sachen generiert... jetzt wollte ich diese swf in die hauptseite laden, allerdings funktioniert gar nichts mehr...

folgender code hat die swf:

PHP-Code:
// Fade in Fade Out Funktion

MovieClip.prototype.fadinout = function(iofastbr) { 
    var 
mc this
    var 
0
    
delete mc.onEnterFrame
    if(
io){ 
        
mc.onEnterFrame = function(){ 
            
i+=br 
            mc
._alpha-=(st*i); 
            if (
mc._alpha<=fa){ 
                
delete mc.onEnterFrame
                
mc._alpha=fa
            }                                       
        }; 
    }else if(!
io){ 
        
mc.onEnterFrame=function(){ 
           
i+=br
            
mc._alpha+=(st*i); 
            if (
mc._alpha>=fa){ 
                
delete mc.onEnterFrame
            }                                       
        }; 
    }  
}  



//TextFormat für buttons
var buttonOut_fmt:TextFormat = new TextFormat();
buttonOut_fmt.font "boutiqdince";
buttonOut_fmt.size 11;
buttonOut_fmt.color 0xFFFFFF;

var 
buttonOn_fmt:TextFormat = new TextFormat();
buttonOn_fmt.font "boutiqdincebold";
buttonOn_fmt.size 11;
buttonOn_fmt.color 0xFFFFFF;

// Diese Funktion Ladet die XML Daten in mehrdimensionale Arrays
function loadXML(loaded) { 
        if (
loaded) { 
            
xmlNode this.firstChild
            
_global.ProjekteArray = []; 
            
_global.BilderArray = [];
             
ProjekteTotal xmlNode.childNodes.length
             
// Setze H Counter auf 0 um unabhaengige Array IDS zu erstellen
            
h=0;
            
// Alle Projekte durchlaufen lassen und ordnen
            
for (i=0i<ProjekteTotali++) { 
                
ProjekteArray[i] = [[i],[xmlNode.childNodes[i].attributes.titel],[xmlNode.childNodes[i].attributes.ort],[xmlNode.childNodes[i].attributes.hauptbild]]; 
                
currentMAX xmlNode.childNodes[i].childNodes[1].childNodes.length;
                
// Alle Bilder aus dem momentan Durchlaufendem Projekt beziehen
                
for (k=0k<xmlNode.childNodes[i].childNodes[1].childNodes.lengthk++) { 
                        
BilderArray[h] = [[i],[xmlNode.childNodes[i].childNodes[1].childNodes[k].attributes.name],[xmlNode.childNodes[i].childNodes[1].childNodes[k].attributes.pic]]; 
                        
h+1;
                }
            }

            
// Wenn alles geladen ist Verarbeite die Klassen
            
getDataByXML();
            
// nächster funktionsaufruf 
        
} else { 
            
content "Fehler!!!!"
        } 


xmlData = new XML(); 
xmlData.ignoreWhite true
xmlData.onLoad loadXML;
xmlData.load("inhalt.xml");  


// Diese Funktion erstellt die Buttons und auf den Schaltflaechen
// wird nachher per onRelease die Funktion aufgerufen um die Bilder zu laden
function getDataByXML() {
// Projektnamen buttons erstellen
        
projekte_dis _global.ProjekteArray.length;
        for (var 
s=0s<projekte_diss++) {  
            
            var 
w:Number 100;
            var 
h:Number 20;
            var 
bgColor_normal:Number 0x911201;
            var 
bgColor_hover:Number 0x911201;

            var 
cont:MovieClip createEmptyMovieClip("container"+sthis.getNextHighestDepth());
            
cont.beginFill(bgColor_normal);
            
cont.lineTo(w0);
            
cont.lineTo(wh);
            
cont.lineTo(0h);
            
cont.lineTo(00);
            
cont._x 20;
            
cont._y 338 s*(h+1);
            
cont.createTextField("teext"+ss1010this.getNextHighestDepth());  

            
cont["teext"+s].text _global.ProjekteArray[s][1];
            
cont["teext"+s].autoSize true;
            
cont["teext"+s].embedFonts true;
            
cont["teext"+s].antiAliasType "advanced";
            
cont["teext"+s].selectable true;
            
cont["teext"+s].setTextFormat(buttonOut_fmt);
            
// Button Erstellung und Verweiss auf Datenfunktionen erstellen
            
cont.number s;
            
            
            
cont.onRelease = function() { 
                if(
_global.lastclicked != this.number) {
                
loadPictureData(_global.ProjekteArray[this.number][0]);
                
                
// Remove the movieeeeclips baby
                
removeMovieClip(_root["bildnavcont"+_global.projektid2]);
                
removeMovieClip(_root["hauptbild"+_global.projektid2]);
                
this._alpha=100;
                
                
// Yeah give me the effects babybaby oh baby!
                
_root["container"+this.number]["teext"+this.number].setTextFormat(buttonOn_fmt);
                
_root["container"+projektid2]["teext"+projektid2].setTextFormat(buttonOut_fmt);
                
_root["container"+projektid2].fadinout(1,50,2,1);
                
                
// Last clicked link
                
_global.lastclicked this.number;
                
_global.projektid2 _global.ProjekteArray[this.number][0];
                
                }
            };
            
// Set Alpha of Link to 50 Babybaby!
            
cont._alpha 50;
            
cont.onRollOver = function() { 
            
// Fade me in Baby!
                
this.fadinout(0,100,2,1);
            };
            
cont.onRollOut = function() { 
            
// Fade out if allowed!
                
if(_global.lastclicked != this.number) {
                
this.fadinout(1,50,2,1);
                }
            };
        }         
}
// Diese Funktion Baut die Buttons fuer die Einzelnen Galerie- Bilder zusammen
// Und erstellt Movie Clips mit einer onRelease eigenschaft, die dann zur Laderoutine
// uebergehen.
// var projektid
function loadPictureData(projektid) {
    
                        
// Hauptbild funktion
        
createEmptyMovieClip("hauptbild"+projektidthis.getNextHighestDepth());
        
_root["hauptbild"+projektid]._y0;
        
_root["hauptbild"+projektid]._x241;
        
_root["hauptbild"+projektid].loadMovie(_global.ProjekteArray[projektid][3]);
    
        
// Zaehle wieviele Bilder wir insgesamt haben.
        
gallery_dis _global.BilderArray.length;
        
// Stelle X Counter auf 0 um die horizontale Position zu fixieren
        
241;
        
0;
        for (var 
s=0s<gallery_diss++) {  
            
// Zeige nur die Bilder an, die der richtigen Projekt ID zugeordnet sind.
            
if (_global.BilderArray[s][0eq projektid) {
                
createEmptyMovieClip("bildnavcont"+projektidthis.getNextHighestDepth());
                
_root["bildnavcont"+projektid].createEmptyMovieClip("bildcont"+sthis.getNextHighestDepth());
                
// Definiere die Variablen für den Rechteck Platzhalter
                
                
var rw:Number 114;
                var 
rh:Number 84;
                var 
rbgColor_normal:Number 0xFFFFFF;
                
_root["bildnavcont"+projektid]["bildcont"+s]._y 250;
                
_root["bildnavcont"+projektid]["bildcont"+s]._x + (* (112+11));
                
_root["bildnavcont"+projektid]["bildcont"+s].beginFill(rbgColor_normal);
                
_root["bildnavcont"+projektid]["bildcont"+s].lineTo(rw0);
                
_root["bildnavcont"+projektid]["bildcont"+s].lineTo(rwrh);
                
_root["bildnavcont"+projektid]["bildcont"+s].lineTo(0rh);
                
_root["bildnavcont"+projektid]["bildcont"+s].lineTo(00);
                
                
// Button Erstellung und Verweiss auf Datenfunktionen erstellen
                
this["bildnavcont"+projektid]["bildcont"+s].number s;
                
_root["bildnavcont"+projektid]["bildcont"+s].createEmptyMovieClip("bildcont2"+sthis.getNextHighestDepth());

                
_root["bildnavcont"+projektid]["bildcont"+s]["bildcont2"+s].loadMovie(_global.BilderArray[s][2]);
                
_root["bildnavcont"+projektid]["bildcont"+s]["bildcont2"+s]._y 1;
                
_root["bildnavcont"+projektid]["bildcont"+s]["bildcont2"+s]._x 1;
                
_root["bildnavcont"+projektid]["bildcont"+s].onRollOver = function() { 
                                
this._alpha 100;
                               };
                
_root["bildnavcont"+projektid]["bildcont"+s].onRollOut = function() { 
                                
this._alpha 60;
                            };
                
_root["bildnavcont"+projektid]["bildcont"+s]._alpha 60;
                
                
// Button Erstellung
                
_root["bildnavcont"+projektid]["bildcont"+s].onRelease = function() { 
                    
getURL("http://www.google.com""_blank");

                };
                

                
                
y+1;
            }
        }

liegt es am root?

weil das movie im hauptmovie in folgende position geladen wird...
_root.content.work.loadMovie("test.swf");

vielen dank für eure hilfe,

liebe grüsse,

stefan riest
soklai ist offline   Mit Zitat antworten
Alt 25-05-2006, 14:52   #2 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Ja daran liegt es.

Vielleicht hilft dir "_lockroot", habs aber noch nie ausprobiert.
sebastian 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 23:37 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele