Join object array : Join : Array Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Array » Join »

 

Join object array


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        
        var bookshelf:Array = new Array(3);
        bookshelf[0new Book("A","a",1999);
        bookshelf[1new Book("B","b",2000);
        bookshelf[2new Book("C","c",2001);
        trace(bookshelf.join("n"));
        bookshelf.sort();

    }
  }
}
 class Book {
        public var title:String;
        public var author:String;
        public var year:int;

        public function Book (title:String, author:String, year:int) {
            this.title = title;
            this.author = author;
            this.year = year;
        }

        public function toString():String {
            return '"' + title + '", ' + author + ' (' + year + ')';
        }
    }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Array
» Join