package { public class Setget { private var Str:String = "欢迎"; public function get Data():String { return Str; } public function set Data(ns:String):void { Str= ns; } } }
package { import flash.display.MovieClip public class Setgets extends MovieClip{ public function Setgets():void { init(); } private function init():void { var _set:Setget = new Setget (); trace(_set.Data) _set.Data="光临"; trace(_set.Data); } } }