How do you load a folder full of png files to construct an AS3 movie clip?
I see plenty of AS3 examples of loading 1 image file into a 1 frame movieclip, but how can you take a folder full of images, load them and treat each image as an individual frame of a single movieclip?
The essential problem I seem to keep running into is how to create a keyframe during runtime...
I haven really tried it but maybe if you do something like
mc.addChild(image); mc.nextFrame(); mc.addChild(image2); mc.nextFrame();
Cant tell you for sure that it works though :)
What are you going to use this movieclip for ?
You can't do anything like that, because you can't create keyframes at runtime and when add a child to the MovieClip with code, it wont add it to the current frame, it will just add it to the clip's display list, so what you added dynamically will be on every frame.
You should probably try loading your images and storing them in an array or making an array of movie clips or sprites that each have on image. That way you have all the images in a list of clips, and you can still use those clips and display them however you want in your flash movie.
There is no way to add frames dynamically. What you can do is what __dominic suggests: create a class that mimics a movieclip by managing different frames by storing image data in an array ( or similar technique)
There are also some implementations available online ( i.e. see spritesheet class ).