I thought this would be simple - having one custom display object modify
another through a reference:
<mx:Application >
<c:MyComponentA />
<c:MyComponentB />
</mx:Application>
I want to have MyComponentA refer to objects/methods inside of MyComponentB. I
tried passing a reference in:
<mx:Application >
<c:MyComponentA id="myComponentA" />
<c:MyComponentB componentToModify="{myComponentA}"/>
</mx:Application>
But I get an error saying, "Access of possibly undefined property myComponentA
through a reference with static type flash.display:DisplayObject."
I tried calling "parent.myComponentA" from actionscript inside of
MyComponentB.MXML, but it couldn't find the instance of "myComponentA".
How do you handle this? I know this probably isn't ideal architecture, but
would there have to be scripts that listen for events in one component in the
main app and then modify the other component? I guess I could do that if it is
best practice. I need the two components to be separated because they are two
different parts of the UI, but need to interact. One has controls that change
the view and data in the other. Does it have to modify the other component
from actionscript on the main app or can I just pass a reference into one
component like I have tried?
Thanks.
Jason Merrill
Bank of America
Global Technology & Operations & Global Risk L&LD
eTools & Multimedia
Join the Bank of America Flash Platform Developer Community
<blocked::http://sharepoint.bankofamerica.com/sites/tlc/flash/default.aspx>
Are you a Bank of America associate interested in innovative learning ideas and
technologies?
Check out our internal GT&O Innovative Learning Blog
<blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/default.aspx>
& subscribe
<blocked::http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/_layouts/SubNew.aspx?List=\{41BD3FC9-BB07-4763-B3AB-A6C7C99C5B8D\}&Source=http://sharepoint.bankofamerica.com/sites/ddc/rd/blog/Lists/Posts/Archive.aspx>
.