[flexcoders] Re: getting the xml data from a dispatched event
import com.nutrition.Panelcreatemealitem; -TH --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > > It wont accept your suggestions > > Severity and Description Path Resource Location Creation Time Id > 1120: Access of undefined property Panelcreatemealitem. /src Main.mxml line 105 1246801954900 468962 > > > > > > > > > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: > > > > > > Wow, I've got to say; "What a mess." However, you can get it to work > > with the following changes: > > > > [Bindable] > > private var customMeals:XMLListCollection = new XMLListCollection(); > > > > > > > > // addToMeal event Handler > > private function addToMealHandler(event:Event):void > > { > > customMeals.addItem((event.target as > > Panelcreatemealitem).mealDetails); > > Alert.show(customMeals.toString()); > > } > > > > You have some naming conflicts and, since you're dealing with xml, > > you'll need to use an XMLListCollection; instead of an ArrayCollection. > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > > > > > Heres my three mxml files two of which are under the com/ folder and > > get imported...hope that helps > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > layout="vertical" > > > creationComplete="init()" styleName="plain" > > xmlns:nutrition="com.nutrition.*" > > > paddingLeft="10" paddingTop="10" paddingRight="10" paddingBottom="10"> > > > > > > > > > > > > > > > > > > > url="/main.php/flexnutrition/nutritioncal" > > > result="nutritionResultHandler(event)" > > > fault="nutritionFaultHandler(event)" resultFormat="e4x"/> > > > > > > > > > > > > > fontSize="18"/> > > > > > > > > > > > > > > > > > > > > > > > > > autoLoad="true" x="700" y="100" /> > > > > > > > > > > > > > > > > > > > meal="{nutritionData.breakfast}" > > > title="Breakfast : Please select one meal from > > below({maindata.breakfast} Cal Goal)"/> > > > > > > > > > > click="createBreakfast()"/> > > > > > > > > > > > > > > title="Snack : Please select one snack from below({maindata.snack1} > > Cal Goal)"/> > > > > > > > > > > > title="Lunch : Please select one meal from below({maindata.lunch} Cal > > Goal)"/> > > > > > > > > title="Snack : Please select one snack from below({maindata.snack2} > > Cal Goal)"/> > > > > > > > > > > > title="Dinner : Please select one meal from below({maindata.dinner} > > Cal Goal)"/> > > > > > > > > title="Snack : Please select one snack from below({maindata.snack3} > > Cal Goal)"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > borderThickness="2" id="vsCreateMeals"> > > > > > > > > > > meal="{nutritionData.breakfast}"/> > > > > > > > > > > > > > meal="{nutritionData.lunch}"/> > > > > > > > > > > > > > meal="{nutritionData.dinner}"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="100%" > > height="390" > > > borderThicknessLeft="0" borderThicknessRight="0" > > borderThicknessBottom="0" > > > dropShadowEnabled="false" > > > horizontalAlign="center" > > xmlns:containers="com.dougmccune.containers.*" title="Select An Item > > from below"> > > > > > > > > > > > > > > > > > > > height="100%" > > > horizontalGap="1" borderStyle="inset" backgroundColor="0xFF" > > > segments="9" reflectionEnabled="true"/> > > > > > > > > > > click="parentApplication.vsCreateMeals.selectedIndex=0;"/> > > > > click="parentApplication.vsCreateMeals.selectedIndex=1;"/> > > > > click="parentApplication.vsCreateMeals.selectedIndex=2;"/> > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" > > height="320" > > > title="{mealDetails.title}" horizontalAlign="center"> > > > > > > > > > > > > [Event(name="addToMeal")] > > > [Event(name="learnAboutThis")] > > > > > > > > > > > > > > > > > > > > > > width="285" height="159"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai samuel.lai@ wrote: > > > > > > > > It seems like wherever this code is - > > > > > > > > [Bindable] > > > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > > > > > //throws error on this line > > > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > > > event.target is actually the panel containing the 'create meal item' > > > > button, as opposed to the mealitem itself. Can you post some more of > > > > the script and MXML for that part? > > > > > > > > The src folder is empty for me too in the ZIP file. > > > > > > > > 2009/7/2 Jason B nospam@: > > > > > yes heres the results > > > > > > > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.cov\ \ > > erflow.Panelcreatemealitem1006" > > > > > > > >
[flexcoders] Re: getting the xml data from a dispatched event
It wont accept your suggestions Severity and DescriptionPathResourceLocation Creation Time Id 1120: Access of undefined property Panelcreatemealitem. /srcMain.mxml line 1051246801954900 468962 --- In flexcoders@yahoogroups.com, "Tim Hoff" wrote: > > > Wow, I've got to say; "What a mess." However, you can get it to work > with the following changes: > > [Bindable] > private var customMeals:XMLListCollection = new XMLListCollection(); > > > > // addToMeal event Handler > private function addToMealHandler(event:Event):void > { > customMeals.addItem((event.target as > Panelcreatemealitem).mealDetails); > Alert.show(customMeals.toString()); > } > > You have some naming conflicts and, since you're dealing with xml, > you'll need to use an XMLListCollection; instead of an ArrayCollection. > > -TH > > --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > > > Heres my three mxml files two of which are under the com/ folder and > get imported...hope that helps > > > > > > > > http://www.adobe.com/2006/mxml"; > layout="vertical" > > creationComplete="init()" styleName="plain" > xmlns:nutrition="com.nutrition.*" > > paddingLeft="10" paddingTop="10" paddingRight="10" paddingBottom="10"> > > > > > > > > > > > > url="/main.php/flexnutrition/nutritioncal" > > result="nutritionResultHandler(event)" > > fault="nutritionFaultHandler(event)" resultFormat="e4x"/> > > > > > > > > fontSize="18"/> > > > > > > > > > > > > > > > > autoLoad="true" x="700" y="100" /> > > > > > > > > > > > > meal="{nutritionData.breakfast}" > > title="Breakfast : Please select one meal from > below({maindata.breakfast} Cal Goal)"/> > > > > > > click="createBreakfast()"/> > > > > > > > > > title="Snack : Please select one snack from below({maindata.snack1} > Cal Goal)"/> > > > > > > > title="Lunch : Please select one meal from below({maindata.lunch} Cal > Goal)"/> > > > > > title="Snack : Please select one snack from below({maindata.snack2} > Cal Goal)"/> > > > > > > > title="Dinner : Please select one meal from below({maindata.dinner} > Cal Goal)"/> > > > > > title="Snack : Please select one snack from below({maindata.snack3} > Cal Goal)"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > borderThickness="2" id="vsCreateMeals"> > > > > > > meal="{nutritionData.breakfast}"/> > > > > > > > > meal="{nutritionData.lunch}"/> > > > > > > > > meal="{nutritionData.dinner}"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="100%" > height="390" > > borderThicknessLeft="0" borderThicknessRight="0" > borderThicknessBottom="0" > > dropShadowEnabled="false" > > horizontalAlign="center" > xmlns:containers="com.dougmccune.containers.*" title="Select An Item > from below"> > > > > > > > > > > > > height="100%" > > horizontalGap="1" borderStyle="inset" backgroundColor="0xFF" > > segments="9" reflectionEnabled="true"/> > > > > > > click="parentApplication.vsCreateMeals.selectedIndex=0;"/> > > click="parentApplication.vsCreateMeals.selectedIndex=1;"/> > > click="parentApplication.vsCreateMeals.selectedIndex=2;"/> > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" > height="320" > > title="{mealDetails.title}" horizontalAlign="center"> > > > > > > > > [Event(name="addToMeal")] > > [Event(name="learnAboutThis")] > > > > > > > > > > > > > > width="285" height="159"/> > > > > > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai samuel.lai@ wrote: > > > > > > It seems like wherever this code is - > > > > > > [Bindable] > > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > > > //throws error on this line > > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > event.target is actually the panel containing the 'create meal item' > > > button, as opposed to the mealitem itself. Can you post some more of > > > the script and MXML for that part? > > > > > > The src folder is empty for me too in the ZIP file. > > > > > > 2009/7/2 Jason B nospam@: > > > > yes heres the results > > > > > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.cov\ > erflow.Panelcreatemealitem1006" > > > > > > > > How can I access the object data, it's in a file thats under the > folder /com/nutrition/file.mxml > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > > >> > > > >> I'd add a trace statement just before it to see what type of > object > > > >> event.target is - it could be that the target is the UI > component, and > > > >> not the data object. > > > >> > > > >> //throws error on this line > > > >> trace(event.target); > > > >> customMeals.addItem((event.target as mealitem).mealDetails); > > > >> > > > >> 2009/
[flexcoders] Re: getting the xml data from a dispatched event
Wow, I've got to say; "What a mess." However, you can get it to work with the following changes: [Bindable] private var customMeals:XMLListCollection = new XMLListCollection(); // addToMeal event Handler private function addToMealHandler(event:Event):void { customMeals.addItem((event.target as Panelcreatemealitem).mealDetails); Alert.show(customMeals.toString()); } You have some naming conflicts and, since you're dealing with xml, you'll need to use an XMLListCollection; instead of an ArrayCollection. -TH --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > Heres my three mxml files two of which are under the com/ folder and get imported...hope that helps > > > > http://www.adobe.com/2006/mxml"; layout="vertical" > creationComplete="init()" styleName="plain" xmlns:nutrition="com.nutrition.*" > paddingLeft="10" paddingTop="10" paddingRight="10" paddingBottom="10"> > > > > > > result="nutritionResultHandler(event)" > fault="nutritionFaultHandler(event)" resultFormat="e4x"/> > > > > > > > > > > > > > > > > > > title="Breakfast : Please select one meal from below({maindata.breakfast} Cal Goal)"/> > > > > > > > title="Snack : Please select one snack from below({maindata.snack1} Cal Goal)"/> > > > title="Lunch : Please select one meal from below({maindata.lunch} Cal Goal)"/> > > title="Snack : Please select one snack from below({maindata.snack2} Cal Goal)"/> > > > title="Dinner : Please select one meal from below({maindata.dinner} Cal Goal)"/> > > title="Snack : Please select one snack from below({maindata.snack3} Cal Goal)"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="100%" height="390" > borderThicknessLeft="0" borderThicknessRight="0" borderThicknessBottom="0" > dropShadowEnabled="false" > horizontalAlign="center" xmlns:containers="com.dougmccune.containers.*" title="Select An Item from below"> > > > > > > horizontalGap="1" borderStyle="inset" backgroundColor="0xFF" > segments="9" reflectionEnabled="true"/> > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" height="320" > title="{mealDetails.title}" horizontalAlign="center"> > > > > [Event(name="addToMeal")] > [Event(name="learnAboutThis")] > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai samuel.lai@ wrote: > > > > It seems like wherever this code is - > > > > [Bindable] > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > //throws error on this line > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > event.target is actually the panel containing the 'create meal item' > > button, as opposed to the mealitem itself. Can you post some more of > > the script and MXML for that part? > > > > The src folder is empty for me too in the ZIP file. > > > > 2009/7/2 Jason B nospam@: > > > yes heres the results > > > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.cov\ erflow.Panelcreatemealitem1006" > > > > > > How can I access the object data, it's in a file thats under the folder /com/nutrition/file.mxml > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > >> > > >> I'd add a trace statement just before it to see what type of object > > >> event.target is - it could be that the target is the UI component, and > > >> not the data object. > > >> > > >> //throws error on this line > > >> trace(event.target); > > >> customMeals.addItem((event.target as mealitem).mealDetails); > > >> > > >> 2009/7/2 Jason B : > > >> > I've got an problem when the user clicks on button "Add to Meal" it throws an error because it can't seem to reference the data in mealDetails object inside the com/ directory? > > >> > > > >> > I'm trying to add the item to the list control. > > >> > > > >> > I have the code located here in case you want more details > > >> > http://files.getdropbox.com/u/228472/mealsflex.zip > > >> > > > >> > > > >> > [Bindable] > > >> > private var customMeals:ArrayCollection = new ArrayCollection; > > >> > > > >> > //throws error on this line > > >> > customMeals.addItem((event.target as mealitem).mealDetails); > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > http://www.adobe.com/2006/mxml"; width="310" height="320" > > >> > title="{mealDetails.title}" horizontalAlign="center"> > > >> > > > >> > > > >> > > > >> >[Event(name="addToMeal")] > > >> >[Event(name="learnAboutThis")] > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > -- > > >> > Flexcoders Mailing List > > >> > FAQ: http://group
[flexcoders] Re: getting the xml data from a dispatched event
Heres my three mxml files two of which are under the com/ folder and get imported...hope that helps http://www.adobe.com/2006/mxml"; layout="vertical" creationComplete="init()" styleName="plain" xmlns:nutrition="com.nutrition.*" paddingLeft="10" paddingTop="10" paddingRight="10" paddingBottom="10"> http://www.adobe.com/2006/mxml"; width="100%" height="390" borderThicknessLeft="0" borderThicknessRight="0" borderThicknessBottom="0" dropShadowEnabled="false" horizontalAlign="center" xmlns:containers="com.dougmccune.containers.*" title="Select An Item from below"> http://www.adobe.com/2006/mxml"; width="310" height="320" title="{mealDetails.title}" horizontalAlign="center"> [Event(name="addToMeal")] [Event(name="learnAboutThis")] --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > It seems like wherever this code is - > > [Bindable] > private var customMeals:ArrayCollection = new ArrayCollection; > > //throws error on this line > customMeals.addItem((event.target as mealitem).mealDetails); > > event.target is actually the panel containing the 'create meal item' > button, as opposed to the mealitem itself. Can you post some more of > the script and MXML for that part? > > The src folder is empty for me too in the ZIP file. > > 2009/7/2 Jason B : > > yes heres the results > > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.Panelcreatemealitem1006" > > > > How can I access the object data, it's in a file thats under the folder > > /com/nutrition/file.mxml > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > >> > >> I'd add a trace statement just before i
Re: [flexcoders] Re: getting the xml data from a dispatched event
It seems like wherever this code is - [Bindable] private var customMeals:ArrayCollection = new ArrayCollection; //throws error on this line customMeals.addItem((event.target as mealitem).mealDetails); event.target is actually the panel containing the 'create meal item' button, as opposed to the mealitem itself. Can you post some more of the script and MXML for that part? The src folder is empty for me too in the ZIP file. 2009/7/2 Jason B : > yes heres the results > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.Panelcreatemealitem1006" > > How can I access the object data, it's in a file thats under the folder > /com/nutrition/file.mxml > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: >> >> I'd add a trace statement just before it to see what type of object >> event.target is - it could be that the target is the UI component, and >> not the data object. >> >> //throws error on this line >> trace(event.target); >> customMeals.addItem((event.target as mealitem).mealDetails); >> >> 2009/7/2 Jason B : >> > I've got an problem when the user clicks on button "Add to Meal" it throws >> > an error because it can't seem to reference the data in mealDetails object >> > inside the com/ directory? >> > >> > I'm trying to add the item to the list control. >> > >> > I have the code located here in case you want more details >> > http://files.getdropbox.com/u/228472/mealsflex.zip >> > >> > >> > [Bindable] >> > private var customMeals:ArrayCollection = new ArrayCollection; >> > >> > //throws error on this line >> > customMeals.addItem((event.target as mealitem).mealDetails); >> > >> > >> > >> > >> > >> > http://www.adobe.com/2006/mxml"; width="310" >> > height="320" >> > title="{mealDetails.title}" horizontalAlign="center"> >> > >> > >> > >> > [Event(name="addToMeal")] >> > [Event(name="learnAboutThis")] >> > >> > >> > >> > >> > >> > >> > > > width="285" height="159"/> >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > -- >> > 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 >> > >> > >> > >> > >> > > > > > > > -- > 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 > > > >
[flexcoders] Re: getting the xml data from a dispatched event
The zip file doesn't contain any code in the src folder. Kind of hard to see what's happening without it. -TH --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > > any Idea? > > > > --- In flexcoders@yahoogroups.com, "Jason B" nospam@ wrote: > > > > yes heres the results > > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.cov\ erflow.Panelcreatemealitem1006" > > > > How can I access the object data, it's in a file thats under the folder /com/nutrition/file.mxml > > > > > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > > > > > I'd add a trace statement just before it to see what type of object > > > event.target is - it could be that the target is the UI component, and > > > not the data object. > > > > > > //throws error on this line > > > trace(event.target); > > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > 2009/7/2 Jason B : > > > > I've got an problem when the user clicks on button "Add to Meal" it throws an error because it can't seem to reference the data in mealDetails object inside the com/ directory? > > > > > > > > I'm trying to add the item to the list control. > > > > > > > > I have the code located here in case you want more details > > > > http://files.getdropbox.com/u/228472/mealsflex.zip > > > > > > > > > > > > [Bindable] > > > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > > > > > //throws error on this line > > > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" height="320" > > > > title="{mealDetails.title}" horizontalAlign="center"> > > > > > > > > > > > > > > > >[Event(name="addToMeal")] > > > >[Event(name="learnAboutThis")] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > 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 > > > > > > > > > > > > > > > > > > > > > >
[flexcoders] Re: getting the xml data from a dispatched event
any Idea? --- In flexcoders@yahoogroups.com, "Jason B" wrote: > > yes heres the results > "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.Panelcreatemealitem1006" > > How can I access the object data, it's in a file thats under the folder > /com/nutrition/file.mxml > > > > --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > > > I'd add a trace statement just before it to see what type of object > > event.target is - it could be that the target is the UI component, and > > not the data object. > > > > //throws error on this line > > trace(event.target); > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > 2009/7/2 Jason B : > > > I've got an problem when the user clicks on button "Add to Meal" it > > > throws an error because it can't seem to reference the data in > > > mealDetails object inside the com/ directory? > > > > > > I'm trying to add the item to the list control. > > > > > > I have the code located here in case you want more details > > > http://files.getdropbox.com/u/228472/mealsflex.zip > > > > > > > > > [Bindable] > > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > > > //throws error on this line > > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" > > > height="320" > > > title="{mealDetails.title}" horizontalAlign="center"> > > > > > > > > > > > > [Event(name="addToMeal")] > > > [Event(name="learnAboutThis")] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > 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 > > > > > > > > > > > > > > >
[flexcoders] Re: getting the xml data from a dispatched event
yes heres the results "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.Panelcreatemealitem1006" How can I access the object data, it's in a file thats under the folder /com/nutrition/file.mxml --- In flexcoders@yahoogroups.com, Sam Lai wrote: > > I'd add a trace statement just before it to see what type of object > event.target is - it could be that the target is the UI component, and > not the data object. > > //throws error on this line > trace(event.target); > customMeals.addItem((event.target as mealitem).mealDetails); > > 2009/7/2 Jason B : > > I've got an problem when the user clicks on button "Add to Meal" it throws > > an error because it can't seem to reference the data in mealDetails object > > inside the com/ directory? > > > > I'm trying to add the item to the list control. > > > > I have the code located here in case you want more details > > http://files.getdropbox.com/u/228472/mealsflex.zip > > > > > > [Bindable] > > private var customMeals:ArrayCollection = new ArrayCollection; > > > > //throws error on this line > > customMeals.addItem((event.target as mealitem).mealDetails); > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="310" height="320" > > title="{mealDetails.title}" horizontalAlign="center"> > > > > > > > > [Event(name="addToMeal")] > > [Event(name="learnAboutThis")] > > > > > > > > > > > > > > > width="285" height="159"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > 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 > > > > > > > > >