// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 6/15/2001 17:06:17
// 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/MovieSetCommand

package com.macromedia.generator.commands;

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

public class MovieSetCommand extends GenericCommand
{

    public MovieSetCommand()
    {
    }

    public void doCommand(FlashEnvironment flashenvironment, Script script, Context context, int i, Properties properties)
        throws FlashCommandException
    {
        Boolean boolean1 = (Boolean)flashenvironment.get("MoviePropInitialized");
        if(boolean1 != null && boolean1.booleanValue())
        {
            logError(flashenvironment, "MultiInit", null);
            return;
        }
        _fld0109 = new GenVector(2);
        DD = flashenvironment.getTemplate();
        if(DD == null)
        {
            logError(flashenvironment, "InvalTimeline", null);
            return;
        }
        String s = context.apply(properties.getProperty("rate", "default"));
        String s1 = context.apply(properties.getProperty("width", "default"));
        String s2 = context.apply(properties.getProperty("height", "default"));
        String s3 = context.apply(properties.getProperty("color", "default"));
        String s4 = context.apply(properties.getProperty("loadorder", "Bottom up"));
        if(!s.equalsIgnoreCase("default"))
        {
            float f = -1F;
            try
            {
                float f1 = Float.valueOf(s).floatValue();
                if(f1 != -1F)
                    if(f1 > 0.0F && f1 < 120F)
                    {
                        DD.setFrameRate(f1);
                    } else
                    {
                        logWarning(flashenvironment, "InvalRateValue", null);
                        DD.setFrameRate(12F);
                    }
            }
            catch(NumberFormatException _ex)
            {
                logWarning(flashenvironment, "InvalRateValue", null);
                DD.setFrameRate(12F);
            }
        }
        if(!s1.equalsIgnoreCase("default"))
        {
            byte byte0 = -1;
            try
            {
                int j = Integer.valueOf(s1).intValue();
                if(j > 0)
                    DD.setWidth(j);
            }
            catch(NumberFormatException _ex)
            {
                logError(flashenvironment, "InvalWidth", null);
            }
        }
        if(!s2.equalsIgnoreCase("default"))
        {
            byte byte1 = -1;
            try
            {
                int k = Integer.valueOf(s2).intValue();
                if(k > 0)
                    DD.setHeight(k);
            }
            catch(NumberFormatException _ex)
            {
                logError(flashenvironment, "InvalHeight", null);
            }
        }
        if(!s3.equalsIgnoreCase("default"))
            try
            {
                Color color = (Color)_fld0109.add(new Color());
                color.setRGBValue(s3);
                DD.insertBackgroundColor(color);
                _fld0109.release(color);
            }
            catch(GeneratorApiException _ex)
            {
                logError(flashenvironment, "InvalColor", null);
            }
        if(s4.equalsIgnoreCase(getResourceString(flashenvironment, "orderTop")))
            DD.setLoadTopDown(true);
        else
        if(s4.equalsIgnoreCase(getResourceString(flashenvironment, "orderBottom")))
            DD.setLoadTopDown(false);
        else
        if(s4.equalsIgnoreCase("Nach oben") || s4.equalsIgnoreCase("Du bas vers le haut") || s4.equalsIgnoreCase("Nedifr\345n och upp") || s4.equalsIgnoreCase("De baixo para cima") || s4.equalsIgnoreCase("Abajo hacia arriba") || s4.equalsIgnoreCase("Dal basso verso l'alto") || s4.equalsIgnoreCase("\u4E0B\u304B\u3089\u4E0A\u3078"))
            DD.setLoadTopDown(false);
        else
        if(s4.equalsIgnoreCase("Nach unten") || s4.equalsIgnoreCase("Du haut vers le bas") || s4.equalsIgnoreCase("Uppifr\345n och ned") || s4.equalsIgnoreCase("De cima para baixo") || s4.equalsIgnoreCase("Arriba hacia abajo") || s4.equalsIgnoreCase("Dall'alto verso il basso") || s4.equalsIgnoreCase("\u4E0A\u304B\u3089\u4E0B\u3078"))
            DD.setLoadTopDown(true);
        else
            logError(flashenvironment, "InvalLoad", null);
        String s5 = properties.getProperty("encoding", "default");
        s5 = context.apply(s5);
        if(!s5.equalsIgnoreCase("default") && !s5.equalsIgnoreCase("\u30C7\u30D5\u30A9\u30EB\u30C8") && !s5.equalsIgnoreCase("Standard") && !s5.equalsIgnoreCase("D\351faut") && !s5.equalsIgnoreCase("Padr\343o") && !s5.equalsIgnoreCase("Predeterminado") && !s5.equalsIgnoreCase("Predefinita"))
            flashenvironment.setDataEncoding(s5);
        else
        if(Locale.getDefault().getLanguage().equals(Locale.JAPANESE.getLanguage()))
            flashenvironment.setDataEncoding("SJIS");
        flashenvironment.put("MoviePropInitialized", new Boolean(true));
    }

    GenVector _fld0109;
    Script DD;
}