class sampleImageChanger extends inkLogicController
{
	editable var imagePath : CName;
	editable var imageName_1 : CName;
	editable var imageName_2 : CName;
	private var imageWidget : weak< inkImage >;

	protected event OnInitialize()
	{
		imageWidget = ( ( inkImage )( GetWidget( imagePath ) ) );
	}

	public function OnButtonClick( e : inkPointerEvent )
	{
		var buttonWidget : weak< inkWidget >;
		if( e.IsAction( 'click' ) )
		{
			buttonWidget = e.GetCurrentTarget();
			switch( buttonWidget.GetName() )
			{
				case 'Button1':
					ChangeImage( imageName_1 );
				break;
				case 'Button2':
					ChangeImage( imageName_2 );
				break;
			}
		}
	}

	private function ChangeImage( imageName : CName )
	{
		imageWidget.SetTexturePart( imageName );
	}

}

