开发者

Access movie in external swf using xml data

开发者 https://www.devze.com 2023-03-06 13:48 出处:网络
Is it possible to access a movieclip inside an external swf (.fla file), using data from a vector? The following code works correctly:

Is it possible to access a movieclip inside an external swf (.fla file), using data from a vector?

The following code works correctly:

this._graphics.message2_mc.textLabel_txt.text = "Test";

Where as when I loop through a vector and try to replace "message2_mc" it cannot find the movie clip:

for(var i:uint = 1; i <=开发者_Python百科 this._playlistState.subMovieVector.length - 1; i++) 
{
    var movieName:String = this._playlistState.subMovieVector[i].movieName;
    this._graphics.movieName.textLabel_txt.text = "Test";
}

Presumably this is because I am putting a string in the middle of the line of code accessing the movie clip?


You should use:

var movieName:String = this._playlistState.subMovieVector[i].movieName; this._graphics[movieName].textLabel_txt.text = "Test";

0

精彩评论

暂无评论...
验证码 换一张
取 消