A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Multiple Selections to send user to appropriate link

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    Seattle
    Posts
    73

    Multiple Selections to send user to appropriate link

    Hello all, I was sent here from the html board for a solution.

    I am developing a product selection page where a user will pick what they want from 4 drop downs and be sent to the appropriate shopping cart page. The client wants it done with drop downs in the following way

    DropDown1- Select Product(3 choices)
    Dropdown2 - Select Color (7 choices)
    DropDown3-Size (5 choices)
    Dropdown4 - Add accessory or not (yes or no)

    Then depending on their choices they will be sent to the appropriate page. Additionally, 2 0f the 7 color choices(camouflage, tan) do not have the accessory option so I need dropdown 4 to automatically change to no if a user selects one of these colors.

    For example, a user selects product2, red, large, no accessory they will be sent to p2_red_large_no.html.

    I would prefer to do this with flash opposed to javscript but I am not sure how, or even if it is possible. Any help would be appreciated. Thanks much.

  2. #2
    Junior Member
    Join Date
    Aug 2007
    Posts
    5
    I have the same problem. Can anyone help?

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    this example might help
    PHP Code:
    // Flash 8 - frame#1 - 
    // 4 Combobox components -
    // Instance names - product_cb, color_cb, size_cb, acc_cb
    // 1 button - instance name - showLink_btn

    prodArr = ["Select Product","Tie","Hat","Socks","Belt"];
    colArr = ["Select Color","Red","Blue","Green","Tan","Camo","White","Black"];
    szArr = ["Select Size","SM","M","L","XL","XXL"];
    accArr = ["Accessories","Yes","No"];

    for(var 
    n:Number=0;n!=prodArr.length;n++)product_cb.addItem(prodArr[n],n);

    var 
    o1:Object = new Object();
    o1.change = function(event_obj:Object) {
    color_cb.removeAll();
    for(var 
    n:Number=0;n!=colArr.length;n++)color_cb.addItem(colArr[n],n);
    htmlString1 event_obj.target.selectedItem.label;
    trace(htmlString1);
    };
    product_cb.addEventListener("change"o1);

    var 
    o2:Object = new Object();
    o2.change = function(event_obj:Object) {
    size_cb.removeAll();
    for(var 
    n:Number=0;n!=szArr.length;n++)size_cb.addItem(szArr[n],n);
    htmlString2 event_obj.target.selectedItem.label;
    colData event_obj.target.selectedItem.data;
    trace(htmlString2);
    };
    color_cb.addEventListener("change"o2);

    var 
    o3:Object = new Object();
    o3.change = function(event_obj:Object) {
    acc_cb.removeAll();
    htmlString3 event_obj.target.selectedItem.label;
    trace(htmlString3);
    if(
    colData == || colData == ){ //  Tan or Camo
    trace("no accessories");
    } else {
    for(var 
    n:Number=0;n!=accArr.length;n++)acc_cb.addItem(accArr[n],n);
    }
    };
    size_cb.addEventListener("change"o3);

    var 
    o4:Object = new Object();
    o4.change = function(event_obj:Object) {
    htmlString4 "_"+event_obj.target.selectedItem.label;
    trace(htmlString4);
    };
    acc_cb.addEventListener("change"o4);

    showLink_btn.onRelease = function(){
    if(!
    htmlString4htmlString4 "";
    link htmlString1+"_"+htmlString2+"_"+htmlString3+
    htmlString4+".html";
    trace(link);
    }; 

  4. #4
    Junior Member
    Join Date
    Aug 2007
    Posts
    5
    exactly what I was looking for. thank you so much a_modified_dog. enjoy your weekend.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center