<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- <!DOCTYPE Movie SYSTEM "dtd/RVML.dtd"> -->
<Movie version='6' width='600' height='400' rate='1' backgroundColor='white' compressed='No' enableDebug="Yes"
    xmlns="http://www.kineticfusion.org/RVML/2.0">
    <Title>
        Example Of MovieClip classes
    </Title>
    <Desc>
        Illustrated how to associate a MovieClip symbol with an ActionScript class that
        can be scripted. Two MovieClips are placed on the timeline but with different initial properties
        so that the first clip is rendered horizontally and the second vertically.
    </Desc>
    <Definitions>
        <FontDefinition id='Arial' fontName='Arial' fontStyle='(bold)' fontRange='defined' />

        <!--Grey Box -->
        <Shape id='greyBoxShape' bounds="auto">
            <LineStyles>
                <LineStyle index="1" width="0.05" color="red"/>
            </LineStyles>
            <FillStyles>
                <ColorFill index="1" color="lightGrey"/>
            </FillStyles>
            <Edges>
                <SetStyle line="1" mainFill="1"/>
                <Rect x="0" y="0" width="100" height="100" />
            </Edges>
        </Shape>
        <!-- Movie clip with box on first frame -->
        <MovieClip id="GreyBoxClip">
            <Timeline>
                <Frame>
                    <Place name="greyBoxShape" depth="1"/>
                </Frame>
            </Timeline>
        </MovieClip>
    </Definitions>
    <!-- Export our movie clip as we need to associate it with a 
         name and class in actionscript -->
    <ExportSymbols>
        <ExportSymbol name='GreyBoxClip' exportName='GreyBoxClip' />
    </ExportSymbols>
    <InitClipActions>
        <InitClip name="GreyBoxClip"><![CDATA[
function GreyBoxClass()
{
    this.init();
}
GreyBoxClass.prototype = new MovieClip();

GreyBoxClass.prototype.isHorizontal = function()
{
    if ( this.horizontal == undefined )
        this.horizontal = true;
    return this.horizontal;
};

GreyBoxClass.prototype.getWidth = function()
{
    if ( this.isHorizontal() )
        return 100;
    else
        return 5;
        };
        
GreyBoxClass.prototype.getHeight = function()
{
    if ( this.isHorizontal() )
        return 5;
    else
        return 100;
};

GreyBoxClass.prototype.init = function()
{
    // Rather contrived example 

    this._width = this.getWidth();
    this._height = this.getHeight();
};
Object.registerClass("GreyBoxClip", GreyBoxClass);
]]>
        </InitClip>
    </InitClipActions>
    <Timeline>
        <Frame>
            <Place name="GreyBoxClip" depth="1" x="100" y="30">
                <MovieClipActions><![CDATA[
onClipEvent( setParameters )
{
    horizontal = true;
}
                ]]></MovieClipActions>
            </Place>
            <Place name="GreyBoxClip" depth="2" x="100" y="130">
                <MovieClipActions><![CDATA[
onClipEvent( setParameters )
{
    horizontal = false;

}
                ]]></MovieClipActions>
            </Place>
        </Frame>
    </Timeline>
</Movie>