Is it possible to wrap variables / methods / methods of getting and setting in one common access modifier?

Is there a way to declare a group of members with one common access modifier? I really believe that this can be done in C ++ and some other languages, curious if AS3 exists.

Instead:

class FooBar { public var theDog:String = "Bark!"; public var theCat:String = "Miao!"; private var myBird:String = "Chirp!"; private var myPig:String = "Oink!"; } 

It can be written as:

 class FooBar { public { var theDog:String = "Bark!"; var theCat:String = "Miao!"; } private { var myBird:String = "Chirp!"; var myPig:String = "Oink!"; } } 
+4
source share
2 answers

I think you can write:

 private var str:String, i:int; 
+6
source

I'm sorry, but, unfortunately, the Flash / Flex compiler does not have such a shortcut (which I really miss when defining some of the static elements).

+1
source

Source: https://habr.com/ru/post/1381539/


All Articles