The usual reason for things not appearing is that the component that should appear hasn't been added to the display list - just using new doesn't add an object to the display list.
Maybe addChild(notes) will help. Paul ----- Original Message ----- From: "annelie2008" <annelie.karls...@gmail.com> To: <flexcoders@yahoogroups.com> Sent: Thursday, January 29, 2009 1:47 PM Subject: [flexcoders] Re: newbie question - call to actionscript class >I should probably have commented out that bit of code, it's not the > xml I'm having problems with now (well, I have, but I'll get to those > questions later). I thought that by calling my actionscript class, > var notes:DrawNotes = new DrawNotes();, that would display my hard > coded score on screen? I was going to loop through the xml later to > go draw every specific element but for now I'm just trying to draw > anything. Do I need to connect that to a visual element? > > Cheers, > > Annelie > > > --- In flexcoders@yahoogroups.com, "Gregor Kiddie" <gkid...@...> > wrote: >> >> <mx:XML ... /> isn't a visual component. You'll need to use the XML > as a >> dataprovider from something that is. >> >> >> >> Gk. >> >> Gregor Kiddie >> Senior Developer >> INPS >> >> Tel: 01382 564343 >> >> Registered address: The Bread Factory, 1a Broughton Street, London > SW8 >> 3QJ >> >> Registered Number: 1788577 >> >> Registered in the UK >> >> Visit our Internet Web site at www.inps.co.uk >> <blocked::http://www.inps.co.uk/> >> >> The information in this internet email is confidential and is > intended >> solely for the addressee. Access, copying or re-use of information > in it >> by anyone else is not authorised. Any views or opinions presented > are >> solely those of the author and do not necessarily represent those of >> INPS or any of its affiliates. If you are not the intended recipient >> please contact is.helpd...@... >> >> ________________________________ >> >> From: flexcoders@yahoogroups.com > [mailto:flexcod...@yahoogroups.com] On >> Behalf Of annelie2008 >> Sent: 29 January 2009 10:43 >> To: flexcoders@yahoogroups.com >> Subject: [flexcoders] newbie question - call to actionscript class >> >> >> >> Hello, >> >> I'm brand new to Flex so I'm sure this is a very stupid question, > but >> hopefully someone will be able to help. >> >> My ultimate goal is to take an xaml file with a musical score and >> convert it to flex, but to start with I've hardcoded a score (or >> rather some score elements) in an actionscript class and I'm trying >> to call it from my main application file. When I debug I can see > that >> it does get called, however nothing gets drawn on screen. I first > did >> the hardcoded score in a project on its own, so I know that the > score >> should be able to be displayed. >> >> Here's the code: >> <?xml version="1.0" encoding="utf-8"?> >> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml >> <http://www.adobe.com/2006/mxml> " >> layout="absolute" initialize="initializeHandler()"> >> >> <mx:Script> >> <![CDATA[ >> >> import test.DrawNotes; >> >> public var myXmlList:XMLList; >> >> private function initializeHandler():void >> { >> myXmlList = scoreXml.children(); >> >> // loop through the xml here and call >> the relevant functions in DrawNotes >> >> var notes:DrawNotes = new DrawNotes(); >> } >> >> ]]> >> </mx:Script> >> >> <mx:XML id="scoreXml" source="scoreCanvas.xml" /> >> >> </mx:Application> >> >> Does anyone know what I'm doing wrong? >> >> Many thanks, >> >> Annelie >> > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > >