Ian,
I would advise you to refactor a bit your code by trying to avoid
parentDocument, parentApplication etc...
You can achieve almost the same by dispatching an Event and your
outsider component listen to that event and do what you want.
By using this approach you will be able to reuse your components all
over your application and handle those events differently if you need to.
Something like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:Ctrl="Components.Controls.*"
layout="absolute"
top="10" left="10" right="10" bottom="10"
title="ITB Trouble Log">
<mx:Metadata>
[Event('troubleEntrySubmitEvent')]
</mx:Metadata>
<mx:Script>
<![CDATA[
[Bindable]
public var troubleEntry:troubleLog = new troubleLog();
protected function save(troubleEvent:Object):void
{
dispatchEvent( new Event('troubleEntrySubmitEvent'));
}
]]>
</mx:Script>
<mx:VBox>
<mx:Form>
<mx:FormItem label="Application">
<mx:TextInput text="{troubleEntry.application}"/>
</mx:FormItem>
</mx:Form>
<mx:Button label="Submit" click="save()"/>
</mx:VBox>
<mx:Button label="Trouble Log" right="10" top="10"/>
</mx:Panel>
In your outer application you would use something like this
<ns:MyCustomTroubleEntryComponent troubleEntry="{
bind.it.to.your.currentTroubleIfNeeded}"
troubleEntrySubmitEvent="myOutsideHandlerFunction(event)" />
Your "myOutsideHandlerFunction" will then get the event Object with a
target property where you can access your components properties.
Like this you could reuse your component in several places in your
application and they aren't tied to the application itself.
João Fernandes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:4291
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37