JSFLConstants (library)

Categories:Flash

Overview

Summary

Static object for referencing the more common JSFL constants

Contents

Concept and Usage

Many of JSFL's methods and properties require particular values in order to function properly. Many of these are trivial, such as horizontal, linearGradient, or movie clip but between functions and methods, they are a good mix of normal and camelCase, and are not always immediately-memorable.

The JSFLConstants class is an attempt to place the more commonly-used constants in one place, so:

  • they can be accessed via a static object
  • there's a standard format
  • the developer can be assisted by Komodo's auto-complete:
$dom.align(JSFLConstants.transform.align.HORIZONTAL_CENTER); // equivilent to 'horizontal center'

What's more:

  • Pressing SHIFT+F1 (on a Windows machine at least) will take you immediately to the Adobe online help (if you set this up in Komodo's preferences)
  • CTRL+Clicking will jump you to the actual object definition where you can examine the properties yourself, or click on the @see help link:
frame:
{
	/**
	 * frame.labelType
	 * @see http://help.adobe.com/en_US/flash/cs/extend/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7abd.html
	 */
	labelType: 
	{
		'NONE':           'none',
		'NAME':           'name',
        ...

API

The following constants are available to use (click the red link text on the containing objects below to view the Adobe help):

[JSFLConstants] => Object                    

	[bitmap] => Object              
        [compressionType] => Object 
             PHOTO:                 'photo'
             LOSSLESS:              'lossless'

	[element] => Object             
        [elementType] => Object     
             SHAPE:                 'shape'
             TEXT:                  'text'
             TLF_TEXT:              'tlfText'
             INSTANCE:              'instance'
             SHAPE_OBJ:             'shapeObj'

	[filter] => Object              
        [type] => Object            
             INNER:                 'inner'
             OUTER:                 'outer'
             FULL:                  'full'

        [name] => Object            
             ADJUST_COLOR_FILTER:   'adjustColorFilter'
             BEVEL_FILTER:          'bevelFilter'
             BLUR_FILTER:           'blurFilter'
             DROP_SHADOW_FILTER:    'dropShadowFilter'
             GLOW_FILTER:           'glowFilter'
             GRADIENT_BEVEL_FILTER: 'gradientBevelFilter'
             GRADIENT_GLOW_FILTER:  'gradientGlowFilter'

        [property] => Object        
             BLUR_X:                'blurX'
             BLUR_Y:                'blurY'
             QUALITY:               'quality'
             DISTANCE:              'distance'
             STRENGTH:              'strength'
             KNOCKOUT:              'knockout'
             INNER:                 'inner'
             BEVEL_TYPE:            'bevelType'
             COLOR:                 'color'
             SHADOW_COLOR:          'shadowColor'
             HIGHLIGHT_COLOR:       'highlightColor'

	[fill] => Object                
        [fillStyle] => Object       
             BITMAP:                'bitmap'
             SOLID:                 'solid'
             LINEAR_GRADIENT:       'linearGradient'
             RADIAL_GRADIENT:       'radialGradient'
             NO_FILL:               'noFill'

	[frame] => Object               
        [labelType] => Object       
             NONE:                  'none'
             NAME:                  'name'
             COMMENT:               'comment'
             ANCHOR:                'anchor'

        [tweenType] => Object       
             MOTION:                'motion'
             SHAPE:                 'shape'
             NONE:                  'none'

        [easeCurve] => Object       
             ALL:                   'all'
             POSITION:              'position'
             ROTATION:              'rotation'
             SCALE:                 'scale'
             COLOR:                 'color'
             FILTERS:               'filters'

	[instance] => Object            
        [instanceType] => Object    
             SYMBOL:                'symbol'
             BITMAP:                'bitmap'
             EMBEDDED_VIDEO:        'embedded video'
             LINKED_VIDEO:          'linked video'
             VIDEO:                 'video'
             COMPILED_CLIP:         'compiled clip'

	[item] => Object                
        [itemType] => Object        
             UNDEFINED:             'undefined'
             COMPONENT:             'component'
             MOVIE_CLIP:            'movie clip'
             GRAPHIC:               'graphic'
             BUTTON:                'button'
             FOLDER:                'folder'
             FONT:                  'font'
             SOUND:                 'sound'
             BITMAP:                'bitmap'
             COMPILED_CLIP:         'compiled clip'
             SCREEN:                'screen'
             VIDEO:                 'video'

	[layer] => Object               
        [animationType] => Object   
             NONE:                  'none'
             MOTION_OBJECT:         'motion object'
             IK_POSE:               'IK pose'

        [layerType] => Object       
             NORMAL:                'normal'
             GUIDE:                 'guide'
             GUIDED:                'guided'
             MASK:                  'mask'
             MASKED:                'masked'
             FOLDER:                'folder'

	[parameter] => Object           
        [valueType] => Object       
             DEFAULT:               'Default'
             ARRAY:                 'Array'
             OBJECT:                'Object'
             LIST:                  'List'
             STRING:                'String'
             NUMBER:                'Number'
             BOOLEAN:               'Boolean'
             FONT_NAME:             'Font Name'
             COLOR:                 'Color'
             COLLECTION:            'Collection'
             WEB_SERVICE_URL:       'Web Service URL'
             WEB_SERVICE_OPERATION: 'Web Service Operation'

	[symbol] => Object              
        [symbolType] => Object      
             BUTTON:                'button'
             MOVIE_CLIP:            'movie clip'
             GRAPHIC:               'graphic'

        [blendMode] => Object       
             NORMAL:                'normal'
             LAYER:                 'layer'
             MULTIPLY:              'multiply'
             SCREEN:                'screen'
             OVERLAY:               'overlay'
             HARDLIGHT:             'hardlight'
             LIGHTEN:               'lighten'
             DARKEN:                'darken'
             DIFFERENCE:            'difference'
             ADD:                   'add'
             SUBTRACT:              'subtract'
             INVERT:                'invert'
             ALPHA:                 'alpha'
             ERASE:                 'erase'

	[sound] => Object               
        [compressionType] => Object 
             DEFAULT:               'Default'
             ADPCM:                 'ADPCM'
             MP3:                   'MP3'
             RAW:                   'Raw'
             SPEECH:                'Speech'

	[stroke] => Object              
        [capType] => Object         
             NONE:                  'none'
             ROUND:                 'round'
             SQUARE:                'square'

        [joinType] => Object        
             MITER:                 'miter'
             ROUND:                 'round'
             BEVEL:                 'bevel'

        [scaleType] => Object       
             NORMAL:                'normal'
             HORIZONTAL:            'horizontal'
             VERTICAL:              'vertical'
             NONE:                  'none'

        [style] => Object           
             NO_STROKE:             'noStroke'
             SOLID:                 'solid'
             DASHED:                'dashed'
             DOTTED:                'dotted'
             RAGGED:                'ragged'
             STIPPLE:               'stipple'
             HATCHED:               'hatched'

	[text] => Object                
        [textType] => Object        
             STATIC:                'static'
             DYNAMIC:               'dynamic'
             INPUT:                 'input'

        [lineType] => Object        
             SINGLE_LINE:           'single line'
             MULTILINE:             'multiline'
             MULTILINE_NO_WRAP:     'multiline no wrap'
             PASSWORD:              'password'

        [alignment] => Object       
             LEFT:                  'left'
             CENTER:                'center'
             RIGHT:                 'right'
             JUSTIFY:               'justify'

	[transform] => Object           
        [align] => Object           
             LEFT:                  'left'
             RIGHT:                 'right'
             TOP:                   'top'
             BOTTOM:                'bottom'
             VERTICAL_CENTER:       'vertical center'
             HORIZONTAL_CENTER:     'horizontal center'

        [corner] => Object          
             BOTTOM_LEFT:           'bottom left'
             BOTTOM_RIGHT:          'bottom right'
             TOP_RIGHT:             'top right'
             TOP_LEFT:              'top left'
             TOP_CENTER:            'top center'
             RIGHT_CENTER:          'right center'
             BOTTOM_CENTER:         'bottom center'
             LEFT_CENTER:           'left center'

        [distribute] => Object      
             LEFT_EDGE:             'left edge'
             HORIZONTAL_CENTER:     'horizontal center'
             RIGHT_EDGE:            'right edge'
             TOP_EDGE:              'top edge'
             VERTICAL_CENTER:       'vertical center'
             BOTTOM_EDGE:           'bottom edge'

	[video] => Object               
        [videoType] => Object       
             EMBEDDED_VIDEO:        'embedded video'
             LINKED_VIDEO:          'linked video'
             VIDEO:                 'video'
                                    

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>