Chapter 6 Example 3

by actionscriptbible
♥0 | Line 16 | Modified 2009-06-16 03:46:11 | MIT License
play

ActionScript3 source code

/**
 * Copyright actionscriptbible ( http://wonderfl.net/user/actionscriptbible )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/E9iX
 */

package {
  import com.actionscriptbible.Example;
  public class ch6ex3 extends Example {
    public function ch6ex3() {

      var greeting:String = "Good day.";
      var name:String = "Roger";
      var s1:String = greeting.concat(" My name is ", name, ". How are you?");
      trace(s1); //Good day. My name is Roger. How are you?
      
      var s2:String = greeting + " My name is " + name + ". The + operator ROCKS!";
      trace(s2); //Good day. My name is Roger. The + operator ROCKS!
      
      var a:String = "Ground control";
      var b:String = "Major Tom";
      trace(a, "to", b); //Ground control to Major Tom

    }
  }
}