Package flash.swf.actions

Examples of flash.swf.actions.Try


        else
        {
            switch (entry.source.code)
            {
            case ActionConstants.sactionTry:
                Try t = (Try) entry.source;
                indent--;
                indent();
                out.println("}");
                indent();
                if (label == t.endTry && t.hasCatch())
                {
                    out.println("catch("+
                                (t.hasRegister()?"$"+t.catchReg:t.catchName) +
                                ") {");
                    indent++;
                }
                else if ((label == t.endTry || label == t.endCatch) && t.hasFinally())
                {
                    out.println("finally {");
                    indent++;
                }
                break;
View Full Code Here


        factory.setAction(offset, a);
  }

    private Try decodeTry(ActionFactory factory) throws IOException
    {
        Try a = new Try();

        a.flags = reader.readUI8();
        int trySize = reader.readUI16();
        int catchSize = reader.readUI16();
        int finallySize = reader.readUI16();

    if (a.hasRegister())
      a.catchReg = reader.readUI8();
    else
           a.catchName = reader.readString();

    // we have now consumed the try action.  what follows is label mgmt

        int tryEnd = reader.getOffset() + trySize;
    a.endTry = factory.getLabel(tryEnd);

        // place the catchLabel to mark the end point of the catch handler
    if (a.hasCatch())
            a.endCatch = factory.getLabel(tryEnd + catchSize);

        // place the finallyLabel to mark the end point of the finally handler
    if (a.hasFinally())
            a.endFinally = factory.getLabel(tryEnd + finallySize + (a.hasCatch() ? catchSize : 0));

        return a;
    }
View Full Code Here

            case ActionConstants.sactionWaitForFrame2:
                int skipTarget = getLabelCount(((WaitForFrame)entry.source).skipTarget);
                writer.writeUI8at(entry.updatePos, skipTarget - entry.anchor);
                break;
            case ActionConstants.sactionTry:
                Try t = (Try) entry.source;
                int endTry = getLabelOffset(t.endTry);
                writer.writeUI16at(entry.updatePos, endTry - entry.anchor);
                entry.anchor = endTry;
                if (t.hasCatch())
                {
                    int endCatch = getLabelOffset(t.endCatch);
                    writer.writeUI16at(entry.updatePos+2, endCatch - entry.anchor);
                    entry.anchor = endCatch;
                }
                if (t.hasFinally())
                {
                    int endFinally = getLabelOffset(t.endFinally);
                    writer.writeUI16at(entry.updatePos+4, endFinally - entry.anchor);
                }
                break;
View Full Code Here

TOP

Related Classes of flash.swf.actions.Try

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.