If you haven't figured this out already you should be able to declare
myXML in myBox as a protected (or public) var, then do the assignment in
MXML later and make sure you give it the same name.

Matt

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bhaq1972
Sent: Tuesday, April 18, 2006 2:10 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Flex2B2 - few questions

> 3. I'm not clear on whether myBoxComponent is using myBox or myBox
is
> using myBoxComponent, but I suspect what you are looking for is
> "parentDocument" to get at the component that is using you. So
maybe you
> want
>
>     parentDocument.someObject
>

What i wrote wasn't clear, sorry Gordon.

Virtualy all my components (~100 or more) use myBox.as as their
container. About 20% of these components have an <mx:XML
id="myXML">  tag eg.
myBoxComponent.mxml
-------------------
<myBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
<mx:XML id="myXML"><!--all have the same 'id'-->
<someXml/>
</mx:XML>
</myBox>

I want to deal with myXML generically from within myBox.as rather
than in the 20 odd components that use it.
eg  in myBox.as
private aFunction():void
{
if(this.myXML) //this worked in flex 1.5
{
  //do something
}
}
the other way i could do this is declare myXML in myBox.as and then
overide it in myBoxComponent.mxml (but how do you do overide a
<mx:XML> tag in mxml).

the flex1.5 way (translated to flex2b2) gives a compile error saying
this.myXML doesn't exist etc.

--- In flexcoders@yahoogroups.com, "Gordon Smith" <[EMAIL PROTECTED]>
wrote:
>
> 1. This method has been removed. Just use dispatchEvent().
>
> 2. Yes. Private vars can only be accessed from within the same
class
> where they are declared.
>
> 3. I'm not clear on whether myBoxComponent is using myBox or myBox
is
> using myBoxComponent, but I suspect what you are looking for is
> "parentDocument" to get at the component that is using you. So
maybe you
> want
>
>     parentDocument.someObject
>
> - Gordon
>
> -----Original Message-----
> From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On
> Behalf Of bhaq1972
> Sent: Thursday, April 13, 2006 3:38 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex2B2 - few questions
>
> 1) DispatchChangeEvent doesn't seem to be available is that
correct?
>
> 2) private variables no longer seem to be accesible in inherited
> object. is that correct?
> eg. myBox.as
> package
> {
>   public class myBox extends mx.containers.Box
>   {
>     public var string1:String="";
>     private var boolean1:Boolean=false;     
>   }
> }
>
> in myBoxComponent.mxml can't access this.boolean1.
>
> 3) how do i access an object declared in myBoxComponent.mxml from
> inside myBox.as i.e.
>
> in myBoxComponent.mxml i have
> public var someObject:Object; //i then create an instance of it
>
> in myBox.as, i want to reference someObject. how? any help great
>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to