Class #10 - Friday, May 23rd, 2008


  1. Read Chapter 4 - especially study the very last example program.

  2. Here is what we did in the lab class today in Studio II (they moved us out of Studio III). Hands-on class guide layers example, with History Panel, using the command history, etc.

    If you want to download and look at and play with the .fla file, click here: This DOWNLOADABLE version (day10.fla) is where we left off at the end of class. It does NOT have the needed ActionScript code. That is in the book, and on the day10.html and day10.swf web page, along with an explanation of some of the things we did to create day10.fla during our lab.

  3. Here is my version of today's exploding stars COMPLETE with the ActionScript, so you can examine the various layers and the various Symbols and see where everyting goes and how it works. Remember, play_btn has to be named in the right place!

  4. We will talk about the Chapter 5 example game. You received this as a handout yesterday, but is all in your book too. WE DID NOT GET TO THIS TODAY. WE WILL DO THAT ON TUESDAY in class #11!

  5. Here is a take off on the last example program in chapter 4. Exploding Star Mouse Trails.

  6. We discussed this new code today, which is available on the Racing Rectangles web page.
    var t:TextField = new TextField();
    addChild(t);
    t.visible = false;
    
    1. It was the first time you have ever seen the addChild(someObject) statement. addChild(t) places object t on the stage, so you can actually see it.
      var r_from_new : rectangleSymbol = new rectangleSymbol();
      
      addChild( r_from_new );
                              would place the newly created instance
                              of rectangleSymbol (a Movie Clip in our Library)
                              on the stage.
      r_from_new.x = 100;
      r_from_new.y = 200;     // and this would move it from (0, 0) to
                                                  location (100, 200) on the stage.
      
    2. Of course, if we set t's .visible property to FALSE, you will NOT be able to see it till we change t.visible to TRUE. We talked about the Boolean type of property and variables today. Boolean algebra consists of 2 different numbers, 0 and 1. The computer is based entirely on Boolean Algebra. 0 == false and 1 == true for Boolean Algebra.
      function reset(evt:MouseEvent):void {
         r1.x = 0;
         r2.x = 0;
         r3.x = 0;
         r4.x = 0;
         t.visible = false;    // Boolean property .visible of object t is 
                                  set to false.
                                    t.visible = 0;
                                    t.visible = false;
                                          are the SAME in many languages, 
                                            cause false is 0 and vice versa.
      }
      
    3. Today was the first day we have seen an object get created at RUN TIME instead of being created and placed on the stage during DESIGN TIME (also known as AUTHORING time for Flash developers).
      var t:TextField = new TextField();
      
      Yes, if you ask what was new today in class 10, I will say:
      
             new
      
      Who's on first?             Who.