A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help with passing variables

  1. #1
    Junior Member
    Join Date
    May 2001
    Posts
    15

    Help with passing variables

    Hi there....

    I am using the following snipet of action script to open swf file in a new pop up window after an item has been selected from a list box........

    function SelectItem()
    {
    var newWindow = window.open();

    receiver = listBox.getSelectedItem().data["onlineuser"];

    getURL("javascript:var newWindow=window.open ('http://www.webaddress/messagewindow.swf?receiver','as4d','width=325,heig ht=325')");

    }

    The variable 'receiver' is selected from a listbox by a user.

    I want to pass the value stored in 'receiver' to the messagewindow.swf that is included in the geturl statement.

    Can someone shed some light on how I can do this please.

    Thanks for your help

  2. #2
    Senior Member
    Join Date
    Sep 2004
    Posts
    181
    errors =

    *javascript should be written without spaces
    * no in the getURL funct, do NOT use var before your variable.

    check your output window when testing in flash F11, this should indicate where you made mistakes


    cheers

  3. #3
    Junior Member
    Join Date
    May 2001
    Posts
    15

    Help with passing variables

    Thanks sidewalk...

    The spacing was a typo when I modified what I copied into the message window after I'd done the post...

    Anyway got it sorted out... this is the coding I ended up using:

    getURL("javascript:var newWindow=window.open('http://webaddress.com/testarea/messagewindow.swf?receiver=" + username + "','as4d','width=500,height=350')");

  4. #4
    Senior Member
    Join Date
    Sep 2004
    Posts
    181
    happy to be of help.

    still do not use the var inside the command.

    using var will define the variable again, so that"s useless code.

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