![]() ![]() | |
When you create or duplicate a movie clip dynamically using MovieClip.attachMovie() and MovieClip.duplicateMovie(), you can populate the movie clip with parameters from another object. The initObject parameter of attachMovie() and duplicateMovie() allows dynamically created movie clips to receive clip parameters. The initObject parameter is optional.
For more information, see MovieClip.attachMovie() and MovieClip.duplicateMovieClip().
To populate a dynamically created movie clip with parameters from a specified object, do one of the following:attachMovie():
myMovieClip.attachMovie(idName,newName,depth[,initObject])
duplicateMovie():
myMovieClip.duplicateMovie(idName,newName,depth[,initObject])
The initObject parameter specifies the name of the object whose parameters you want to use to populate the dynamically created movie clip.
To populate a movie clip with parameters by using attachMovie(): dynamic in the Symbol Name text box and select the Movie Clip behavior.name_txt.name, and then assign its value to the text property of name_txt, as shown here:
var name:String; name_txt.text = name;
The Linkage Properties dialog box appears.
_root.attachMovie("dynamic", "newClipName", 10, {name:"Erick"});
attachMovie() call appears inside the new movie clip's text field.![]() ![]() | |