Суммируем наши знания в коде: создадим класс FormatSVG и перенесем в него из описания формата все инструкции атрибута d:
Код AS3:
package com.itechnica.svg {
// http://www.w3.org/TR/SVG11/paths.html
public class FormatSVG {
// 8.3.2 The "moveto" commands
public static const MOVE_TO_ABSOLUTE : String = "M";
public static const MOVE_TO_RELATIVE : String = "m";
// 8.3.3 The "closepath" command
public static const CLOSEPATH_ABSOLUTE : String = "Z";
public static const CLOSEPATH_RELATIVE : String = "z";
// 8.3.4 The "lineto" commands
public static const LINE_TO_ABSOLUTE : String = "L";
public static const LINE_TO_RELATIVE : String = "l";
public static const HORIZONTAL_LINE_TO_ABSOLUTE : String = "H";
public static const HORIZONTAL_LINE_TO_RELATIVE : String = "h";
public static const VERTICAL_LINE_TO_ABSOLUTE : String = "V";
public static const VERTICAL_LINE_TO_RELATIVE : String = "v";
// 8.3.6 The cubic Bйzier curve commands
public static const CUBIC_CURVE_TO_ABSOLUTE : String = "C";
public static const CUBIC_CURVE_TO_RELATIVE : String = "c";
public static const CUBIC_SMOOTH_CURVE_TO_ABSOLUTE : String = "S";
public static const CUBIC_SMOOTH_CURVE_TO_RELATIVE : String = "s";
// 8.3.7 The quadratic Bйzier curve commands
public static const QUADRATIC_CURVE_TO_ABSOLUTE : String = "Q";
public static const QUADRATIC_CURVE_TO_RELATIVE : String = "q";
public static const QUADRATIC_SMOOTH_CURVE_TO_ABSOLUTE : String = "T";
public static const QUADRATIC_SMOOTH_CURVE_TO_RELATIVE : String = "t";
// 8.3.8 The elliptical arc curve commands
public static const ARC_TO_ABSOLUTE : String = "A";
public static const ARC_TO_RELATIVE : String = "a";
}
}