For loop and xml - how to point the right content in a XML file with a dynamically created button?

Hi Everybody,
as my first experience in AS3 I'm bulding a photo multigallery. In that gallery I have some buttons, each one pointing to its respective set of images.
Each button is created with the for loop, that picks the information from a XML file. From this XML I get the text of the button, the position etc. What I did with some sucess. But there is a scary problem: I don't know how to make each button load the respective and unique set of images.
I've tryied several different methods, with no effect, to make each loop to give to each button an unique identity to load the respective set of images.
I imagine that the solution pass by the use of arrays. I wrote some code, and I guess that I'm almost there (but not sure). Here is my AS3 code until now:
// CREATE MENU CONTAINER //
var menuContainer:MovieClip = new MovieClip();
menuContainer.x=10;
menuContainer.y=300;
addChild(menuContainer);
// CREATE IMAGES CONTAINER //
var imagesContainer:MovieClip = new MovieClip();
imagesContainer.x=10;
imagesContainer.y=10;
addChild(imagesContainer);
//// LOAD XML ////
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
var xml:XML;
function whenLoaded(evt:Event):void {
     xml=new XML(evt.target.data);
     var mySetsList:XMLList=xml.children();
     //// MENU BUTTONS ////
     // CREATE ARRAYS //
     var totalArray:Array = new Array();
     var setNodesArray:Array = new Array();
     var setNamesArray:Array = new Array();
     // POSITIONING BUTTONS INSIDE MENU CONTAINER//
     var rowsQuantity:Number=3;
     var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
     var cellWidth:Number=160;
     // CREATE BUTTONS //
     for (var i:int=0; i< mySetsList.length(); i++) {
          var newSetButtonMC:setButtonMC=new setButtonMC();
          //what do I do here to make it works? To give each button created a unique id.
          setNodesArray.push(i);
          //trace(setNodesArray);
          var imageNodesArray:Array = new Array();
          for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
               imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
          totalArray.push(imageNodesArray);
          newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
          newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
          var cellX:Number=Math.floor(i/rowsQuantity);
          var cellY:Number=i%rowsQuantity;
          newSetButtonMC.x=cellX*cellWidth;
          newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
          newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
          menuContainer.addChild(newSetButtonMC);
     totalArray.push(setNodesArray);
     //// MENU BUTTONS ACTIONS ////
     function onClick(mevt:MouseEvent):void {
          trace(totalArray [0][0]);
          trace(totalArray [0][0]);
          // in the line above I achieved some success loading a specific info from XML.
          // but I don't know what to do with it.
          //what do I do here? To make each button to load its own node from XML.
Here is my XML:
<GALERIA galeriaTitle="galeria 01">
  <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
</GALERIA>
<GALERIA galeriaTitle="galeria 02">
  <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
</GALERIA>
Thanks everyone . ABSTRATO

you can assign each newSetButtonMC and ivar property that points to its i value or, even easier:
// CREATE MENU CONTAINER //
var menuContainer:MovieClip = new MovieClip();
menuContainer.x=10;
menuContainer.y=300;
addChild(menuContainer);
// CREATE IMAGES CONTAINER //
var imagesContainer:MovieClip = new MovieClip();
imagesContainer.x=10;
imagesContainer.y=10;
addChild(imagesContainer);
//// LOAD XML ////
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, whenLoaded);
xmlLoader.load(new URLRequest("XML/roiaXML.xml"));
var xml:XML;
function whenLoaded(evt:Event):void {
     xml=new XML(evt.target.data);
     var mySetsList:XMLList=xml.children();
     //// MENU BUTTONS ////
     // CREATE ARRAYS //
     var totalArray:Array = new Array();
     var setNodesArray:Array = new Array();
     var setNamesArray:Array = new Array();
     // POSITIONING BUTTONS INSIDE MENU CONTAINER//
     var rowsQuantity:Number=3;
     var columnsQuantity:Number=Math.ceil(mySetsList.length()/rowsQuantity);
     var cellWidth:Number=160;
     // CREATE BUTTONS //
     for (var i:int=0; i< mySetsList.length(); i++) {
          var newSetButtonMC:setButtonMC=new setButtonMC();
          //what do I do here to make it works? To give each button created a unique id.
          setNodesArray.push(i);
          //trace(setNodesArray);
          var imageNodesArray:Array = new Array();
          for (var j:int=0; j<mySetsList[i].IMAGE.length(); j++) {
               imageNodesArray.push(mySetsList[i].IMAGE[j].attribute("imageTitle"));
         nextSetButtonMC.imageArray = imageNodesArray;
          //totalArray.push(imageNodesArray);
          newSetButtonMC.setButtonText.text=mySetsList.attribute("galeriaTitle")[i];
          newSetButtonMC.setButtonText.autoSize=TextFieldAutoSize.LEFT;
          var cellX:Number=Math.floor(i/rowsQuantity);
          var cellY:Number=i%rowsQuantity;
          newSetButtonMC.x=cellX*cellWidth;
          newSetButtonMC.y=cellY*(newSetButtonMC.height+10);
          newSetButtonMC.addEventListener(MouseEvent.CLICK, onClick);
          menuContainer.addChild(newSetButtonMC);
     totalArray.push(setNodesArray);
     //// MENU BUTTONS ACTIONS ////
     function onClick(mevt:MouseEvent):void {
          var mc:setButtonMC=setButtonMC(mevt.currentTarget);
for(i=0;i<mc.imageArray.length;i++){
trace(mc.imageArray[i]);
Here is my XML:
<GALERIA galeriaTitle="galeria 01">
  <IMAGE imageTitle="imageTitle01">feio.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle02">muitofeio.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle03">aindamaisfeio.jpg</IMAGE>
</GALERIA>
<GALERIA galeriaTitle="galeria 02">
  <IMAGE imageTitle="imageTitle01">estranho.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle02">maisestranho.jpg</IMAGE>
  <IMAGE imageTitle="imageTitle03">aindamaisestranho.jpg</IMAGE>
</GALERIA>
Thanks everyone . ABSTRATO

Similar Messages

  • Problem for XSL copying  XML file with Error in expression '*|/'.

    Hi,
    I am trying to convert xml file to another xml through command-line interface but failed.
    java oracle.xml.parser.v2.oraxsl data.xml data.xsl data_new.xml
    My sample xml and xsl files are:
    1. XML file
    <employee_data>
    <employee_row>
    <employee_number>7950</employee_number>
    <employee_name>ABC</employee_name>
    <employee_title>PRESIDENT</employee_title>
    <manager>1111</manager>
    <date_of_hire>20-JAN-93</date_of_hire>
    <salary>65000</salary>
    <commission>1000</commission>
    <department_number>10</department_number>
    </employee_row>
    </employee_data>
    2. XSL file
    <?xml version="1.0" ?>
    <xsl:stylesheet xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="*">
    <xsl:copy>
    <xsl:apply-templates>
    <xsl:sort select=".//employee_name"/>
    </xsl:apply-templates>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    The error message:
    Error occurred while processing data.xsl: Error in expression: '*|/'.
    I used a sample XSL files copying from a XML book to do the convert but got the same error.
    Does anyone know how to fix this problem? I'll appreciate it very much for your help.
    Thanks.
    Yiguang Zhong

    Hi swanelvis ,
    I have the same issue. Were you able to resolve this ?
    Thanks

  • How to read the second line in a .txt file with bufferedReader?

    hi,
    i am not the best in speaking english and programming java :)
    so, just try to make sense of my question:
    Im using a BufferedReader to read a .txt file.
    the .txt file has 5+ different lines, and each line has 6 tokens (separated with ; )
    My java file has 6 textFields and each textfield is filled with one of the 6 different tokens.
    and my problem is:
    I want my buffered reader to read the next line (with 6 new different tokens) by pressing a button.
    if somethings not understandable, just ask :)

    maybe its easier to help me, when i publish my code, so here it is:
    (its my version, without Thof's code. Sorry, but the comments are the most in german)
    /* userdata.java */
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class userdata extends Frame {
    //-----------------------------------KlassenVariablen------------------------------------------------
    private JPanel panel = new JPanel ();
    String tokId = "";
    String tokName= "";
    String tokAge= "";
    String tokTel= "";
    String tokMail= "";
    String tokText= "";
    BufferedReader br;
    String zeile;
    StringTokenizer st;
    String delim = ";";
    //---------Buttons f?r Panel 1-------------------------
    Button first = new Button("|< First");
    Button back = new Button("< Back");
    Button next = new Button("Next >");
    Button last = new Button("Last >|");
    //---------Buttons f?r Panel 3-------------------------
    Button neu = new Button("New");
    Button safe = new Button("Safe");
    Button refresh = new Button("Refresh");
    //--------Labels f?r Panel 2-----------------------------
    Label lid = new Label("ID",Label.LEFT);
    Label lname = new Label("Name",Label.LEFT);
    Label lage = new Label("Age",Label.LEFT);
    Label ltel = new Label("Tel.",Label.LEFT);
    Label lmail = new Label("E-Mail",Label.LEFT);
    Label ltext = new Label("Spruch",Label.LEFT);
    Label lub = new Label("Last Button",Label.LEFT);
    TextField id = new TextField();
    TextField name = new TextField();
    TextField age = new TextField();
    TextField tel = new TextField();
    TextField mail = new TextField();
    TextField text = new TextField();
    TextField usedbutton = new TextField();
    //--------ActionEvent bla sachen eben--------------------
    public static void main (String[] args) throws IOException {
    userdata wnd = new userdata();
    wnd.setVisible(true);
    public userdata() throws IOException {                                                                                                                                                                                                                                                                                
    //--------------------------------Layout mit panel bestimmung--------------------------------------
    setLayout(new BorderLayout());
    JPanel p1 = new JPanel();
    JPanel p2 = new JPanel();
    JPanel p3 = new JPanel();
    add(BorderLayout.NORTH ,p1);
    add(BorderLayout.CENTER , p2);
    add(BorderLayout.SOUTH , p3);
    //-------------------------------Funktionslose Buttons in PANEL 1------------------------------------
    p1.add(first);
    p1.add(back);
    p1.add(next);
    p1.add(last);
    p1.add(usedbutton);
    //--------------------------------Funktionierende Textfelder in PANEL 2------------------------------
    Panel labelpanel = new Panel();
    p2.setLayout(new GridLayout(7,3));
    p2.add(lid);
    p2.add(id);
    p2.add(lname);
    p2.add(name);
    p2.add(lage);
    p2.add(age);
    p2.add(ltel);
    p2.add(tel);
    p2.add(lmail);
    p2.add(mail);
    p2.add(ltext);
    p2.add(text);
    p2.add(lub);
    p2.add(usedbutton);
    //--------------------------------------Buttons in PANEL 3-----------------------------------------
    p3.add(neu);
    p3.add(safe);
    p3.add(refresh);
    //--------------------------------BufferedReader -------------------------------------------------
    readData();
    //--------------------------------Panel 2 TextField-----------------------------------------------
    fillForm();
    //================================ActionPerformed==================================================
    first.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("First");
    usedbutton.setText("First");
    back.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Back");
    usedbutton.setText("Back");
    next.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Next");
    usedbutton.setText("Next");
    last.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Last");
    usedbutton.setText("Last");
    neu.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("New entry");
    usedbutton.setText("New");
    safe.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    System.out.println ("Now Saving, do not turn off!");
    usedbutton.setText("Save");
    //-----------------refresh
    refresh.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed( ActionEvent e ) {
    try{
    readData();
    }catch( IOException ioe){
    System.out.println("Fehler beim lesen aus Datei");
    fillForm();
    usedbutton.setText("Refresh");
    //=============================================================================Button Funktionen!!!
    pack();
    //--------------------------------WindowsListener hinzuf?gene--------------------------------------
    addWindowListener(
    new WindowAdapter() {
    public void windowClosing(WindowEvent event)
    setVisible(false);
    dispose();
    System.exit(0);
    //-----------------------------------readData() - > Buffered Reader in aktion! --------------------
    private void readData() throws IOException{
    BufferedReader br = new BufferedReader(new FileReader("My .txt File with path"));
    String zeile;
    StringTokenizer st;
    String delim = ";";
    zeile = br.readLine();
    st = new StringTokenizer(zeile, delim);
    st.hasMoreTokens();
    //System.out.println (st.nextToken());
    tokId = new String(st.nextToken());
    tokName = new String (st.nextToken());
    tokAge = new String (st.nextToken());
    tokTel = new String (st.nextToken());
    tokMail = new String (st.nextToken());
    tokText = new String (st.nextToken());
    //--------------------------fillForm() - > f?llt die TextFelder aus!--------------------------------
    private void fillForm(){
    id.setText(tokId);
    name.setText(tokName);
    age.setText(tokAge);
    tel.setText(tokTel);
    mail.setText(tokMail);
    text.setText(tokText);
    }

  • Create XML file with worksheet's dynamically assigned through XSLT

    Hi all
    I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
    I have all my values in internal table,  and am calling the transformation from bsp application.
    Say the internal table has field dataxyz, for every change in value in this field dataxyz  i need to create separate worksheet and populate that sheet with some corresponding values .
    please guide me how to create worksheet dynamically.
    thanks in advance.
    Bharathy
    Edited by: elam.bharathy on May 16, 2011 6:51 AM

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • Binding Xml file with Xsd Schema

    Hello
    everybody there.
    I am trying to make an application where word files are converted into xml.
    For that i have used org.exolab.castor and org.apache.poi.hwpf.
    Now the problem is that i was able to generate the xml file from word, but when i am binding it with XMLSchema.xsd following error is coming.
    java.lang.IllegalArgumentException: getSimpleType: the simple type 'formChoice' is not a built-in type as defined in XML Schema specification.
         at org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:1289)
         at org.exolab.castor.xml.schema.Schema.addSimpleType(Schema.java:583)
         at org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.endElement(SchemaUnmarshaller.java:643)
         at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.endElement(Sax2ComponentReader.java:198)
         at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1392)
         at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
         at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
         at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
         at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:430)
         at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:485)
         at TempHwpf.<init>(TempHwpf.java:35)
         at TempHwpf.main(TempHwpf.java:44)the code for binding my xml file with xsd schema is as under:-
    SourceGenerator sourcegen = new SourceGenerator();
    sourcegen.getVersion();
    System.out.println(sourcegen.getVersion());
    sourcegen.generateSource("XMLSchema.xsd","packagename");I have checked XMLSchema.xsd file, in that formChoice is already defined, than also error is coming.
    can anyone help me out. first i thought that XMLSchema.xsd which i have is not proper, but i downloaded it again from w3c.org,
    than also same error is shown.
    please help me out.
    waiting for reply.
    milind

    Please do not double-post. http://forum.java.sun.com/thread.jspa?threadID=5134447&tstart=0
    Then use Stax (Woodstock) or Saxon.
    - Saish

  • Validate a XML file with a XSD File in ABAP

    Hi everybody,
    I am searching a way for validating a XML File with an external XSD File in ABAP. I know to validate with dtd is possible, but what about XSD?
    Can you help me in my urgend problem ?
    Greetings from Germany
    ismail er

    anyone an idea for my issue ???

  • I am using a timed while loop and am unable to get the loop to run at a speed of less than 1ms (I am currently using the Wait(ms) function). How can I get a faster response?

    I am trying to create a virtual engine within a timed while loop and am unable to get the loop to run at a speed of less than 1ms (I am currently using the Wait(ms) function). This does not however allow realistic engine speeds. How can I overcome this? I have access to a PCI-MIO-16E-4 board.

    andyt writes:
    > I am using a timed while loop and am unable to get the loop to run at
    > a speed of less than 1ms (I am currently using the Wait(ms) function).
    > How can I get a faster response?
    >
    > I am trying to create a virtual engine within a timed while loop and
    > am unable to get the loop to run at a speed of less than 1ms (I am
    > currently using the Wait(ms) function). This does not however allow
    > realistic engine speeds. How can I overcome this? I have access to
    > a PCI-MIO-16E-4 board.
    Andy,
    Unless you use a real time platform, getting extactly 1 ms loop rate
    (or even less) is impossible. It starts getting troublesome at about
    0.1 Hz for standard operating systems.
    I'd tackle your problem with "if i mod 10 == 0 then sleep 1 ms".
    Of
    course this is jerky by design.
    HTH,
    Johannes Nie?

  • I'm having problems manipulating array data within a for loop, and extracting the required sub-arrays generated.

    Hi,
    I'm using labVIEW V5.1
    I'm trying to generate 10 1D arrays, the first array is initialized to all zeroes, then I have set up a for loop which shifts the first element by 1, then a random number is placed into the first element position. I am using a shift register to feed back in the newly generated array into the start of the loop.
    By the end of the each loop I want to be able to use the array generated in an algorithm outside the loop. However I only want the Nx1 array that has just been generated.
    Unfortunately, I cannot figure out how to resize, reshape or index the output array to do this.
    I would like the loop to
    give me out a 1D array after each iteration.
    Any help would be greatly appreciated.

    I hope I've understood your problem.
    First your vi was lacking of the sub-vi working as shift register, I've replaced it with the rotate function.
    The indexing of your arrays create a 2D array whose rows are your 1D array.To pick only one of them you have to use the index array function and select which one you want.
    To use your temporary data in another part of your application you should use a local variable of array2.
    I did it in a separated while loop That I syncronized with the for loop using occurrence, in this way the while loop runs each time a new value is inserted in array2 (each loop of the for loop structure).
    If you don't need this syncronization just get rid of occurrence functions.
    I place a delay in the for loop to show what happens when running.
    Hope it was helpful.
    Alberto Locatelli
    Attachments:
    array_test_v3.vi ‏35 KB

  • My ipod wont let me buy any apps because it says i have an invalid security code for my moms credit card but its the right one. and it also says i owe money for upgrading an app does anyone know how to remove my moms credit card cause i cant figure itout

    my ipod wont let me buy any appps because it says i have an invalid security code for my moms credit card but its the right one. and it also says i owe money for upgrading an app does anyone know how to remove my moms credit card cause i cant figure itout

    To change asccount information see:
    Changing Account Information
    For the code issue this may help.
    iTunes Store: My credit card's security code or zip code does not match my bank's records
    For a standard iTunes account you need a valid payment method even for free apps and app updates.
    What is making it think that you own money for an app upgrade?

  • I pre ordered a album and got songs then it came out so itunes sent me a confirmation and it said to go to available downloads and gave link so I did and it did nothing for me and when I went to the album I wanted it said it was purchased so how do I get

    I pre ordered a album and got songs then it came out so itunes sent me a confirmation and it said to go to available downloads and gave link so I did and it did nothing for me and when I went to the album I wanted it said it was purchased so how do I get my music and don't even see available downloads in the iTunes Store

    Check this link, http://www.apple.com/support/itunes/ and go to the contact page.
    Sorry, here you go https://ssl.apple.com/emea/support/itunes/contact.html
    Message was edited by: ChrisJ4203

  • I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up ever

    I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up everything, like for example any little movement i make or even just asking the next person a question will get picked up by the internal mic. is there a way i can mute the internal mic so it can only pick the external mic and not every movement im making like chewing etc

    I have a macbook pro in which i use for church recordings. it has a built in mic so like one hole for headphones and mic. how do i get it to only pick up the sound from the external mic that is coming into the mixer to the laptop. it seems to pick up everything, like for example any little movement i make or even just asking the next person a question will get picked up by the internal mic. is there a way i can mute the internal mic so it can only pick the external mic and not every movement im making like chewing etc

  • Hi i've just signed up for lightroom and when i go into the develop screen i get a blue screen with a cross through it and it says cant load picture. any idea how to get around this?

    hi i've just signed up for lightroom and when i go into the develop screen i get a blue screen with a cross through it and it says cant load picture. any idea how to get around this?

    I'm having same problem in develop module which is laggy as hell compared to LR5.8
    Library module is fine but develop module is slow as hell....5 seconds to make ANY adjustment.

  • Iphone app asked me for username and password. how can i find this? it seems deferent than the apple id or i tune store username!

    iphone app asked me for username and password. how can i find this? it seems deferent than the apple id or i tune store username!

    Which iPhone app?
    Don't just enter usernames and passwords into apps unless you know what it is for and why it wants it.

  • HT4009 I let a child use my iPod and she purchased a lot of doeses for idoser and I did not have the money on my card. Now I can't download anything at all without using a new credit card or paying for it. How do I cancel it

    I let a child use my iPod and she purchased a lot of doeses for idoser and I did not have the money on my card. Now I can't download anything at all without using a new credit card or paying for it. How do I cancel it

    First, to prevent this from happening again, turn off "In App purchases" in the Restrictions settings on your iPod. You may also want to turn off the ability to install apps, to prevent purchases in case the child gets hold of your iTunes Store account information, and set the password to be required immediately. For more information, see:
    http://support.apple.com/kb/HT4213
    As to a refund, that's not automatic since the terms of sale for the iTunes Store state that all sales are final. You can contact the iTunes Store, explain the reason for your request, and ask, though:
    http://www.apple.com/support/itunes/contact.html
    They're usually pretty lenient in the case of inadvertent purchases by children. No guarantees, though, just as if your child was in a store and ate a bunch of food (in other words, something that can't just be returned).
    Good luck.

  • HT1420 how do i removel the silly security questions,  i purchased music in the past and now it asking for them and i can't remember the answers.  I dont like this feature if it remembers and verifys your password

    how do i removel the silly security questions,  i purchased music in the past and now it asking for them and i can't remember the answers.  I dont like this feature if it remembers and verifys your password

    Click here for information. If the option to have the answers emailed to you isn't available or doesn't work(the email may take a few hours to arrive), contact the iTunes Store staff via the link in the 'Additional Information' section of that article.
    (90135)

Maybe you are looking for