Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    IP address in Flash

    Hello

    I would like to capture a site visitor's IP address and in a normal Web page I would use something like the following:

    <%
    Dim UserIPAddress
    UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
    If UserIPAddress = "" Then
    UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
    End If
    %>


    I think I can use the same script in a Flash site, but what would I need to do in my FLA file? I do not want to show the IP address in my movie - only to 'capture' it.

    Many thanks.

    Steve

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    When you put the flash on your page do something like this
    someflashfile.swf?ip=codetoprintoutuseripaddress
    then in the flash file you can use var ipaddy = this.ip;
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello Aerospace

    Thank you for your message.
    So in my FLA file, in the Actions Script panel, I place:

    ip=codetoprintoutuseripaddress

    So I put this in even if I do not want the IP address to show publically?
    And where do I use: var ipaddy = this.ip;

    Many thanks.

    Steve

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Umm no reread my post carefully. Mainly this part
    someflashfile.swf?ip=codetoprintoutuseripaddress
    this is the part that goes in your actual page. You use var ipaddy = this.ip in your actionscript.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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