This compiles for me:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"> <mx:Script> <![CDATA[ import flash.media.Microphone; import flash.events.ActivityEvent; import flash.events.Event; import flash.events.StatusEvent; public var mic:Microphone = Microphone.getMicrophone(); // <--- gives the error ]]> </mx:Script> <mx:VBox> </mx:VBox> </mx:Application> You didn't happen to name your mxml file "mic" or "Microphone" did you? ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Amy Sent: Thursday, July 31, 2008 8:30 PM To: [email protected] Subject: [flexcoders] Re: Flex3 cookbook error in microphone example: constructor functions must be instance methods --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Jo Morano" <[EMAIL PROTECTED]> wrote: > > Moving the script up to the application level didn't help. I've put the code > from the book which should just compile (using an app now and moving vbox > below): > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> " width="400" > height="300" creationComplete="createMic()"> > <mx:Script> > <
