all groups > flash actionscript > november 2004 >
You're in the

flash actionscript

group:

Please help,getURL and pass variables problem


Please help,getURL and pass variables problem luciewong
11/25/2004 6:27:21 PM
flash actionscript:
Hi, Everyone I am passing variables with a getURL function like:
getURL('mysite/index.html', '_blank', 'GET'); //all the vars appear nicely in
the new Browser window in the title bar, but I just can't get them down on my
site. Why? //it seems, that the new window just cant read them. //When I do the
same with a 'loadMovieNum' function, the vars appear down on the site, but then
the new site is just much too small. Any ideas what I do wrong? Lucie
Re: Please help,getURL and pass variables problem luciewong
11/26/2004 2:40:29 AM
Re: Please help,getURL and pass variables problem monkeyboy1972
11/26/2004 2:55:09 AM
Hi, give this a try
getURL('yoursite/index.html', '_blank');
without the 'get'. These has always worked for me.
Re: Please help,getURL and pass variables problem luciewong
11/26/2004 4:14:15 AM
Thankyou for your reply, monkeyboy, but it does not work either. //I tried all
below, where conStr3 = 'Clients/index.html': getURL(conStr3, '_blank',
'GET');//<<21/11/04> getURL(conStr3,'_blank');
getURL('Clients/index.html?cname=Ben', '_blank');
getURL('Clients/index_content.html?cname=Ben&amp;address=xxxxx', '_blank');
//the vars appear always in the new Browser window, I just cant get them down
to the page, he cannot read them?! regards, Lucie
Re: Please help,getURL and pass variables problem luciewong
11/26/2004 7:47:18 AM
in the addressbar of the browser window the string looks like that:
....../index_content.html?pi1passengerno=B476333M&amp;psb%5Fagencyno=F4128M&amp;p
b%5Fid=5 -- //how can I get these vars down to my page. Appreciate very much
your help.
Re: Please help,getURL and pass variables problem luciewong
11/27/2004 6:37:50 AM
It's always good in some way communicating with yourself, sometimes this helps
to find a solution. I mean out of 19 posts I got twice an answer, one from Mr.
kglad and one from monkeyboy, thats not too bad. The real problem is - I need
to transfer at least 1 variable from 1 swf file to another in another folder. -
when I try 'loadMovieNum' with GET, the vars appear on the receiving site,
but... the swf Format is not 760x800 anymore, it is much smaller. I tried to
solve this problem by putting the send code on different timelines, but the
receiving page still will inherit some strange small measurements. - so, I try
to send the vars with 'getURL'. The site opens in the desired size with a new
window, the vars are all in the title bar of the browser, but I just can't get
them down on the site. All vars appear as 'undefined'. So after 1 week it
comes to my mind, - 1. could it have something to do with 'security/sending to
other Domains', or 2. do I need to encode in some way, so that the site can
read the posted vars, or 3. do I need to put on the receiving page on Frame 1
some MC, which waits until the vars are completly loaded and then assigns the
vars - which is actually my favorite at the moment to find one day a soloution.
However, when I got it I will share the solution withyou. Cheers, Luciewong
:brokenheart;
Re: Please help,getURL and pass variables problem J_o_h_n_n_y
11/27/2004 6:46:55 AM
How are you trying to "use" these variables?

If you see them in the addressbar, then they are accessable to your webpage.
To do something with them you need to use some scripting. If you are doing this
with PHP it would be $_GET["varname"], if you are just doing a static web page,
as in a .html, then you can use javascript to get to them. With javascript you
get to them with "window.location.search" (in IE). If you add this code to your
HTML page:

<script>
alert(window.location.search);
</script>

You will see what I mean. I don't know the netscape code for this offhand, so
use IE for the above example.
Re: Please help,getURL and pass variables problem luciewong
11/27/2004 8:50:54 AM
Thankyou Johnny for your reply, - from the sender swf I send variables to the
receiver(index.html) with: getURL('..../index_content.html','_blank', 'GET');
// - so the new browser window 'index_content.html' will open and I can see in
the address bar of the new window, that all variables are passed, but how can I
access them? So I put on Frame1 in index.swf some text fields and give each of
them the name of the variable which it is supposed to receive. I also declare
them as String variables on frame1. For ex. 'var cnumber:String; ' //When the
variable arrives, it should actually show me its value in the text field,
....but it does'nt. It says 'undefined' in my textfields. So my question is,
how can I get these variables, which are actually arriving, down into my
index.swf, so I can work with them? They appear perfect in my text fields when
I use 'loadMovieNum' for example, but then the swf is very small in the new
browser window, so I must use 'getUrl'. I have read now more and more about
this issue and it seems, that I must use some javascript in my index.html to
get these vars? Cheers Lucie
Re: Please help,getURL and pass variables problem J_o_h_n_n_y
11/27/2004 8:57:34 AM
Yeah, HTML is nothing more than a formatting language. To do anything with
variables, or anything data-driven or interactive you at least use Javascript.

If you are a beginner to web development, and don't know how to Javascript -
this is a good place to start:
http://webmonkey.wired.com/webmonkey/programming/javascript/tutorials/tutorial1.
html

Otherwise, if you have any specific questions, I'd be glad to help.
AddThis Social Bookmark Button