package Flash::Constants; use Exporter; @ISA = qw ( Exporter ); @EXPORT = qw ( place_move place_character place_matrix place_colour_transform place_ratio place_name place_define_clip fill_gradient fill_lineargradient fill_radialgradient fill_bits fill_maxgradientcolours flags_moveto flags_fill0 flags_fill1 flags_line flags_newstyles flags_end font_unicode font_shiftJIS font_ANSI font_italic font_bold font_widecodes fontflags_bold fontflags_italic fontflags_widecodes fontflags_wideoffsets fontflags_ANSI fontflags_unicode fontflags_shiftJIS fontflags_haslayout edittext_hasfont edittext_hasmaxlength edittext_hastextcolour edittext_readonly edittext_password edittext_haslayout edittext_multiline edittext_wordwrap edittext_hastext edittext_useoutlines edittext_border edittext_noselect is_text_control text_hasfont text_hascolour text_hasyoffset text_hasxoffset sound_hasinpoint sound_hasoutpoint sound_hasloops sound_hasenvelope $tagdict $tagdef $actiondict $actiondef ); use Flash::Types::Action; use Flash::Types::ActionCondition; use Flash::Types::CXform; use Flash::Types::Colour ; use Flash::Types::FillStyle; use Flash::Types::KerningPair; use Flash::Types::LineStyle; use Flash::Types::Matrix; use Flash::Types::Rect; use Flash::Types::ShapeRecord; use Flash::Types::ShapeStyle; use Flash::Types::SoundEnvelope; use Flash::Types::SoundState; use Flash::Types::ButtonState; use Flash::Types::ButtonRecord; use Flash::Types::TextRecord; use Flash::Tags::Default; use Flash::Tags::DefineBitsLossless; use Flash::Tags::DefineFont; use Flash::Tags::DefineShape; use Flash::Tags::DefineSound; use Flash::Tags::DoAction; use Flash::Tags::PlaceObject; use Flash::Tags::RemoveObject; use Flash::Tags::ShowFrame; use Flash::Tags::StartSound; use Flash::Tags::DefineBits; use Flash::Tags::DefineSprite; use Flash::Tags::DefineButton; use Flash::Tags::DefineButton2; use Flash::Tags::DefineButtonSound; use Flash::Tags::DefineFont2; use Flash::Tags::DefineShape2; use Flash::Tags::DefineText; use Flash::Tags::FrameLabel; use Flash::Tags::PlaceObject2; use Flash::Tags::RemoveObject2; use Flash::Tags::SoundStreamHead; use Flash::Tags::JPEGtables; use Flash::Tags::DefineBitsJPEG2; use Flash::Tags::DefineEditText; use Flash::Tags::DefineFontInfo; use Flash::Tags::DefineShape3; use Flash::Tags::DefineText2; use Flash::Tags::NameCharacter; use Flash::Tags::Protect; use Flash::Tags::SetBackgroundColour; use Flash::Tags::SoundStreamHead2; use Flash::Tags::End; # package to define a load of constants that modules might need # --- define all the constants we need use constant place_move => 0x01; # this place moves an exisiting object use constant place_character => 0x02; # there is a character tag (if no tag, must be a move) use constant place_matrix => 0x04; # there is a matrix (matrix) use constant place_colour_transform => 0x08; # there is a color transform (cxform with alpha) use constant place_ratio => 0x10; # there is a blend ratio (word) use constant place_name => 0x20; # there is an object name (string) use constant place_define_clip => 0x40; # this shape should open or close a clipping bracket (character ! => 0 to open, character => => 0 to close) # --- texture/bitmap fills use constant fill_gradient => 0x10; use constant fill_lineargradient => 0x10; use constant fill_radialgradient => 0x12; use constant fill_bits => 0x40; # if this bit is set, must be a bitmap pattern # --- one bit left for expansion use constant fill_maxgradientcolours => 8; # --- these flag codes are used for state changes use constant flags_moveto => 0x01; use constant flags_fill0 => 0x02; use constant flags_fill1 => 0x04; use constant flags_line => 0x08; use constant flags_newstyles => 0x10; use constant flags_end => 0x80; # a state change with no change marks the end # --- font flags use constant font_unicode => 0x20; use constant font_shiftJIS => 0x10; use constant font_ANSI => 0x08; use constant font_italic => 0x04; use constant font_bold => 0x02; use constant font_widecodes => 0x01; # --- edit text field flags use constant fontflags_bold => 0x01; use constant fontflags_italic => 0x02; use constant fontflags_widecodes => 0x04; use constant fontflags_wideoffsets => 0x08; use constant fontflags_ANSI => 0x10; use constant fontflags_unicode => 0x20; use constant fontflags_shiftJIS => 0x40; use constant fontflags_haslayout => 0x80; # --- edit text flags use constant edittext_hasfont => 0x0001; use constant edittext_hasmaxlength => 0x0002; use constant edittext_hastextcolour => 0x0004; use constant edittext_readonly => 0x0008; use constant edittext_password => 0x0010; use constant edittext_multiline => 0x0020; use constant edittext_wordwrap => 0x0040; use constant edittext_hastext => 0x0080; use constant edittext_useoutlines => 0x0100; use constant edittext_border => 0x0800; use constant edittext_noselect => 0x1000; use constant edittext_haslayout => 0x2000; # -- textFlags use constant is_text_control => 0x80; use constant text_hasfont => 0x08; use constant text_hascolour => 0x04; use constant text_hasyoffset => 0x02; use constant text_hasxoffset => 0x01; # -- Start Sound Flags use constant sound_hasinpoint => 0x01; use constant sound_hasoutpoint => 0x02; use constant sound_hasloops => 0x04; use constant sound_hasenvelope => 0x08; # the upper 4 bits are reserved for synchronization flags $tagdef = { End => 0, ShowFrame => 1, DefineShape => 2, FreeCharacter => 3, PlaceObject => 4, RemoveObject => 5, DefineBits => 6, DefineButton => 7, JPEGtables => 8, SetBackgroundColour => 9, DefineFont => 10, DefineText => 11, DoAction => 12, DefineFontInfo => 13, DefineSound => 14, # Event sound tags. StartSound => 15, DefineButtonSound => 17, SoundStreamHead => 18, SoundStreamBlock => 19, DefineBitsLossless => 20, # A bitmap using lossless zlib compression. DefineBitsJPEG2 => 21, # A bitmap using an internal JPEG compression table. DefineShape2 => 22, DefineButtonCxform => 23, Protect => 24, # This file should not be importable for editing. # These are the new tags for Flash 3. PlaceObject2 => 26, # The new style place w/ alpha color transform and name. RemoveObject2 => 28, # A more compact remove object that omits the character tag (just depth). DefineShape3 => 32, # A shape V3 includes alpha values. DefineText2 => 33, # A text V2 includes alpha values. DefineButton2 => 34, # A button V2 includes color transform, alpha and multiple actions DefineBitsJPEG3 => 35, # A JPEG bitmap with alpha info. DefineBitsLossless2 => 36, # A lossless bitmap with alpha info. DefineEditText => 37, # An editable Text Field DefineSprite => 39, # Define a sequence of tags that describe the behavior of a sprite. NameCharacter => 40, # Name a character definition, character id and a string, # (used for buttons, bitmaps, sprites and sounds). FrameLabel => 43, # A string label for the current frame. SoundStreamHead2 => 45, # For lossless streaming sound, should not have needed this... DefineMorphShape => 46, # A morph shape definition DefineFont2 => 48, # }; %$tagdict = reverse %$tagdef; $actiondef = { None => 0x00, NextFrame => 0x04, PrevFrame => 0x05, Play => 0x06, Stop => 0x07, ToggleQuality => 0x08, StopSounds => 0x09, Add => 0x0A, Subtract => 0x0B, Multiply => 0x0C, Divide => 0x0D, Equal => 0x0E, LessThan => 0x0F, LogicalAnd => 0x10, LogicalOr => 0x11, LogicalNot => 0x12, StringEqual => 0x13, StringLength => 0x14, SubString => 0x15, Int => 0x18, Eval => 0x1C, SetVariable => 0x1D, SetTargetExpression => 0x20, StringConcat => 0x21, GetProperty => 0x22, SetProperty => 0x23, DuplicateClip => 0x24, RemoveClip => 0x25, Trace => 0x26, StartDragMovie => 0x27, StopDragMovie => 0x28, StringLessThan => 0x29, Random => 0x30, MBLength => 0x31, Ord => 0x32, Chr => 0x33, GetTimer => 0x34, MBSubString => 0x35, MBOrd => 0x36, MBChr => 0x37, HasLength => 0x80, GotoFrame => 0x81, # frame num (WORD) GetURL => 0x83, # url (STR), window (STR) WaitForFrame => 0x8A, # frame needed (WORD), # actions to skip (BYTE) SetTarget => 0x8B, # name (STR) GotoLabel => 0x8C, # name (STR) WaitForFrameExpression => 0x8D, # frame needed on stack, # actions to skip (BYTE) PushData => 0x96, BranchAlways => 0x99, GetURL2 => 0x9A, BranchIfTrue => 0x9D, CallFrame => 0x9E, GotoExpression => 0x9F }; %$actiondict = reverse %$actiondef; 1;