1
votes

I would like to send variables or parameters from Component to Main (MXML) Application. Like my component is FileUpload.mxml and would like to forward the uploaded file details from FileUpload.mxml to Main.mxml.

I tried the following procedure :

com:FileUpload id="fp"

to get the reference for the FileUpload component, however, I am unable to get the variables from the FileUpload.mxml file.

Can anyone help me to fix this issue ?

Serenity

1

1 Answers

0
votes

Depending on what stage of development you're in you may want to consider one of the Flex frameworks out there that would definitely help with this type of situation. I personally use Mate, but there are several other options out there Parsley, Cairngorm, RobotLegs, etc.).

With Mate, you would create a custom event that would get dispatched after something happens (a file being uploaded for example). This custom event could include any additional information, properties or data you would like to pass to another component. You would then add an event listener to your main map for your custom event. The main map would capture your custom event and re-route to whichever component(s) it needed to go to.

If that's not an option, make sure the properties you want to access are a) marked as [Bindable] and b) public. It's hard to say what could be the best solution without seeing some code.