SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
7.
// MyClass.as
public class MyClass
{
private var strTitle:String;
private var _price_code:int;
public function get_price_code ():int
{
return _price_code;
}
public function setPriceCode (arg:int):void
{
_price_code = arg;
}
..
}
9.
// MyClass.as
public class MyClass //
{
public static const NAME:String //
private var _price:int; // private
public function get_price_code():int // function
{
return _price;
}
public function set_username(name:String):void //
{
var age:int = 30; //
}
}
10.
// Member.as
public class Member
{
...
public function member_info():String { .... }
public function get_member_info():String { .... }
public function user_info():String { .... }
public function get_user():String { .... }
..
}
11.
// MyClass.as
package tw.eddie.com {
public class MyClass
{
...
private var _title:String; //
public function get_price_code ():int
{
return _price_code;
}
..
}
}
12.
// BookStore.as
public class BookStore
{
...
public function setBookInfo (bookname:String, author:String, total_page:int,
amount:int, price:int, publish_date:String, is_available:Boolean):void
{
...
}
..
}
13.
//
book = new Book("Hello AS3", 1, 320, 550, "2011/6/21");
// ?
book = new Book();
book.name = “Hello AS3”;
book.amount = 1;
book.page = 320;
book.price = 550;
book.publish_date = “2011/6/21”
14.
// MyClass.as
public class MyClass
{
...
public function set_user (username:String = “guest”):void
{
...
}
..
}
15.
// ?
book = new Book(“hello AS3”, true, false);
//
book = new Book(“hello AS3”, Book.IS_AVAILABLE, Book.IN_STOCK);
16.
// BookStore.as
/**
* BookStore ...
*
*
*/
public class BookStore
{
/**
* ASDoc
*/
public function setBookInfo(book:Book):void
{
...
}
..
}
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_9.html
17.
// BookStore.as
public class BookStore
{
...
public function setBookInfo(book:Book):void
{
book.count += 1; // 1
...
}
..
}
20.
Thank You!
2011/6/21
Kaos’ Digital Network, Ltd.
TEL +886-2-2682-4700
No.26, Ln. 248, Junying St., Shulin Dist., New Taipei
City 238, Taiwan (R.O.C.)
Welcome to visit http://digik.tw for more information!