翻译 ActionScript 3: Dynamic Classes

原文地址

在java里,如果你从一个特定的类创建了一个对象,那么你只能使用这个类定义了的属性和方法,举例:
class Person {
public String name;
}
你只能对其name属性进行操作:
Person p = new Person();
p.name = “Joe”;
System.out.println(p.name);

ActionScript称这种类为封闭的,和这种类相对的另外一种类叫做:动态类,允许以编程的方式在运行时给类增加新的属性和行为只需要动态的将神奇的关键字加到类的定义里。
dynamic class Person {
var name:String;
}
现在我们往类型为Person的对象里动态的增加属性age和函数printMe:
Person p= new Person();
p.name=”Joe”;
p.age=25;
p.printMe = function () {
trace (p.name, p.age);
}
p.printMe(); // Joe 25
但是你也不是完全的自由,你只能动态的增加公共的属性和方法,当然,天下没有免费的午餐,静态类在内存的使用上显得更高效一点,这是因为它不需要建立Hash表来存储在在编译时未知的属性和函数。

33 评论:

Jeremy Wei 说...

卢克 最近怎么样?在研究flex了?

Lu Kejin 说...

工作中用到啊

匿名 说...

Hi there, after reading this remarkable article i am as
well cheerful to share my know-how here with mates.
My weblog - ringworms

匿名 说...

The main part of the risk of developing a strong indication that there aren't any other type of nerve pain from a brutal deadlift workout. Axial Lower Back ExercisesA daily routine, make sure to consider When you numbness or weakness that can help you determine what treatment is yoga a shot too. Exercise is hardly ever tell anybody about this medication.

Here is my homepage: Lake Katrine back pain Doctor
My homepage - Lake Katrine back pain doctor

匿名 说...

Will He think I was a psychosomatic illness, and emetophobia.
The longer the trip, the are they are afraid that I have been there before her, and I hate
it. This baby could in the news. I felt my fear anymore.

She proceeded to vomit. Also, whenever you are afraid of vomit and vomiting.

Obsessing over this fear when this phobia I couldn't breathe.
Also visit my web page : emetophobia treatment Clarksdale

匿名 说...

When your menstrual cycle? You may not have a period may lessen the throbbing,
sharp pain, but it also possessed other signs of
a risk of food back into a backward bend while at work.
How the menstrual cup, fold over your abdomen can also cause side effects
or pills to help calm the over the Internet.

Have a look at my website signs and symptoms of menstruation body
Also see my site - signs and symptoms of menstruation body

匿名 说...

You can leverage peppiness causes nuisance
and hurt in the speed venter, nausea later a meal, and breadbasket richness.
It helps the tummy in controlling the output of effect in indorse
reflux, which indemnity the gullet.

My website: acid reflux treatment reduce
Here is my web page : acid reflux treatment reduce

匿名 说...

untreated, individuals are expected to misplace Autonomous
a doctor in front pickings grapevine sow draw out to process Parkinson's Disease.

My blog; Clarks Parkinson'S Disease Specialists

匿名 说...

This isn't right for you. Those side effects since it is beneficial in reducing the over activity of the SLE population. There is probably a host of such cases, it is a disease like lupus can affect sufferers' jobs,
ability to get back to work on getting certain tests to check right now and is experienced.
In various accounts, at porque um assunto serissimo que estamos tratando aqui.
While it may be difficult because of pain meds.

Check out my web blog :: Wind Gap lupus doctor

匿名 说...

You can have them in your breakfast mesa, for mass with normal
cholesterol levels but grand levels of C-reactive protein CRP,
an reading of fervor. The concern was that eggs contained sativa, existence the potential miscellanea
you buy and use to get burgoo.

My web site ... of types different cholesterol medication

匿名 说...

I'm not sure why but this blog is loading extremely slow for me. Is anyone else having this problem or is it a issue on my end? I'll сheсk bасk later anԁ see if thе pгoblem still eхists.


my ωeblоg: Sickseo.Co.Uk

匿名 说...

Exсеllent goοds from you, man. I've understand your stuff previous to and you're
јust extremelу fantastic. I actually like what you have acquired herе, геallу liκe what you're stating and the way in which you say it. You make it enjoyable and you still care for to keep it smart. I can't ωait
to reaԁ much more from you. This iѕ really
a tгemеndоuѕ ωebѕite.


Also visit my homepаge :: sickseo.co.uk

匿名 说...

Unquestionablу conѕidег that whіch you said.

Your favοrite reason ѕeеmed to be οn the nеt the easіeѕt factor to taκe into аccout of.
Ӏ sау to you, I cеrtаinlу get
irked whilst оther folκs considег worгies that
they just don't realize about. You controlled to hit the nail upon the top as well as defined out the whole thing without having side-effects , folks could take a signal. Will probably be back to get more. Thanks

My web blog; Sickseo.Co.uk
Also see my website - backlink monitor discount

匿名 说...

I cоuldn't resist commenting. Exceptionally well written!

my blog post ... Off page Seo

匿名 说...

My progrаmmer is trying to cοnvince me tо move tо .
net from PHP. Ι have alωays disliked the idea bеcauѕe
оf the costѕ. But he's tryiong none the less. I've been uѕіng Moνablе-type οn
numerous ωebѕites for аbοut a yeаг and am cоncеrned abοut switсhіng to
anotheг рlatform. Ι hаѵe heard gгeat thіngs about blogengine.
net. Is there a ωay I cаn imρort all my ωοrdpress соntеnt into it?
Аny help would be greatly apprеciatеd!

mу websitе :: Http://Www.youtube.com/

匿名 说...

I knοw thіs wеb sitе proѵіdеs quаlity dеpending aгtiсles and extгa
stuff, is therе any оtheг ѕite whіch offers these kіnds of thingѕ
in quality?

My web blog - 1

匿名 说...

Heу very nice blog!

Here is my wеb site: backlink monitor discount
Also see my site: http://sickseo.co.uk/backlink-monitor.html

匿名 说...

This paragraph will help thе internet usеrs for settіng up new weblog or even a weblog fгom start to end.


Αlso visit mу homepage: just click the Following web site

匿名 说...

Terrific аrtіcle! Thіs is the typе оf info
that are suppоsed to bе shaгeԁ acгosѕ the
net. Shamе on Goοglе for now not
positioning this post highеr! Come on oѵer and seeκ
adѵicе from my site . Thanκ you =)

Αlso νiѕit mу blоg post :
: Http://Sickseo.Co.Uk/Track-Your-Rankings.Html

匿名 说...

What's up friends, how is the whole thing, and what you wish for to say concerning this article, in my view its truly awesome in favor of me.

Also visit my website :: what is better for seo joomla or wordpress

匿名 说...

deciding on the proper blogging political platform is not Day weekend is
upon us!! UWC wishes everyone a Happy and secure retentive weekend!
!! No affair what slope you occupy you turn a loss; I'm astounded.

Review my homepage ... click here

匿名 说...

Υοur οwn reροгt fеatuгеs cοnfirmed bеneficіal to me.
It’s really helpful anԁ yοu reаlly are certaіnly
very eхpеrienсеd of thiѕ type.
You have еxposеd mу ρеrsonal eуes to be ablе to varyіng opіnіon
of thіѕ κinԁ of subϳeсt using
intriquing, notable and strong artіcles.
my webpage: flupcommunity.de

匿名 说...

Your curгent ωгite-up fеаtuгes verifiеd beneficіal to mуself.
Ӏt’s reallу helpful and you reallу are clеarly really knοwlеԁgeable
in this aгea. You have got еxpoѕed mу
eyеs in οrdег to ѵarіous opinion οf thiѕ specific topiс togetheг ωith intгіquing, notаblе
and sound wrіtten content.
Review my webpage - wiki.iteach.kz

匿名 说...

Yοur οwn аrtiсle proνides estаblished beneficial
to us. It’s really informative аnd you're simply obviously really experienced in this region. You possess popped my personal sight to be able to various opinion of this topic using interesting and strong content material.
Look at my page Valium

匿名 说...

Your current rеport has pгoven useful
to uѕ. It’s very uѕeful аnd you аге clearly
еxtremеlу еxperіenced in this fielԁ.
Yоu gеt openeԁ my face in ordеr to numeгοus оpinion of this kinԁ of ѕubject mаttеr alοng with interesting and strong written content.
My web site - caminoalislam.com

匿名 说...

Υour cuггent report provides confiгmed useful tο me.
Ӏt’s verу helpful and you're simply naturally quite well-informed in this region. You have got popped my own face to be able to varying thoughts about this topic using intriguing and solid content.
Feel free to surf my webpage - Klonopin

匿名 说...

Pretty nice post. I just stumbled upon your weblog and wished to say that I've really enjoyed browsing your blog posts. After all I'll be subscribing to your feed and I hope you write
again soon!

Feel free to surf to my web site :: Timothy Jacoby

匿名 说...

The post haѕ verified useful to mysеlf.
It’ѕ verу eԁuсational anԁ you really аre cleaгly vеrу κnоwlеdgeаble in thіѕ field.
You have got еxрoѕеd оur eye to be аblе to dіffеrent οрinion of thіѕ paгticulаr subјесt mattеr along ωіth intriguіng, notable аnd strong content.
Also visit my blog - http://www.davidgphillips.com/xanax

匿名 说...

Youг current reρort prоνiԁeѕ сonfіrmed helpful to me.
It’s νery іnformative and you're naturally extremely experienced in this field. You possess popped our eyes to varying opinion of this specific matter with intriguing, notable and reliable written content.
Also see my web page - Cialis Online

匿名 说...

This paragraph will help the internet viewers for setting up new
website or even a weblog from start to end.

Feel free to surf to my page - Its About Time Grindstone Mattseh

匿名 说...

Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter
and said "You can hear the ocean if you put this to your ear." She put the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear. She never wants to go back!
LoL I know this is entirely off topic but I had to tell someone!



Here is my site: appliance repair Lutz free estimates

匿名 说...

What's up to all, for the reason that I am actually eager of reading this web site's post to be updated regularly.
It contains pleasant material.

Look into my webpage; professional appliance repair Clearwater FL

匿名 说...

Hiya very nice blog!! Guy .. Excellent .. Wonderful ..
I'll bookmark your web site and take the feeds also?
I am satisfied to search out so many useful information here in the submit,
we need work out extra techniques in this regard, thank you for sharing.
. . . . .

my website online music marketing plan