Examples in Flex for F21MA
- Which Ones to Use? Examples that I think will be most useful to your project are in bold
- Note that all examples have view source enabled (right-click application).
- Directory Listing here
- Previous projects examples developed in Flex Builder 3 are here.
Flash Builder 4 Examples
Unit 1 – buttons
- p1.1 - threeSparkButtons
Three buttons, one of which invokes an ‘alert’ box.
Unit 2 – flick book examples
- Example Images: a set of images of the blue man is zipped here: exampleImages.zip and a set of walking jumping stickmen are here.
- p2.1 - mxmlFlickBookSparkV002
(sequence of images loaded inside an <mx: Canvas> control. Images accessed using Spark ‘getElement’ method. Animation works via ENTER_FRAME event handler, making images visible or invisible) - p2.2 - twoFlickBookBehavioursSparkV001
(as above – image sequence contains two behaviours each invoked by its own button) - p2.3 - flickbookComponentSparkV001
(as above but some code moved into a custom mxml component so that we can have two characters on the screen) - p2.4 - arraysOfSparkCharacters
(as above but creates an array of custom mxml components so that we can have as many of them as we like and so that we can loop through this group of characters using an integer index. Use this for your images from Sandy’s class – its similar to the example above, except without the complication of the custom events.) - p2.5 - customEventSparkCharacters
(dispatches a custom event from the character component which is tells the application when the character has completed its ‘fall’ behaviour)
Unit 3 – basic bouncing ball
- p3.1 - bouncing Ball SparkV001 (one fire ball)
Basic 2nd order dynamics with vertical acceleration set to gravity. Down-clicking the ball provides a ‘fire’ function in which the new ball velocity (vx, vy) is set to 5 times the vector (x, y) from the ball centre to the mouse. - p3.2 - bouncing Ball Spark V002 (array of fire balls)
Similar to above except that ‘fire’ code has been moved into the ball component to make it easy to have an array of these components. - p3.3 - drag BallSpark array V001
Basic 2nd order dynamics but no inertia, spring or velocity friction effects. Vertical acceleration set to gravity. Down-clicking the ball provides a ‘fire’ function in which the new ball velocity (vx, vy) is set to 5 times the vector (x, y) from the ball centre to the mouse.
Unit 4 – 2nd order dynamics
- p4.1 singleSetPointBallSparkV002
(Simple demo. of a bouncing ball with drag function on setpoint.
Down-clicking the ball allows you to drag its setpoint to a new position as indicated by a red-line)
Unit 5 – Collisions
- p5.1 sparkCollisionDetectionV001 an array of ‘fire balls’ (taken from p3.2)that have collision detection and code similar to Peter’s collision dynamics added to the main application file.
- p5.2 bitmapCollisionDetectionExample use of bitmaps to detection collisions at the pixel level (rather than just intersection of bounding boxes)
Unit 6 – Forward Kinematics
- p6.1 RealWalk compilation of Peter’s actionScript code implementing walking man from chapter 13 of his book “Foundation Actionscript 3.0 Animation: Making Things Move!” Note viewsource is not enabled. Source available from friendsofed.
Unit 7 – Inverse Kinematics
- p7.1 MultiSegmentReach compilation of Peter’s actionScript code implementing a reaching chain of links. taken from chapter 14 of his book “Foundation Actionscript 3.0 Animation: Making Things Move!” Note viewsource is not enabled. Source available from friendsofed.
- p7.2 PlayBall.html compilation of Peter’s actionScript code implementing reaching chain playing with a ball from chapter 14 of his book “Foundation Actionscript 3.0 Animation: Making Things Move!” Note viewsource is not enabled. Source available fromfriendsofed.
- p7.3 MultiSegmentDrag compilation of Peter’s actionScript code implementing ‘dragging’ of chain of links. taken from chapter 14 of his book “Foundation Actionscript 3.0 Animation: Making Things Move!“
Flex Builder 3 Examples
Unit 8
- p8.1 crowdV002.html (randomly moving silhouettes of people with perspective and z-display ordering)
Unit 9
- p9.1 mySQL php Test and associated php files (example of how to update a mySQL database
Miscellaneous
- f21ma Project Describer (example of how to save data to an xml file on the client)
- fractal texture generator
- word-cloud generator