You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2013/09/25 21:10:37 UTC

[FALCON] MXML protected vars as attributes

@Gordon (mostly):

I ran into a situation where someone is setting protected variables via
MXML attributes.  Is this "allowed"?  I thought MXML attributes were only
for public properties.  MXMLC lets this happen.  Falcon does in one case,
but not another.  What should Falcon do?

MXMLC and Falcon allows:

---Base.mxml---
<s:Group>
  <fx:Script>
     protected var foo:int;
  </fx:Script>
</s:Group>

---Actual.mxml---
<Base foo="1" />


MXMLC allows, but Falcon doesn't like:

---Actual.mxml---
<s:Group foo="1">
  <fx:Script>
    protected var foo:int;
  </fx:Script>
</s:Group>

IOW, Falcon is ok with seeing protected vars on the base class but not new
protected vars on the actual class.

Thanks,
-Alex


Re: [FALCON] MXML protected vars as attributes

Posted by Tom Chiverton <tc...@extravision.com>.
On 25/09/2013 20:55, aYo ~ wrote:
> In developing mxml classes using code behind I've often accessed protected
> class variables via the mxml attributes. I believe it's allowed
Yeah, me too - the MXML is extending the base class, so of course gets 
access to package-local variables.

Tom

Re: [FALCON] MXML protected vars as attributes

Posted by aYo ~ <ay...@binitie.com>.
In developing mxml classes using code behind I've often accessed protected
class variables via the mxml attributes. I believe it's allowed

aYo
www.ayobinitie.com
mrbinitie.blogspot.com
On 25 Sep 2013 20:11, "Alex Harui" <ah...@adobe.com> wrote:

> @Gordon (mostly):
>
> I ran into a situation where someone is setting protected variables via
> MXML attributes.  Is this "allowed"?  I thought MXML attributes were only
> for public properties.  MXMLC lets this happen.  Falcon does in one case,
> but not another.  What should Falcon do?
>
> MXMLC and Falcon allows:
>
> ---Base.mxml---
> <s:Group>
>   <fx:Script>
>      protected var foo:int;
>   </fx:Script>
> </s:Group>
>
> ---Actual.mxml---
> <Base foo="1" />
>
>
> MXMLC allows, but Falcon doesn't like:
>
> ---Actual.mxml---
> <s:Group foo="1">
>   <fx:Script>
>     protected var foo:int;
>   </fx:Script>
> </s:Group>
>
> IOW, Falcon is ok with seeing protected vars on the base class but not new
> protected vars on the actual class.
>
> Thanks,
> -Alex
>
>

RE: [FALCON] MXML protected vars as attributes

Posted by Gordon Smith <go...@adobe.com>.
---Actual.mxml---

<s:Group foo="1">

  <fx:Script>

    protected var foo:int;

  </fx:Script>

</s:Group>



is supposed to be equivalent to



public class Actual extends Group

{

    public function Actual()

    {

        super();

        foo = 1;

    }



    protected var foo:int;

}



and ActionScript allows a constructor to access a protected (or private or public) instance variable. So I think the fact that Falcon doesn't allow this MXML is a bug.



- Gordon



-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com]
Sent: Wednesday, September 25, 2013 12:11 PM
To: dev@flex.apache.org
Subject: [FALCON] MXML protected vars as attributes



@Gordon (mostly):



I ran into a situation where someone is setting protected variables via MXML attributes.  Is this "allowed"?  I thought MXML attributes were only for public properties.  MXMLC lets this happen.  Falcon does in one case, but not another.  What should Falcon do?



MXMLC and Falcon allows:



---Base.mxml---

<s:Group>

  <fx:Script>

     protected var foo:int;

  </fx:Script>

</s:Group>



---Actual.mxml---

<Base foo="1" />





MXMLC allows, but Falcon doesn't like:



---Actual.mxml---

<s:Group foo="1">

  <fx:Script>

    protected var foo:int;

  </fx:Script>

</s:Group>



IOW, Falcon is ok with seeing protected vars on the base class but not new protected vars on the actual class.



Thanks,

-Alex