[flexcoders] menu bar control- submenu issue

2005-04-18 Thread nithya karthik




hai,
 I have been using a menubar control which has 4 items.. only the 2nd item has sub menus inside it.. the others dont have.. the problem is when mouseDown on items without a child it displays "[object object], 1,,[object object], null"... how do i avoid this? please help me this issue
thanks,
nithya

my mxml code is:

mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" height="500"
mx:Script![CDATA[var dataObject : Object;]]/mx:Scriptmx:MenuBar id="menu1" width="100%" dataProvider="{dataObject}" labelField="name" mouseDown="event.menuItem.attributes.label"/
/mx:Panel

the xml is:

CategoryId1/IdNameArtistry™ Skin Care and Cosmetics/NameDescription A full range of basic to speciality skin care treatments made with the highest quality formulations to meet the needs of women today as well as a spectrum of colour for both background and feature cosmetics to match any mood or occasion.TRY™ is among the world's top five, largest selling, prestige brands of facial skincare and cosmetics. Based on a 2000 Euromonitor International study of estimated global retail sales./DescriptionImagehomephoto.jpg/ImageSubcategoryId1/IdNameDry-Skin/NameDescriptionTesting jaxb/Descriptionitem123.xml/item/Subcategory
SubcategoryId 2 /IdNameNormal Skin/NameDescription Testing jaxb/DescriptionSubcategoryId 121 /IdNameAqua/NameDescription Testing jaxb2/Descriptionitem 124.xml /item/SubcategorySubcategoryId 13 /IdNameNon-Aqua/NameDescription Testing jaxb3/Descriptionitem 124.xml /item/Subcategory/Subcategory
 SubcategoryId3/IdNameOily-Skin/NameDescriptionTesting jaxb/Descriptionitem125.xml/item /Subcategory SubcategoryId4/IdNameSensitive-Skin/NameDescriptionTesting jaxb/Descriptionitem126.xml/item /Subcategory
/Category  
Yahoo! Messenger - Communicate instantly..."Ping" your friends 
today! Download Messenger Now







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] menu bar control- submenu issue

2005-04-18 Thread Matt Chotin










OK, a Menu really cant handle XML
formatted the way you have it. Menus need their XML to have attributes, not
child tags. However, if you create an object structure instead of relying on
raw XML things will work with this structure.



?xml version=1.0
encoding=utf-8?

mx:Application
xmlns:mx=http://www.macromedia.com/2003/mxml





mx:Panel
xmlns:mx=http://www.macromedia.com/2003/mxml width=100%
height=500

 mx:Script

 ![CDATA[

 var dataObject : Object;

 ]]

 /mx:Script

 mx:MenuBar id=menu1
width=100% dataProvider={theXML}
labelFunction=labelFunc
mouseDown=event.menuItem.attributes.label/

/mx:Panel



mx:Script

 function labelFunc(item) : String

 {

 return
item.getProperty(Name); 

 }

/mx:Script



mx:Model id=theXML

Category

Id1/Id

NameArtistry Skin Care and
Cosmetics/Name

Description A full range of basic
to speciality skin care treatments made with the highest quality formulations
to meet the needs of women today as well as a spectrum of colour for both
background and feature cosmetics to match any mood or occasion.TRY is
among the world's top five, largest selling, prestige brands of facial skincare
and cosmetics. Based on a 2000 Euromonitor International study of estimated
global retail sales.

/Description

Imagehomephoto.jpg/Image



Subcategory

 Id1/Id 

 NameDry-Skin/Name

 DescriptionTesting
jaxb/Description

 item123.xml/item

 

/Subcategory

Subcategory

 Id 2 /Id 

 NameNormal
Skin/Name

 Description Testing
jaxb/Description

 Subcategory

 Id 121 /Id 

 NameAqua/Name

 Description Testing
jaxb2/Description

 item 124.xml /item

 /Subcategory

 Subcategory

 Id 13 /Id 

 NameNon-Aqua/Name

 Description Testing
jaxb3/Description

 item 124.xml /item

 /Subcategory

/Subcategory



 Subcategory

 Id3/Id 

 NameOily-Skin/Name

 DescriptionTesting
jaxb/Description

 item125.xml/item

 /Subcategory

 

 Subcategory

 Id4/Id 

 NameSensitive-Skin/Name

 DescriptionTesting
jaxb/Description

 item126.xml/item

 /Subcategory

/Category

/mx:Model

 



/mx:Application



If youre getting the data from
HTTPService just set resultFormat=object.



HTH,



Matt 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












Re: [flexcoders] menu bar control

2005-04-11 Thread Manish Jethani

On Apr 11, 2005 4:05 PM, Manish Jethani [EMAIL PROTECTED] wrote:

   for (var i:uint = 0; i  foo.bar.category.length; i++)
 menu.addItem(foo.bar.category[i]);

Sorry, I meant Number, not uint.  A bit of a C programming hangover. :)

;-)

-- 
[EMAIL PROTECTED]
http://manish.revise.org/


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] menu bar control

2005-04-11 Thread nithya karthik



sorry i meant menu bar control not menu control...

Thanks a lot Manish... I'd like to know how to change the default color of the menucontrol.. the attribte Fillcolors doesnt work.. nothing worksincluding selectedfill color, background color etc,.. I would also like to know how to remove the default border of menubar control- setting the borderstyle to none doesnt work.. can u help me with this please..
thanks,
nithyaManish Jethani [EMAIL PROTECTED] wrote:
On Apr 11, 2005 4:05 PM, Manish Jethani [EMAIL PROTECTED] wrote: for (var i:uint = 0; i  foo.bar.category.length; i++) menu.addItem(foo.bar.category[i]);Sorry, I meant Number, not uint. A bit of a C programming hangover. :);-)-- [EMAIL PROTECTED]http://manish.revise.org/  
Yahoo! Messenger - Communicate instantly..."Ping" your friends 
today! Download Messenger Now







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.