dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Combo box - Pop up Window?!

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    79
    Hi all,

    I want to make a combo box that pops up a window when an entry is selected. What i know is the code to open a blank window with an url:

    function fun() {
    getURL(comboBox.getSelectedItem().data, "_blank");
    }

    But what i want is to combine the following code with the previous one:

    on (release) {
    getURL ("javascriptpenNewWindow('my.htm','thewin','height=248,width=2 10,toolbar=no,resize=no,menubar=no,status=no,scrol lbars=no,left=402,top=250');");
    }

    I want a combo box to open a window as described in on(release...

    Can anyone help me with this?
    Thanks a bunch!
    Natsurfer

  2. #2
    Member
    Join Date
    Feb 2002
    Posts
    53

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    79
    Thanks for replying.

    Couldn't find what I'm looking for though. I basically know how to open up a pop up window from a button...but i want it to open from the combo box.

    Any ideas?
    Natsurfer

  4. #4
    Im not sure if it is working, just an idea:

    try to read out the data in your ComboBox (write url in data) . This must be in the funktion you call:

    fnktion.....

    var index = typ.getSelectedIndex();
    var url=(typ.getItemAt(index).data);

    after that your variable should have the url and you should be able to pop up a window

    let me know if this is working
    mail@7dirk.de

    Greets Dirk

  5. #5
    Member
    Join Date
    Jul 2002
    Posts
    79
    Hi Dirk,

    Once I had this Variable, where would i put it then?

    on (release) {
    getURL ("javascript:openNewWindow('VARIABLE','thewin','he ight=248,width=210,toolbar=no,resize=no,menubar=no ,status=no,scrollbars=no,left=402,top=250');");
    }

    I'm not sure but since I'm calling a function which is defined in the html page, shouldn't I actually define this VAR there too? Flash doesn't seem to recognize the Var between the ' ' tags.

    Thanks for your time
    Natsurfer

  6. #6
    Hi Natsurfer

    What you mean with calling the function in html? Youve to define the function in Flash.

    Try to call the popup window in Flash

  7. #7
    Member
    Join Date
    Jul 2002
    Posts
    79
    I have the following js between the <head> tags in the html page where the swf file is being loaded

    <script language="JavaScript">
    function openNewWindow(URLtoOpen, windowName, windowFeatures) {
    newWindow=window.open(URLtoOpen, windowName, windowFeatures);
    }
    </script>

    and this openNewWindow function is the function i'm calling in flash.

  8. #8
    Member
    Join Date
    Jul 2002
    Posts
    79
    anybody?

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    167
    Natsurfer_
    i was working on a very similar thing like a month ago and Oldnewbie kicked me down some rad tips.
    he is so rad.
    anyways_
    select your combo box instance and put this in the actionscript:
    __________________________________

    myCombo.setSize(175);
    function chooseMenu(myCombo) {
    getURL(myCombo.getValue());
    }

    myCombo.addItem("Anderson, Pam", "javascript:fensterauf('AndersonUn.swf','portfolio Win1',500,300)");
    myCombo.addItem("Aniston, Jennifer", "javascript:fensterauf('AnistonUn.swf','portfolioW in1',500,300)");
    myCombo.addItem("Arnold", "javascript:fensterauf('ArnoldUn.swf','portfolioWi n1',500,300)");
    myCombo.addItem("Arquette, David", "javascript:fensterauf('ArquetteUn.swf','portfolio Win1',500,300)");
    myCombo.addItem("Brosnan, Pierce", "javascript:fensterauf('BrosnanUn.swf','portfolioW in1',500,300)");
    __________________________________

    i'm doing a paparazzi site so i have all these star names, it's totally weak.
    so you'd replace the names there with what you'd want to show up in your combo box as labels.
    MAKE SURE you give your combo box the aforementioned instance name of "myCombo" unless you change it in the code.
    also you can use your PopUp code instead of mine.
    hope this works for you.
    Peace_
    KQ


  10. #10
    Member
    Join Date
    Jul 2002
    Posts
    79
    THANKS SO MUCH!! That's exactly what i was looking for

    I owe you one.
    Natsurfer

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