MACROMEDIA FLASH 8-FLASH Dokumentacja Strona 262

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 290
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 261
262 ActionScript: Work with Objects and Classes
function Product (id:Number, prodName:String,
description:String) {
setID(id);
setProdName(prodName);
setDescription(description);
}
public function setID (id:Number) :Void
{
this.id = id;
}
public function setProdName (prodName:String) :Void
{
this.prodName = prodName;
}
public function setDescription (description:String)
:Void
{
this.description = description;
}
public function getID () :Number {
return id;
}
public function getProdName () :String {
return prodName
}
public function getDescription () :String {
return description;
}
}
6.
Save your file.
Create two objects from the
Product class
You’ll create a new FLA file, and then create two objects from the
Product class.
1. Open a new Flash document and save it in the same location where you
saved Product.as.
2. In the new document, select Frame 1 in the Timeline.
NOTE
A finished sample file of the file you just created, named Product.as, is
located in your finished files folder. For the path, see “Set up your
workspace” on page 256.
Przeglądanie stron 261
1 2 ... 257 258 259 260 261 262 263 264 265 266 267 ... 289 290

Komentarze do niniejszej Instrukcji

Brak uwag