iSpring SDK provides Flash developers with custom skin development facilities. Creation of a custom skin is a quite easy task for developers familiar with Flash 7 or 8 and ActionScript 2.0.
Each skin is just an ordinary Flash file with the only feature - the first frame of its main (aka _root) MovieClip contains the following function.
function createSkin(target:MovieClip):fsplayer.ui.skins.ISkin;
The target parameter is a MovieClip object where skin must create user interface objects. The createSkin() function is called by the player core. It must return a newly created object implementing fsplayer.ui.skins.ISkin Interface. Visibility of the passed target MovieClip can be controlled by the Flash presentation preloader.
When the skin is created, the player is initialized. Player initialization scheme is illustrated in the following diagram.
The following interfaces are used for the development of custom skins. They are located within fsplayer.ui.skins package.
| Name | Description |
|---|---|
| ISkin | Provided by all iSpring-compatible skin modules |
| ISkinListener | Implemented by the player core and allows receiving skin initialization event notifications |
| ISkinSizeController | Implemented by the player core and allows receiving skin initialization event notifications |
| ISkinUIController | Provides clients with ability to control user interface of the skin |
| ISkinUIControllerListener | Allows receiving notifications from the skin UI controller |
| ISlideShowWindow | Provides methods for resizing, scaling, and self-scaling of the player skin |
Samples
A typical implementation of the createSkin() function is as follows:
import fsplayer.ui.skins.ISkin;
import MySkin;
function createSkin(target:MovieClip):ISkin
{
return new MySkin(target);
}
MySkin class can be declared in the following way:
import fsplayer.ui.skins.ISkin;
class MySkin implements ISkin
{
// implementation of ISkin interface methods
}
A minimal implementation of the ISkin interface can be found in the sampes section of the ISkin interface description.