<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="vertical" 
    xmlns:local="*" 
    backgroundColor="#ffffff" 
    viewSourceURL="srcview/index.html" 
    maxWidth="500"
    maxHeight="500">
    
    <mx:Array id="behaviourLabels">
        <mx:String>Follow mouse</mx:String>
        <mx:String>Move around</mx:String>
        <mx:String>Stopped</mx:String>
    </mx:Array>
    
    <mx:Array id="behaviours">
        <local:FollowMouseBehaviour id="followMouse"/>
        <local:MovementBehaviour id="movement" delay="50"/>
        <local:NullBehaviour/>
    </mx:Array>
    
    <mx:ToggleButtonBar id="behaviour" dataProvider="{behaviourLabels}"/>
    <mx:HBox width="100%">
        <mx:Label text="Max iterations:"/>
        <mx:NumericStepper minimum="1" maximum="30" value="14" id="maxIterStepper"/>
        <mx:Spacer width="100%"/>
        <mx:Label text="{'c = '+fractal.juliaPoint.real.toFixed(2)+' + '+fractal.juliaPoint.imag.toFixed(2) +'i' }"/>
    </mx:HBox>
    
    <local:MandelbrotView 
        width="100%" 
        height="100%" 
        id="fractal"
        behaviour="{behaviours[behaviour.selectedIndex]}"
        numMaxIterations="{maxIterStepper.value}"
        click="behaviour.selectedIndex = 2"
    />
    
</mx:Application>