We have decided to open up our component library to users -- normally we use this library internally to develop widgets, but we thought you would find it useful as well. There are a lot of components for you to explore; at the moment documentation is very sparse, but we will be improving this with time, in addition to other aspects of the library. Also, we will be providing examples of these components in action, and short tutorials on how to use them. You can download the yourminis Component Library here. You will want to make sure that your classpath ("File"->"Publish Settings"->"Flash [tab]"->"Settings...") includes a link to where ever you extract the yourminis Component Library to.
The first component we will be showing is the ImageLoader utility,
which allows you to load images, frame them, and resize them
proportionately (so that they don't skew when resized). You can view a widget using this component here. You can download the sample FLA here or grab the code from the code box below.
As you can see, after the widget is initialized in the "onWidgetLoaded" event handler, a new Sprite is created ("im_mc") to hold the ImageLoader. This isn't required but it allows you more control over placing the ImageLoader before it is initialized, and allows you to easily dispose of the ImageLoader and create a new instance of it if you want to reload an image into it or change the way it is constructed.
A description of all the parameters for the constructor of the ImageLoader is provided in the code. The "setSize(width,height)" function allows you to set the size of the image loader. Note that we check if the instance "il" of the ImageLoader is defined before calling any function, as it is possible the user could remove the imageLoader object in their code if they were to dispose of the image.
The ImageLoader allows you to load images pretty easily, but what if you want to load movies? Our next component sample will show you just how to do that.
yourminis
Comments