ciao ho un file flash actionscript 2 con alcune caselle di testo richiamate da un file xml.
ho provato a usare i vari tutorial per aggiungere una mia nuova casella di testo dinamica per richiamare testo da un nuovo file xml ma non riesco a visualizzarlo .
allora mi chiedevo se potevo inserire una casella di testo dinamica " chiamiamola istanza TESTO_TXT" dentro lo stage e richiamarla dentro il file xml , questo è il testo As, purtroppo non capisco come potrei modificarlo per aggiungere sul file xml del testo dentro i captions <testo><\testo>
( o meglio ci ho provato e non ci riesco)


Codice PHP:
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;

var 
folder:String "mp3player/album1/";
var 
myXML:String "songs.xml";

var 
playState:Boolean false;
var 
backgroundImage:String;
var 
playerAutoPlay:Boolean false;
var 
artist:Array = new Array();
var 
trackNames:Array = new Array();
var 
trackFiles:Array = new Array();
var 
trackDuration:Array = new Array();
var 
indicatorStartX:Number duration_mc.indicator_mc._x;

var 
musicXML:XML = new XML();
musicXML.ignoreWhite true;
musicXML.onLoad = function(success) {
    if (
success) {
        
backgroundImage this.firstChild.attributes.artwork;
        
loadMovie(folder+backgroundImagebackground_mc);
        if (
this.firstChild.attributes.autoplay == "yes") {
            
playerAutoPlay true;
        }
        for (var 
i:Number 0i<this.firstChild.childNodes.lengthi++) {
            
artist.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
            
trackNames.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);
            
trackFiles.push(this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue);
            
trackDuration.push(this.firstChild.childNodes[i].childNodes[3].firstChild.nodeValue);
            var 
newTrack:MovieClip tracklisting_mc.target_mc.attachMovie("trackRow""trackRow"+ii);
            
newTrack._y += (newTrack.trackRowBg_mc._height)*i;
            
newTrack.ID i;
            
newTrack.artist_txt.html true;
            
newTrack.artist_txt.htmlText artist[i];
            
newTrack.trackname_txt.html true;
            
newTrack.trackname_txt.htmlText trackNames[i];
            
newTrack.tracktime_txt.html true;
            
newTrack.tracktime_txt.htmlText trackDuration[i];
            
newTrack.onRollOver = function() {
                var 
fadeDown:Tween = new Tween(this"_alpha"None.easeOutthis._alpha500.4true);
            };
            
newTrack.onRollOut newTrack.onReleaseOutside = function() {
                var 
fadeDown:Tween = new Tween(this"_alpha"None.easeOutthis._alpha1000.4true);
            };
            
newTrack.onRelease = function() {
                
_global.songID this.ID;
                
startTheMusic(trackFiles[this.ID]);
            };
        }
        
tracklisting_mc.scrollInfo();
        if (
playerAutoPlay == true) {
            
_global.songID 0;
            
startTheMusic(trackFiles[0]);
        }
    } else {
        
trace("cannot load XML");
    }
};
musicXML.load(folder+myXML);




var 
mySong:Sound = new Sound();

function 
startTheMusic(file) {
    
info_mc._alpha 0;
    
info_mc.artist_txt.html true;
    
info_mc.artist_txt.htmlText artist[_global.songID];
    
info_mc.songtitle_txt.html true;
    
info_mc.songtitle_txt.htmlText trackNames[_global.songID];
    var 
showInfo:Tween = new Tween(info_mc"_alpha"None.easeOut01001true);
    
playState true;
    
mySong = new Sound();
    
mySong.loadSound(folder+filetrue);
    
mySong.start(0);
    
mySong.onSoundComplete playNextSong;
    
playpause_mc.gotoAndStop(2);
    
mySong.setVolume(Math.round((volumecontrols_mc.scrubber_mc._x volumecontrols_mc.bar_mc._width) * 100));
}

function 
playNextSong() {
    
// Play next song
    //delete main_mc.onEnterFrame;
    
if (_global.songID trackFiles.length-1) {
        
_global.songID++;
    } else {
        
_global.songID 0;
    }
    
startTheMusic(trackFiles[_global.songID]);
};

function 
startTracking() {
    
main_mc.onEnterFrame = function() {
        
findTime();
    };
}
startTracking();

var 
currentTime:Number;
var 
songDuration:Number;

function 
findTime() {
    
currentTime Math.round(mySong.position/1000);
    
songDuration Math.round(mySong.duration/1000);
    
duration_mc.indicator_mc._x mySong.position/mySong.duration*duration_mc.bar_mc._width;
    
    var 
songMinutes:Number Math.floor(songDuration/60);
    var 
songSeconds:Number songDuration%60;
    
statustext_mc.duration_txt.text songMinutes+":"+songSeconds;
    
    var 
songMinutesC:Number Math.floor(currentTime/60);
    var 
songSecondsC:Number currentTime%60;
    if (
songSecondsC 10) {
        
newSongSecondsC "0"+songSecondsC;
    } else {
        
newSongSecondsC songSecondsC;
    }
    
statustext_mc.position_txt.text songMinutesC+":"+newSongSecondsC;
}

duration_mc.indicator_mc.onPress = function() {
    
delete main_mc.onEnterFrame;
    
startDrag(thisfalse00duration_mc.bar_mc._width0);
};
duration_mc.indicator_mc.onRelease duration_mc.indicator_mc.onReleaseOutside = function() {
    
stopDrag();
    
mySong.start(((this._x duration_mc.bar_mc._width) * mySong.duration)/1000);
    
startTracking();
};

function 
setVolume() {
    
mySong.setVolume(Math.round((volumecontrols_mc.scrubber_mc._x volumecontrols_mc.bar_mc._width) * 100));
}

volumecontrols_mc.scrubber_mc.onPress = function() {
    
startDrag(thisfalse00volumecontrols_mc.bar_mc._width0);
    
main2_mc.onEnterFrame setVolume;
};
volumecontrols_mc.scrubber_mc.onRelease volumecontrols_mc.scrubber_mc.onReleaseOutside = function() {
    
stopDrag();
    
delete main2_mc.onEnterFrame;
};

stop_mc.onRollOver = function() {
    var 
myTween:Tween = new Tween(stop_mc"glow"Regular.easeOut050.4true);
    
myTween.onMotionChanged = function() {
        
stop_mc.filters = [new GlowFilter(0xFFFFFF1stop_mc.glowstop_mc.glow12falsefalse)];
    };
};
stop_mc.onRollOut stop_mc.onReleaseOutside = function() {
    var 
myTween:Tween = new Tween(stop_mc"glow"Regular.easeOutstop_mc.glow00.4true);
    
myTween.onMotionChanged = function() {
        
stop_mc.filters = [new GlowFilter(0xFFFFFF1stop_mc.glowstop_mc.glow12falsefalse)];
    };
    
myTween.onMotionFinished = function() {
        
stop_mc.filters null;
    };
};
stop_mc.onRelease = function() {
    
mySong.start(0);
    
mySong.stop();
    
playState false;
    
playpause_mc.gotoAndStop(1);
};

playpause_mc.onRollOver = function() {
    var 
myTween:Tween = new Tween(playpause_mc"glow"Regular.easeOut050.4true);
    
myTween.onMotionChanged = function() {
        
playpause_mc.filters = [new GlowFilter(0xFFFFFF1playpause_mc.glowplaypause_mc.glow12falsefalse)];
    };
};
playpause_mc.onRollOut playpause_mc.onReleaseOutside = function() {
    var 
myTween:Tween = new Tween(playpause_mc"glow"Regular.easeOutplaypause_mc.glow00.4true);
    
myTween.onMotionChanged = function() {
        
playpause_mc.filters = [new GlowFilter(0xFFFFFF1playpause_mc.glowplaypause_mc.glow12falsefalse)];
    };
    
myTween.onMotionFinished = function() {
        
playpause_mc.filters null;
    };
};
playpause_mc.onRelease = function() {
    if (
playState == true) {
        
mySong.stop();
        
playState false;
        
playpause_mc.gotoAndStop(1);
    } else {
        
mySong.start(mySong.position/1000);
        
playState true;
        
playpause_mc.gotoAndStop(2);
    }
}; 
[edit by and80] ho aggiunto i tag per il codice perchè altrimenti è illegibile