PDA

View Full Version : FSCommand how to send var from javascript to flash ? 2



Founder
August 26th, 2003, 01:03 PM
Hi,

How can I send the var ip from javascript to a flash movie
so I can display the ip in flash ?
something with FSCommand ?

this is the javascript used in a html page.



http://javascriptkit.com/script/script2/displayip.shtml

the script got left behind in first posting

DigitalPimp
August 26th, 2003, 01:29 PM
It uses PHP to get it.

Somebody merge these threads...

DigitalPimp
August 26th, 2003, 03:11 PM
When you embed your SWF in your HTML file do this in both places the filename is needed.



src="moviename.swf?ClientIP=<!--#echo var="REMOTE_ADDR"-->"


Then in your flash movie on the root do this


onEnterFrame = function() {
trace(ClientIP);
}

lostinbeta
August 26th, 2003, 03:13 PM
This should help...

http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm

ehman
August 26th, 2003, 05:35 PM
it is possible to do it eith javscript alone (no php)

check this out http://www.iota-six.co.uk/html/32_flash.htm

what are you using this for anyway ?

lostinbeta
August 26th, 2003, 05:42 PM
The link I posted in my last post was with javascript alone too ;)

DigitalPimp
August 26th, 2003, 05:54 PM
I believe he is talking about grabbing a Clients IP and the answer is no. You need a server-side language to pull it.

lostinbeta
August 26th, 2003, 06:04 PM
Originally posted by DigitalPimp
I believe he is talking about grabbing a Clients IP and the answer is no. You need a server-side language to pull it.

Sure you can DP... it's just a pain cross browser since they all do it differently.

DigitalPimp
August 27th, 2003, 10:37 AM
umm.... Paste a link or something then. I've never seen a way to grab a client's IP and I believe it is part of internet security.

lostinbeta
August 27th, 2003, 12:07 PM
Ok, I was wrong, it uses SSI combined with Javascript....

http://javascript.internet.com/user-details/ip-address.html

DigitalPimp
August 27th, 2003, 04:30 PM
It's aight, it happens. ;)

Remember, I <3 Javascript.

lostinbeta
August 27th, 2003, 05:16 PM
LOL, yeah I <3 Javascript too, but I hate x-browser coding :hangover: hehe.

DigitalPimp
August 27th, 2003, 05:19 PM
what's cross-browser? PFFT

IE owns 85% of the world, I don't worry about it. ;)

lostinbeta
August 27th, 2003, 09:02 PM
Originally posted by DigitalPimp
what's cross-browser? PFFT

IE owns 85% of the world, I don't worry about it. ;)


Well you aren't as picky as I am :smirk: