20100505 (flash study)

enterFrame event: If the playhead is not moving, or if there is only one frame, this event is dispatched continuously in conjunction with the frame rate. Default frame rate is 24 frame per second. Note that if there are more than one frame, play head move from one frame to another at the speed of frame rate.


bendMode controls how current DisplayObject merges to its background.


Shape is lightweight, because it's not a container and it can't handle interactive event.


Implement drag and drop, when mouse down call startDrag, and call stopDrag after mouse release.


Width = Graphic object width * ScaleX, the same applies to height, also, change any of these three factors affact the others


Masking: The portions of the mask image become transparent, so content underneath shows through. The term is related to painter’s masking tape that is used to prevent paint from being applied to certain areas.


MovieClip: In practice, a MovieClip is similar to a Sprite object, except that it also has a timeline.


MorphShape—These objects are created when you create a shape tween in the Flash authoring tool. You cannot instantiate them using ActionScript, but they can be accessed from the display list.


StaticText class, in the flash.text package, extends the DisplayObject class, but you cannot create an instance of it in code. Static text fields are created only in Flash.


AVM1Movie—The AVM1Movie class is used to represent loaded SWF files that are authored in ActionScript 1.0 and 2.0.


For three of the scaleMode values (StageScaleMode.EXACT_FIT, StageScaleMode.SHOW_ALL, and StageScaleMode.NO_BORDER), Flash Player and AIR will scale the contents of the Stage to fit within its boundaries.
Alternatively, if scaleMode is set to StageScaleMode.NO_SCALE, the Stage contents maintain their defined size when the viewer resizes the Flash Player or AIR window.
Consequently, having scaleMode set to StageScaleMode.NO_SCALE allows you to have greater control over how the screen contents adjust to the window resizing if you desire.


If a display object has objects subscribed as listeners to its events, that display object will not be removed from memory even when it’s removed from the display list, because it will still have references to those listener objects. ??? fp can not handler circular reference?


Only one object can be dragged at a time using startDrag(), register the MOUSE_MOVE event of the Stage object and update x y value of target component to implement drag and drop manually.


Some event has the updateAfterEvent method, which indicates that the display should be rendered after processing of this event completes, if the display list has been modified


The default value for scrollRect is null, so by default, a display object is measured using width and height, unless scrollRect is set.


You can use 9-slice scaling (Scale-9) to create display objects where you have control over how the objects scale.
In ActionScript, setting a value for the scale9Grid property of a display object turns on 9-slice scaling for the object and defines the size of the rectangles in the object’s Scale-9 grid.


The opaqueBackground and scrollRect properties work best when an object is cached as a bitmap


When you set cacheAsBitmap to true, and also set the opaqueBackground property to a specified color, the opaqueBackground property allows the internal bitmap to be opaque and rendered faster.


ColorTransform, each color channel will calculate using offset + color * multiplier, setting to color property set all offset to given value and all multiplier to 0.


To indicate that a display object will be the mask for another display object, set the mask object as the mask property of the display object to be masked.
Alpha channel masking is supported if both the mask and the masked display objects use bitmap caching.


The LoaderInfo object can be accessed as a property of both the Loader object and the loaded display object. As soon as loading begins, the LoaderInfo object can be accessed through the contentLoaderInfo property of the Loader object. Once the display object has finished loading, the LoaderInfo object can also be accessed as a property of the loaded display object through the display object’s loaderInfo property.
In order to access properties of loaded content, you will want to add an event listener to the LoaderInfo object.


all ActionScript drawing must be performed using the same series of steps:
1.Define line and fill styles
2.Set the initial drawing position
3.Draw lines, curves, and shapes (optionally moving the drawing point)
4.If necessary, finish creating a fill


In a Sprite or MovieClip object, the drawing content created with the graphics property always appears behind all child display objects that are contained by the object.


The names refer to a more specific rule that defines how these fills are managed. Positively wound paths are assigned a value of +1; negatively wound paths are assigned a value of -1. For even-odd winding, the count of times the line crosses a path is used. When the count is odd, the area is filled. For even counts, the area is unfilled. For non-zero winding, the values assigned to the paths are used. When the combined values of the path are not 0, the area is filled. When the combined value is 0, the area is unfilled.
Winding rule affect within a single fill?


Shader is defined in pbj file, it can be embeded or loaded at runtime, shader can be used in 4 ways:
1.a draw fill: graphic.beginShaderFill(shader)
2.blend mode: displayObject.blendShader = shader (displayObject.blendMode = BlendMode.SHADER)
3.a filter: new ShaderFilter(shader)
4.stand alone mode: new ShaderJob(shader)

 

 

你可能感兴趣的:(Flash,AIR,FP,Blend,actionscript)