christophe-hall / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

Can't Retrieve Metadata for Constructors #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With the following code, I would expect to be able to enumerate the Metadata 
attached to the Constructor:

    public class PersonMetadata
    {
        private var _name : String;
        private var _age : uint;
        private var _artists : Array;

        [Marshall(field="name")]
        public function PersonMetadata(name : String, age : uint) {}

        [Marshall(field="name")]
        public function init() : void {}
    }

// Inspecting the Metadata using:
trace(Type.forClass(PersonMetadata).getMetadataContainers("Marshall"));

What is the expected output? What do you see instead?
I only see the Metadata for the init method, not the constructor:
    [Method(name:'init', isStatic:false)]

What version of the product are you using? On what operating system?
Flash Player 10.3 Debugger.
as3commons-reflect-1.4.1

Original issue reported on code.google.com by j...@jonnyreeves.co.uk on 22 Jul 2011 at 12:35

GoogleCodeExporter commented 8 years ago
Sorry, found the answer myself - Constructor metadata is not defined above the 
Constructor and instead should be defined above the Class definition instead - 
I presume this is an MXMLC / Adobe limitation :(

Thanks!

Original comment by j...@jonnyreeves.co.uk on 22 Jul 2011 at 12:50

GoogleCodeExporter commented 8 years ago
Hi there,

yes, unfortunately this is indeed a flash player issue.

cheers,

Roland

Original comment by ihatelivelyids on 22 Jul 2011 at 6:58