Copy link to clipboard
Copied
i want to build a datagrid that shows a picture and underneath it a name.
the problem is i dont want to see all of the pictures, but all the pictures that have certain requirements, so i cant just make one movie clip that includes all the pictures and names.
so my question is how do i build a movie clip that contains photo and text?.
Copy link to clipboard
Copied
Create a new MovieClip symbol and add an image and a textfield to it.
Copy link to clipboard
Copied
yea but i dont know how many pictures i will be needed to show..
so how do i create this movie clip on the timeline by code? because i might need to create more than one movieClip
Copy link to clipboard
Copied
You do not create movieclips on the timeline using code, though you can create them and add them as children of something that has been manually placed in the timeline.
To create a MovieClip using code you use:
var mc:MovieClip = new MovieClip();
If you need to add an image, then however you intend to acquire the image, after it has been acquired, you add it to the MovieClip using:
mc.addChild(img);
where img is the instance of whatever form of object the image takes (Bitmap, Loader)
If you need to add a TextField to the MovieClip then you use:
var tf:TextField = new TextField();
mc.addChild(tf);
and you can set up properties for the textfield such as the font and color and position as well after it has been instantiated (the first line).
Copy link to clipboard
Copied
thank you very much
Copy link to clipboard
Copied
You're welcome