Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
getting the xml data from a dispatched event   Message List  
Reply | Forward Message #145018 of 149661 |
Re: getting the xml data from a dispatched event


any Idea?



--- In flexcoders@yahoogroups.com, "Jason B" <nospam@...> wrote:
>
> yes heres the results
>
"Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.P\
anelcreatemealitem1006"
>
> 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 <samuel.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 <nospam@>:
> > > 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);
> > >
> > >
> > >
> > >
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" width="310"
height="320"
> > >         title="{mealDetails.title}" horizontalAlign="center">
> > >
> > >
> > >        <mx:Metadata>
> > >                [Event(name="addToMeal")]
> > >                [Event(name="learnAboutThis")]
> > >        </mx:Metadata>
> > >
> > >        <mx:Script>
> > >                <![CDATA[
> > >                        import mx.controls.Alert;
> > >
> > >                        [Bindable]
> > >                        public var mealDetails:Object;
> > >
> > >
> > >                        private function calldispatch():void {
> > >                                parentApplication.createmeals_loadswf_var =
mealDetails.swf;
> > >                                dispatchEvent(new Event('learnAboutThis',
true));
> > >
> > >                        }
> > >
> > >                ]]>
> > >        </mx:Script>
> > >
> > >        <mx:Image source="{'/uploads/nutrition/' + mealDetails.imgsource }"
width="285" height="159"/>
> > >
> > >        <mx:Label text="{mealDetails.serving}"/>
> > >
> > >        <mx:Button label="Add to Meal" click="dispatchEvent(new
Event('addToMeal', true))"/>
> > >
> > >        <mx:Button label="Learn About This" click="calldispatch()"/>
> > >
> > > </mx:Panel>
> > >
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > --
> > > 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-1e62079f\
6847

> > > Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
> > >
> > >
> > >
> > >
> >
>





Fri Jul 3, 2009 9:15 pm

advancedonsite
Online Now Online Now
Send Email Send Email

Forward
Message #145018 of 149661 |
Expand Messages Author Sort by Date

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...
Jason B
advancedonsite
Online Now Send Email
Jul 1, 2009
9:45 pm

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....
Sam Lai
samuel337
Offline Send Email
Jul 1, 2009
10:56 pm

yes heres the results "Main0.vsMain.HBox8.VBox968.vsCreateMeals.VBox971.pnlCreateBreakfast.coverflow.Panelcreatemealitem1006" How can I access the object data,...
Jason B
advancedonsite
Online Now Send Email
Jul 2, 2009
12:51 pm

any Idea?...
Jason B
advancedonsite
Online Now Send Email
Jul 3, 2009
9:16 pm

The zip file doesn't contain any code in the src folder. Kind of hard to see what's happening without it. -TH ... ...
Tim Hoff
turbo_vb
Offline Send Email
Jul 3, 2009
11:08 pm

It seems like wherever this code is - [Bindable] private var customMeals:ArrayCollection = new ArrayCollection; //throws error on this line ...
Sam Lai
samuel337
Offline Send Email
Jul 4, 2009
1:55 am

Heres my three mxml files two of which are under the com/ folder and get imported...hope that helps <?xml version="1.0" encoding="utf-8"?> <mx:Application...
Jason B
advancedonsite
Online Now Send Email
Jul 4, 2009
5:19 pm

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...
Tim Hoff
turbo_vb
Offline Send Email
Jul 4, 2009
6:45 pm

It wont accept your suggestions Severity and Description Path Resource Location Creation Time Id 1120: Access of undefined property Panelcreatemealitem. /src...
Jason B
advancedonsite
Online Now Send Email
Jul 5, 2009
1:54 pm

import com.nutrition.Panelcreatemealitem; -TH ... line 105 1246801954900 468962 ... ArrayCollection. ... and ... paddingBottom="10"> ... on a ... ...
Tim Hoff
turbo_vb
Offline Send Email
Jul 5, 2009
3:43 pm

I had that import in the main mxml before i replied to your message and still get an error?...
Jason B
advancedonsite
Online Now Send Email
Jul 6, 2009
2:45 am

Hey Jason, When I created a new project with the code that you pasted, there were several bugs; including variable naming and component naming mis-matches,...
Tim Hoff
turbo_vb
Offline Send Email
Jul 6, 2009
3:25 am

funny you mention that since I paid an experienced Flex Engineer to build this yet I'm stuck debugging it. I'll see what I can do, guess it's time to learn,...
Jason B
advancedonsite
Online Now Send Email
Jul 6, 2009
1:39 pm

All I can say is that if you paid someone to write it, you should be looking for a refund. -TH ... build this yet I'm stuck debugging it. ... to hear it was...
Tim Hoff
turbo_vb
Offline Send Email
Jul 6, 2009
4:24 pm

You didn't use one of those $20/hour offshore services did you? I did not look at your code myself, but Tim's analysis will be accurate. Tracy Spratt, Lariat...
Tracy Spratt
nts333rd
Offline Send Email
Jul 6, 2009
7:52 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help