Oh I see your using AS to create an instance of it.

This would work for accessing that property...
var newMyClass:MyClass = new MyClass()
newMyClass.myProperty = object being passed.


But since your using AS you could pass it in the constructor now.

    public class MyClass
    {
        //Constructor
        public function MyClass (myProp:Object)
        {
            //init stuff using whatever you passed.
        }
    }

var newMyClass:MyClass = new MyClass(My prop or object or whichever matches
your needs.)



-Mark


On Thu, Sep 26, 2013 at 9:01 PM, mark goldin <[email protected]> wrote:

> That is not exactly what I have. Yes, I too have an mxml class based on
> another AS class. But I am creating an instance of my mxml class like this:
> var newMyClass:MyClass = new MyClass();
> So, how can I pass a value for myProperty to newMyClass? My understanding
> as soon as var newMyClass:MyClass = new MyClass(); executes all children on
> newMyClass will be created but I need to have myProperty before that.
>
>

Reply via email to