Hello all. I am currently scripting a Flash application at work which will pull data from an xml file ( .jpg’s and text ) into templated swf’s created by our designers, for use in online product commercials, realty/property tours, etc.
I need help knocking out a certain section. I am creating a loop which will pull data from the xml and load them with createEmptyMovieClip(). Here’s the code:
_root.dynLoad = function() {
trace( "initializing dynLoad function...
" );
for( _root.g = 1; _root.g <= _root.featLength; _root.g++ ) {
if( _root.g == 1 ) {
this.createEmptyMovieClip( "dynPic", this.getNextHighestDepth() );
trace( "creating empty clip..." + dynPic );
trace( "loading " + _root.imagesPath + ( _root.featureImageArray[ _root.g - 1 ] ) + " into..." + _root.dynPic + "
" );
dynPic.loadMovie( _root.imagesPath + ( _root.featureImageArray[ _root.g - 1 ] ) );
} else {
duplicateMovieClip( this.dynPic, "dynPicNew", _root.g );
trace( "duplicating previous clip...target: " + this.dynPicNew );
trace( "loading " + _root.imagesPath + ( _root.featureImageArray[ _root.g - 1 ] ) + " into..." + this.dynPicNew + "
" );
dynPicNew.loadMovie( _root.imagesPath + ( _root.featureImageArray[ _root.g - 1 ] ) );
dynPicNew._y += 150;
}
trace( "looping again...
" );
}
trace( "loop ended." );
}
I am not the heaviest with actionscript and I can get the first two pictures to load, but after that the pics get loaded into the duplicated clip. I tried my hardest to get the else block to dynamically increment the “dynPicNew” ( ex. load it into “dynPicNew” + _root.g ), but I can’t nail it! How can I get the duplicateMovieClip() to increment the load target dynamically?