-
Senior Member
[F8] Import Images From XML and Assign Linkage Identifiers?
I'd like to import images from an XML file and then assign linkage identifiers to each image that I import.
I can take care of importing from XML, but what I need to do next is:
Turn each image into a movie clip
Assign each movie clip a linkage identifier
The reason I want to assign linkage identifiers is because I use a transitions component that I feed linkage identifiers from the movie clips I want to run in the transitions component.
Foochuck
http://www.myspace.com/foochuck
-
I would store all of my xml in an array, then loop through the array, each time creating an empty movie clip.
Something like:
Code:
for(i = 0; i<array.length; i++){
var myImgHolder:MovieClip = this.createEmptyMovieClip("myImg", "myImg"+i, i);
myImgHolder.loadMovie(array.imgURL);
}
This will give you however many movieclips as the length of your xml, each having an instance name of "myImg0", "myImg1", "myImg2" etc.
Hope that steers you in the right direction
-
Yeah but that doesn't assign linkage identifiers. I had wondered this myself, but I just ended up using loadmovie except with a swf, and in the swf I had the extra images with linkage names.
-
Originally Posted by Blommestein
Yeah but that doesn't assign linkage identifiers. I had wondered this myself, but I just ended up using loadmovie except with a swf, and in the swf I had the extra images with linkage names.
Sure it does. The first parameter passed to createEmptyMovieClip is the instance name (linkage identifier) of that clip.
as in:
Code:
for(i=0; i<10; i++){
this.createEmptyMovieClip("myImg"+i, i);
}
that will create 10 mc's on the stage with 10 different linkage identifiers, myImg0 - myImg9
-
Senior Member
myImg is the linkage identifier or the instance name?
Foochuck
http://www.myspace.com/foochuck
-
You are assigning an instance name via actionscript...which is essentially the same thing as a linkage identifier...a means for you to access that clip
-
Linkage Identifiers let you create images on the stage from your library. Im assuming with yours, and instance names, you can only refer to those particular created ones, you cannot attach more of those images to a movieclip using those instance names, thats what linkage identifiers are fore.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|