How can I set button colors from xml file data?

I am reading an xml file to create a group of buttons. I am
also using repeater to create the group of buttons.
I am getting the buttons created, but am unable to set the
fill color properly. I keep getting the error "Implicit coercion of
a value of type String to an unrelated type Array" if I try to plug
in r.currentItem.value, even when I used an Actionscript function
to convert from a String to an array of 2 uints. Is there a simple
type casting solution to this I'm just not getting?
Any help would be greatly appreciated!
The xml file has the following format:
<colors>
<color>
<name>Canteloupe</name>
<value>0xFFCC66</value>
</color>
<color>
<name>Banana</name>
<value>0xFFFF66</value>
</color>
<color>
<name>Lemon</name>
<value>0xFFFF00</value>
</color>
<color>
<name>Honeydew</name>
<value>0xCCFF66</value>
</color>
</colors>
The code I have so far is:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="colors.send()" layout="absolute">
<mx:HTTPService id="colors"
url="assets/colors_standard.xml" resultFormat="e4x"/>
<mx:XMLListCollection id="xlc_colors"
source="{colors.lastResult.color}"/>
<mx:TabNavigator left="0" top="0" right="0"
bottom="0">
<mx:Canvas label="Tab 1" width="100%" height="100%">
<mx:Accordion width="200" left="0" top="0" bottom="0">
<mx:Canvas label="Colors" width="100%" height="100%">
<mx:Label text="Current Color Selection" left="10"
right="10" top="10" height="20" fontWeight="bold"/>
<mx:Button label="Update Colors" left="10" right="10"
top="227" height="22" id="button_colors_update"/>
<mx:Canvas height="189" left="10" right="10" top="30"
borderStyle="outset" backgroundColor="#e9e9e9">
<mx:Tile id="tile_standard" direction="horizontal"
tileWidth="25" tileHeight="25" horizontalAlign="center"
verticalAlign="middle" borderStyle="outset" left="10" right="10"
top="10" height="134" backgroundColor="#ffffff">
<mx:Repeater id="r" dataProvider="{xlc_colors}">
<mx:Button toolTip="{r.currentItem.name}" height="15"
width="15" x="10" y="10"/>
</mx:Repeater>
</mx:Tile>
<mx:Button label="Additional Colors"
id="button_colors_online" height="22" left="10" right="10"
bottom="10"/>
</mx:Canvas>
</mx:Canvas>
</mx:Accordion>
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>

Thanks atta707!
If I send an array of 2 uints via a function call that
converts from String to Number to uint in an Actionscript function
and try to feed that into fillColors via:
<mx:Script>
<![CDATA[
public function fillcolors (_colorvalue:String):uint {
return uint(Number(_colorvalue));
]]>
</mx:Script>
<mx:Button height="15" width="15"
toolTip="{r.currentItem.name}" x="10" y="10"
fillColors="[fillcolors({r.currentItem.value}),fillcolors({r.currentItem.value})]"
I still get the "Implicit coercion of a value of type String
to an unrelated type Array." on the line that creates the button. I
have tried returning an Array of two uints with the Actionscript
funtion and get the same result.
<mx:Script>
<![CDATA[
public function fillcolors (_colorvalue:String):Array {
return new Array(uint(Number(_colorvalue)),
uint(Number(_colorvalue)));
]]>
</mx:Script>
<mx:Button toolTip="{r.currentItem.name}" height="15"
width="15" x="10" y="10"
fillColors="[fillcolors({r.currentItem.value})]"/>
Am I mistaken in my conversion of r.currentItem.value to
fillColors as arguments? Sorry about the newbie question - the
error I get makes me think it is a type conversion issue, but I
can't seem to get this to work/compile. If fillColors is expecting
an Array, should the Actionscript function returning an Array at
least get this to compile?

Similar Messages

  • How can I generate IDOC(WPUUMS) from XML file in POSDM or in SAP Retail

    Hallo Retail expert,
                                I have following scenario,
    I have Retail Store who send me their daily sales report through Wincor Nixdorf Point of sale. There i am using standard POSLOG2 to SEEBURGER(its a middleware which act as Converter) xml format and then i post that data first in POSDM and then with BAPI i transfer or book that data to SAP Retail.
    Above is the one scenario which is working.
    This is the Second scenario.......
    I have some external Retail store, they dont have Wincor Nixdorf POS, so they send me their Sales Report through SEEBURGER(its a middle Hardware which act as Converter) and SEEBURGER Convert that Sales data to XML format. My question is....
    How can i upload or Convert a XML File into IDOC (WPUUMS)in SAP or in POSDM?
    any new suggestion are welcome.
    Thank you all in advance.
    regards,
    Niel

    Hi,
    1. To get the required XML Schema, use transaction code WE60 to go to the IDoc documentation -> enter the IDoc type you want to use (WPUUMS01). Flag control and data record. Then display the XSD by choosing Documentation -> XML Schema from the menue bar. Now you can donwload the XSD for usage in Seeburger.
    2. Create your mapping from the POS format into the IDoc XML format in Seeburger.
    3. Create an XML File Port in ERP or POS DM using transaction code WE21.
    3. To inbound the XML file from Seeburger into POS DM or SAP Retail Seeburger should trigger the function module EDI_DATA_INCOMING. Parameters for this FM are the Pathname to the XML file and the Portname you just created. Based on the port name the FM can derive the port type xml and the data will be handled as XML data.
    Regards Carsten

  • How can I set connection to external XML file with Dreamweaver to buiild AIR app?

    Hello,
    I try to do simple AIR app in dreamweaver. It's not problem
    to use static data. But I'd like to use dynamic data from external
    XML file. I try to use Spry and evrything works fine in web browser
    but i have problem with loading external XML data into my app in
    AIR. Can I simply transform my spry based html app into AIR?
    What should I add to do this?
    Pawel

    Daniel Lichtenwald wrote:
    What are the requirements and steps for arranging to receive this large file using File Transfer Protocol (FTP)?
    Usually, we don't speak of "receive" when using FTP, since the file is transferred from server to client, so it's more of a case of "download".
    At your end, it's simple. You use an FTP client; under SL, that includes Finder and Safari, so you don't even need to get any additional software.
    At the other end, it's more complicated; the 'sender' must set up an FTP server on his machine.
    Alternatively, you can set up your own Mac as an FTP server, and have the 'sender' connect to you with an FTP client and upload the file; but, if your Mac lives behind a router, then you have more work to do with the router settings.
    That's why it's much easier to use the file sharing services mentioned above -- if they are available in both sender's and receiver's locations. (Keep in mind that some countries block access to all those mentioned -- except perhaps <www.transfer.ro>, of which I know absolutely nothing.)

  • How can i set background color of child window in jdk 1.6

    Hi friends i hv devoloped simple java app using javax.swing.JFrame in which on click button event i open new child window using JFrame to draw some image.
    i set childs background color as setBackground(Color.lightGray);
    but the problem is,child window takse its background color same as its parent window.(i.e. main window's color or desktop ).i get this problem in jdk 1.6.but it is working fine in jdk 1.5.
    how can i set background color of child window in jdk 1.6 .
    plz solve my problem.
    thanks in advanced.

    Mo,
    Call me old fassioned, but I simply refuse to demangle SMS speak.
    You've got a whole keyboard, so learn how to use it.
    Keith.

  • How can I set a music from my music library as a Ringtone on my Iphone?

    How can I set a music from my music library as a Ringtone on my Iphone?

    http://www.ehow.com/how_4810307_free-iphone-ringtones.html

  • How can i set a song from my music library to a ringtone for my iphone 4s

    how can i set a song from my music library to a ringtone for my iphone 4s?

    The procedure is the following:-
    *right click the song on itunes and click get info.
    *under the option, check in the start time and end time- This is the exactly which part of the song you want to make your ringtone.
    *Click Ok.
    * Again right click in the same song and click the CREATE AAC VERSION
    * Now you can see the same two song. if you have made the short length in step 2, lenght will be different.and this will be in (.m4a) format. and if you dont see on itunes you can search the name on finder. you will find both files.
    * Now you try to change the format (.m4a)  to (.m4r), you just delete a and add r and press enter bottom. and conform it.
    *Now you add this files to the ringtone/tones on itunes which is located on the left side bar of itunes.
    *make sure under the preference of your itunes under the general the tones section is checked in.
    *go to your device on itunes. Under the tones check in sync tones. You can Sync all tones or the particular tones which you want.
    *Now this tone is on your iphone. You can change your ringtone through setting>sound>ringtone and choose the particular one.

  • How can we set page title from resource bundle

    Hi friends ,
    how can we set page title from resource bundle,
    <%--
        Document   : MARC008Music
        Created on : Aug 4, 2008, 6:27:06 PM
        Author     : root
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
    <title>All Transaction Log Details </title>
          </head>
        <body>
            <f:view>
                <f:loadBundle basename="#{utility.resourceBundle}" var="rb"/>
                <f:loadBundle basename="#{utility.messageBundle}" var="mb"/>
                <h:form>
                </h:form>
            </f:view>
        </body>
    </html>i want set title( All Transaction Log Details ) from resource bundle.

    My problem is solved , Thanking you Sir.
    Thanks & Regards,
    Edukondalu Avula

  • I am a Brit living in Germany. I really need to be able to purchase from the German iTunes Store (in €) and the English one (in £). How can I set this up from my iPad?

    I am a Brit living in Germany. I really need to be able to purchase from the German iTunes Store (in €) and the English one (in £). How can I set this up from my iPad?

    Technically correct (the best kind of correct)
    Now if the Op has and retains a UK account with billing address and UK paymant card - He/She can continue to use the UK store in Germany - Apple does NOT use IP address blocking just a valid paymant card attached to a postcode !
    Basically the first four of your paymant card are country codes.
    What the op needs to do if he/she now has a Germany address and payment method (could just be German € value gift cards) is to open a separate German iTunes Account !
    On a PC/Mac its very easy to change stores, however iOS has it a bit more difficult.
    In fact i would recommend the Op sets up a new German account and credentials on a PC/Mac first.
    And doing so just means opening the store in iTunes scrolling to the bottom of the screen and clicking on the littler circular flag in the bottom right.
    After that the browser window is populated with loads of similar disc flags. Clicking any take you to that regional store where provided you have a valid address (Postcode/Zipcode actually) and payment method local credit/debit some prepayment VISA cards or just a gift card you can create a local account.
    Oh and because Apple do NOT use IP addressing you don't actually have to be present in the country of that store. Its against to terms of the EULA but it works !
    Back to the iOS device
    Tap Settings/iTunes & App Store /Apple ID (that will probably be showing the UK account set up).
    In the window that opens tap log out
    Now  change the ID to the new German name and password and in the next window make sure the flag selected is that of Germany (when in Germany)
    When buying from the UK store follow that path again log out of the German account and re-log in using the UK ID
    As it happens I have a UK Portuguese and US account all active because I have residences in all three - and can visit any of the stores from anywhere.

  • How can I script moving paths from one file to another?

    Hello. I have 1 image with various color correction layers. The other is the exact same size but only contains paths. How can I script moving paths from one file to another? Thanks, in advance, for any help you can offer. Thanks!

    Thanks! This one actually worked for me. Thanks for your help.
    http://forums.adobe.com/message/3305389#3305389

  • How Can I Attach and Link an XML file to a 3D Model in a PDF?

    How Can I Attach and Link an XML file to a 3D Model in a PDF?
    What I am trying to do is find out how to have a 3D model and a parts list linked to it within the PDF file.  I would also like to be able to add to the parts list if at all possible once the pdf has been created.  A template to create future PDF's with the 3D model and list might also be useful.
    I am not entirely sure if this is all possible within a PDF file, but I have viewed a PDF (Adidas Trainer) example which has a Excel file attached to it which links to the 3D model.  I have also had a look at partner products such as Lattice, Tetra4D, Anark, which can do animations and all sorts, but frankly it seems a bit overkill for what I am looking to do.
    Please, any help would be appreciated.  Thanks

    AlliCT59 wrote:
    > Shared Object sounds like it would work, but hten agian,
    I'm really stuck!
    >
    > Thanks for any help.
    >
    > Allison
    I wrote about it while ago, let me paste the whole thing.
    This example has simple
    buttons which upon click go to new sites and in the same time
    place record in form
    of *.SOL file on user drive. That record is read when you hit
    the next button and
    based on that the button will be selected as the one last
    clicked.
    You could use the very same thing just instead of suppressing
    button simply gotoAndPlay frame
    to continue the part you need.
    http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/36649453 1f4fd02d/245a57d0cdaa1d29?lnk=st&q=&rnum=3&hl=en#245a57d0cdaa1d29
    The source is in a different place, i re-upload for you :
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/
    fla file
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/beentourl.fla
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • HI,How can i set delta option for costumised Generic data source

    Hi Sir/Madam,
          How can i set delta option for costumised Generic data source.
    Regards,
    Vishali.R
    Please search the forum before posting a thread
    Edited by: Pravender on Aug 15, 2011 1:26 PM

    Hi,
    Go to RSO2 transaction and click on change then on the tool bar click on Generic Delta button. In the next popup you can set your delta.
    Regards,
    Durgesh.

  • How can I remove one page from adobe file

    How can I remove one page from adobe file, when I try to remove the page a dialgue box say "some pages are being used, so they can not be ereased"?

    Tools>Pages>Delete pages

  • How can I set my Messages to view by date ?

    How can I set my Messages to view by date ?
    I don't like them to organize by thread.
    Are there any software to help me?

    You can't. By design and intention messages are provided/organized in conversation/threaded format by each contact you exchange messages with and the messages within each conversation are sorted by date.
    There is no 3rd party software/apps available that can change this with the included Messages application.

  • How can I set to boot from MAC OS by default after I installed Windows?

    How can I choose to boot from MAC OS by default after I installed Windows? I have a MacBook Pro Leo 10.6.8. I used bootcamp to install Windows XP SP2, but now if I don't press the option key it will start up with Windows, and I don't want that. Thanks for any help.

    Select it in the Startup Disk pane of System Preferences.
    (61137)

  • How can i set a song from my iphone library as my ringtone?

    CAN I SET A SONG FROM MY LIBRARY AS MY RINGTONE FROM MY PHONE?

    boooo!!!!  so when i purchase the ringtone, i have to transfer it from my pc?  i just switched from android and im having a hard time figuring some things out.

Maybe you are looking for