// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 6/15/2001 17:06:29
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   com/macromedia/generator/commands/SetBrightnessCommand

package com.macromedia.generator.commands;

import com.macromedia.generator.api.*;
import com.macromedia.generator.app.*;
import java.util.Properties;

public class SetBrightnessCommand extends GenericCommand
{

    public SetBrightnessCommand()
    {
    }

    public void doCommand(FlashEnvironment flashenvironment, Script script, Context context, int i, Properties properties)
        throws FlashCommandException
    {
        float f = 0.0F;
        _fld0109 = new GenVector(16);
        Script script1 = (Script)_fld0109.add(script.getCommandScript(i));
        flashenvironment.processScript(script1, context);
        String s = properties.getProperty("percent", "");
        s = context.apply(s);
        try
        {
            f = Float.valueOf(s).floatValue();
            if((double)f < -100D || (double)f > 100D)
            {
                logError(flashenvironment, "ErrorSettingBrightnessRange", null);
                f = 0.0F;
            }
        }
        catch(NumberFormatException _ex)
        {
            logError(flashenvironment, "ErrorSettingBrightness", null);
            f = 0.0F;
        }
        try
        {
            script.setCommandBrightness(i, f);
        }
        catch(GeneratorApiRuntimeException _ex)
        {
            logError(flashenvironment, "ErrorSettingBrightness", null);
            return;
        }
        _fld0109.release();
    }

    GenVector _fld0109;
}