A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: "Building" a URL with dropdown menus

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    16

    "Building" a URL with dropdown menus

    Hello everyone,
    I have reposted here from the 'newbies' section.
    I have built this ecommerce site called Scent Design.
    Because the product is user controlled, I figured out how to do the links to specific fragrance blends using the attribute strings.

    For example:
    http://www.scentdesign.net/mm5/merc...duct_Attributes[1]:value=vanilla&Product_Attributes[2]:value=vanilla&Product_Attributes[3]:value=all_spice&Product_Attributes[4]:value=musk&Product_Attributes[5]:value=sandalwood

    My first question here on Flashkit (I've lurked here for years ) is:
    How do I add or 'build' strings onto one URL using multiple dropdown menus in Flash8? I don't need someone to design it for me, but because I'm not an actionscript guy 'yet', I don't really know where to start looking for this specific information.
    The ultimate goal is for a flash banner ad that will adjust the URL depending on the choices the user makes in the flash banner.

    Thank you all for your time and any wisdom you all wish to share!

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Hi.. sorry but Im not following what it is you want to do..

    example.. you click on a button in your flash banner.. and instead of going to:
    www.whatever.com
    you want it to say
    www.whatever.com/value=vanilla
    ??

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    16
    What I'm trying to do is mimic the pull down attribute assigning ability of the website inside of a flash banner like here:
    http://www.scentdesign.net/mm5/merch...=fragrance_oil
    So you would have the URL www.scentdesign.net and then depending on the 5 other pulldowns, those attribute strings would be added to the base URL. That's why I worded it as 'building' a URL.
    Technically, aren't you just taking 6 inputs: one static and 5 from the pulldown options and then sending them to a web browser?
    I hope I didn't choose a doozy of a project to start learning Actionscript...

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    well Im sorry your 'wording' was confusing....so I asked for clarification.

    You can build strings however you like... but how are you going to get your current URL..


    but looking at the link you provided..

    you can take the values of the drop down and add it to a a URL

    once the drop down option is chosen..is it supposed to 'trigger/load a new pages with the new attribute (var) in the URL/query string.?

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Posts
    16
    Yeah, I didn't know how else to explain it. This is my first foray into Actionscript... :P
    But yes, after all 5 of the drop down options are chosen and the person hits 'submit' or some such button, then yes in my theoretical world the page they go to would include those attributes.
    The thing is, I've made over 100 of these links with variable strings on the http://www.scentdesign.net/recipe_list.html pages where you can click the links and the page loads with the variables in place. I'm hoping that I can learn how to do that in Flash. I'm just so new I didn't know what to call it or even where to start researching the exact commands I'd need.

  6. #6
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    its should be easy enough (if I understand you correctly)

    you have your BASE URL:

    http://www.somesite.com.. you can grab the values in the combBox like so:

    Code:
    submit_btn.onPress = function(){
        getURL("www.somesite.com?"+combo1.value+"&"+combo2.value+"&"+combo3.value);
    }

  7. #7
    Junior Member
    Join Date
    Jun 2007
    Posts
    16
    I would imagine that is exactly it
    Now I just need to learn how to build all of this!
    Thanks for your help whispers!

  8. #8
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    as far as the code....thats all of it.. you just add more code for as many comboBoxs you have... if you need to add more to the string than just the VALUE in the comboBox.. just do this:

    getURL("www.somesite.com?Attribute1:"+combo1.value +"&Attribute2:"+combo2.value+"&Attribute3:"+combo3 .value);

  9. #9
    Junior Member
    Join Date
    Jun 2007
    Posts
    16
    FOLLOWUP

    I got it all working and it is awesome!

    I did need to change the variable from "+combo1.value" to "+_root.cb1.selectedItem.data". I don't know enough about AS to know why though :P

    Whispers, thank you for helping me with my very first Actionscript project! I'll post a final link to the ad interface when I'm finally done

  10. #10

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