Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array problem - selected products in a list - Urgent please...

Status
Not open for further replies.

D2C

Programmer
Aug 27, 2001
86
BE
Dear helper,

I have a flash presentation with products, this section is called the catalogue. Next I have a section Pricing,
users should choose their products in the catalogue, and then get a list in pricing for printing.

I made an array and gave each product some details:

var pricing = new Array();
product1[O] = "Table with stool";
product2[1] = "Table without stool";

If the user presses the button "add to pricing", then the product, let's say product1 should be added to a list,
When the user click on pricing, he/she should get a list with all products he/she selected.

How can i do this? I just want to use actionscript because my presentation will be on a CD and with a projector file.

Thanks in advance,

regards,


d2c
 
your array is incorrect:

should be:

var pricing = new Array();
pricing[O] = "Table with stool";
pricing[1] = "Table without stool";

or

var pricing = new Array("Table with stool","Table without stool");

[conehead]
 
Thanks, but I still don't know how to list the items...
 
One way to store and list the items is to create another empty array then add the selected items into it.

Store the value of your item in a variable such as 'currentItem' then use the array function 'push' to add it to the new Array. Then when you want to generate the final list just loop through the array and pull out all the values that were stored.

Code:
on(release){
  newArray.push(currentItem);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top