220 likes | 349 Views
Introduction to ActionScript 3 using Flash CS3 . Ravi Kumar Hamsa. Overview. History Penetration ActionScript 1 and 2. What you can do?. control the play head of a timeline move things around create and manage user interfaces play sounds control video manage data (xml, lists, etc)
E N D
Introduction to ActionScript 3 using Flash CS3 Ravi Kumar Hamsa
Overview • History • Penetration • ActionScript 1 and 2
What you can do? • control the play head of a timeline • move things around • create and manage user interfaces • play sounds • control video • manage data (xml, lists, etc) • communicate with server-side applications (e.g., web servers)
Introduction to Flash IDE • Workspace • Stage • Timeline • Layers • Toolbar • Library • Frames
What’s New in Flash CS3 • Animation to ActionScript conversion • Standard Adobe Interface • Advanced Debugger • Rich Drawing Capabilities • User Interface Components • QuickTime Export
Symbols and Instances • 3 Symbols Types, MovieClip, Graphi, Button • Symbol == Master • Instance == Copy • Instance Name
MovieClip Properties • x • y • width • height • scaleX • scaleY • rotation • alpha (transparency)
Timeline Control • play( ) • stop( ) • gotoAndPlay( ) • gotoAndStop( ) • nextFrame( ) • prevFrame( ) • currentFrame • currentLabel • currentLabels • totalFrames
Introduction to ActionScript 3 • Programming language for Flash run-time • Based on ECMA-262 edition 4 • New AVM2 • True OOM • Performance • Coding Standards
Operators • Arithmetic Operators: +, -, *, /, %, ++, –, +=, -=, *=, /=, %= • Comparison Operators: <, >, <=, >=, ==, ===, !,!=, !==, &&, || • Other Operators: is, as, in, typeof, instanceof • Operator precedence • Bitwise Operators
Conditional Statements • if, else, else if • switch, case
Loops • while • for, for each in • while (compare) { statements update } for (initialize; compare; update) { statements }
Data Types • Primitive:Boolean, int, null, Number, String, uint, undefined • Complex:Object, Array, Date, Error, Function, RegExp, XML, XMLList
Events • Built-in Events • Custom Events • EventDispatcher
Mouse Events • MouseEvent.MOUSE_DOWN • MouseEvent.MOUSE_UP • MouseEvent.CLICK • MouseEvent.DOUBLE_CLICK • MouseEvent.MOUSE_MOVE • MouseEvent.MOUSE_OVER • MouseEvent.MOUSE_OUT • MouseEvent.ROLL_OVER • MouseEvent.ROLL_OUT • MouseEvent.MOUSE_WHEEL
Keyboard Events • KeyboardEvent.KEY_DOWN • KeyboardEvent.KEY_UP • Global Key Event Handling
Animating • Motion Tween • Enterframe • Timer • Tween
Drawing API • Drawing lines curveTo( ), lineTo( ) • Drawing shapes beginBitmapFill( ), beginFill( ), beginGradientFill( ), drawCircle( ), drawEllipse( ), drawRect( ), drawRoundRect( ), drawRoundRectComplex( ), endFill( ) • Defining line styles lineGradientStyle( ), lineStyle( ) • Moving the drawing pen moveTo( ) • Removing graphics clear( )
Drag & Drop, Collision • StartDrag • StopDrag • Bounding Box • hitTestToObject • hitTestToPoint
Using Audio and Video • Video Encoder • Sound Class