dcsimg
A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Passing variables from Flash to HTML form list

  1. #1
    Member
    Join Date
    Sep 2001
    Posts
    69

    Passing variables from Flash to HTML form list

    Hello and yes, I am stuck again.

    So, here's my dilemma...
    I have an HTML page with a form on the right hand side of the page and an embedded SWF on the left. Upon pressing a button with the SWF, I want to send a variable to the HTML form, to a list box. I've worked with the Javascript Integration Kit from the Expert Tutorial in the Flash 5 Bible and I don't see anything about it in the Flash MX Bible. Does anyone know how to do this?

    The code I used in Flash was this:
    on (press) {
    getURL("javascript:FDK_AddValueToList('frmindex/selmy', 'Rogers Park', 'Rogers Park', "1'");
    }

    Then in Dreamweaver, I entered the this code (it isn't PHP. I couldn't get the code to show up any other way):

    Any ideas?

    Thanks,
    jessicuh
    PHP Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function 
    FDK_AddValueToList(ListObj,TextString,ValString,Position)  {
      if (
    isNaN(parseInt(Position)))   {
        
    Position ListObj.options.length;
      }
      else  {
        
    Position parseInt(Position);
      }
      if (
    ListObj.length Position)  {
      
    ListObj.options[Position].text=TextString;
      if (
    ValString != "")  {
        
    ListObj.options[Position].value ValString;
      }
        else  {
          
    ListObj.options[Position].value=TextString;
        }
      }
      else  {
        var 
    LastOption = new Option();
        var 
    OptionPosition ListObj.options.length;
        
    ListObj.options[OptionPosition] = LastOption;
        
    ListObj.options[OptionPosition].text TextString;
        if (
    ValString != "")  {
          
    ListObj.options[OptionPosition].value ValString;
        }
        else  {
          
    ListObj.options[OptionPosition].value=TextString;
        }
      }
    }
    //-->
    </script>
    </
    head>
    <
    body>
    <
    form action="" method="post" name="frmindex" id="frmindex">
      <
    select name="selmy" size="1" multiple id="selmy">
      </
    select>
    </
    form
    Last edited by jessicuh; 08-18-2003 at 03:13 PM.

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