Student
Student

Reputation: 28345

ActionScript dynamic classes

Could anyone give me a good use case for ActionScript dynamic classes?

Because it really looks like a bad pratice, for me, in every case.

Upvotes: 3

Views: 748

Answers (3)

dotminic
dotminic

Reputation: 1145

Well you could use an Object object, but using a dynamic class ensures that it is typed. That's the way I see it, and it's the only reason I would use them. What Juan Pablo is saying is a good reason too.

Upvotes: 1

Cory Petosky
Cory Petosky

Reputation: 12646

Anything that uses Proxy must by extension be dynamic. I use Proxy fairly regularly; for example, here's a replacement syntax for ExternalInterface using Proxy.

Upvotes: 3

Juan Pablo Califano
Juan Pablo Califano

Reputation: 12333

URLVariables, for example.

You could store the data in a dictionary / object / array too, but you don't gain much in this case, I think, and you cut down some boilerplate.

Upvotes: 2

Related Questions