Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

+ Reply to Thread
Results 1 to 1 of 1
  1. #1

    Exclamation AS 2.0 Need Help Displaying User Data in the order item was chosen into Datagrid

    Hello Community,

    I currently have a Main.fla file with several products for the user to select with the check out button that displays the item, price & quantity into a Flash Datagrid. This works fine however, I need help to display the items in the order the user selected them currently the way I have the code set up it only displays the items as how I first stored them into the array and pushed them into the datagrid.

    Code:
    //Create a dataProvider to add some data to the Datagrid
      data_array = new Array();
      data_array.push(myArr, myArr2, myArr3);
      cart.dataProvider = data_array;

    For ex: If I only chose one item to buy that one item should not be in the middle of the datagrid but at the top since it is the only item.

    The second issue is I am trying to delete an item if the user selects it by prompting the user a Pop Up Message however this is not working either.
    Code:
    // Create listener object for DataGrid to remove selected item.
    var listenerObject = new Object();
    listenerObject.cellPress = function(eventObject:Object){
     _root.MessageBox("Warning","Are you sure you want to delete this item.");
     if (eventObject == Alert.YES) {
      trace("Remove Item");
      cart.removeItemAt(cart.target.selectedIndex)
      //cart.dataProvider.removeItemAt(cart.selectedIndex)
     }
     else if (eventObject == Alert.NO) {
      trace("No Label");
     }
    }
    cart.addEventListener("cellPress", listenerObject)
     }
    Any help is greatly appreciated thanks in advance! See attached for complete file
    Attached Files

  2. # ADS
    Join Date
    Always
    Posts
    Many
     

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial