Just a suggestion, try changing the event type to flash.events.Event.
It doesn't have to be a MouseEvent.
1 person found this helpful
Your code looks like you are using a custom MXML component within your main app. Is this right? Your comments indicate you may be loading a swf file (module) into the main app...not sure which way you are doing this.
Anyway, I tested this and had no problem passing the event from the child component into the parent.
There are two mxml files:
FileUploadApp.mxml => Sets the stage, some constants, some variables, all the Alerts from events and the canvas.
There is a subordinate file, FileUpload.mxml => does all the work, has the images that are placed on the canvas and processes all events, but passes the events back to FileUploadApp.mxml to process the Alerts.
FileUpload.mxml is compiled to FileUpload.swf and included into FileUploadApp.swf, all in the same compile. Only FileUploadApp.swf is used in the Flash Player.
Do no know why this path was chosen, as in my original message, this is code I am modifying and updating. I have everything else running correctly except the Alerts. I tried moving all Alert processing to FileUpload.mxml to avoid passing the event through metadata, but no joy. The Alerts have to be processed where the original blank canvas is defined, that is FileUploadApp.mxml.
After a lot of testing and research, I determined the alert messages in the subordinate mxml file were being built before he stage was finished, therefore they did not exist as far as the compiled .swf file was concerned. Your question about the two mxml files was a very profound observation and pointed me to the basic cause of my problem.
Therefore, have rewritten the whole thing in one mxml file. Works like a charm. Many thanks for the clue.
One last question, what are the points (10 points for Correct answer, 5 points for Helpful answer) used for and what do they mean?
Thanks a lot,
Glad you got it working. Note that a child component should be able to pass data to its parent, and this allows you to segregrate you code into reusable chunks.
The points system? I think it helps people see who provides good answers.
Also, it may be a secret back-door into Adobe employment. (Just a theory; I've never been contacted by Adobe regarding any of their cushy jobs. All they do is take my money and provide me with great software in return. I guess that's fair.)
Happy New Flex Year, everybody!