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

flash actionscript

group:

getURL and session variables


getURL and session variables Doug Strickland
10/28/2004 3:54:50 PM
flash actionscript:
I am attempting to pass a couple of params to an asp page, and I am getting
errors when exporting. here's the code:

on (release) {
getURL("AT_Render.asp?PN=<%infopage%>&CN=<%=Session("CN")%>");
}

In this case, AT_Render.asp is a page that needs two pieces of data, the
page name (PN) and the session variable CN.

When I export, I am getting this error:


Total ActionScript Errors: 2 Reported Errors: 2

**Error** Scene=slide five, layer=next, frame=1:Line 2: ')' or ',' expected
getURL("AT_Render.asp?PN=<%=color wheel%>&CN=<%=Session("CN")%>");

**Error** Scene=slide five, layer=next, frame=1:Line 3: Unexpected '}'
encountered
}

Total ActionScript Errors: 2 Reported Errors: 2



So my question has two parts:

First, this looks like a syntax error, but i've rechecked everything three
times, and I still get the error. I've tried removing everything about the
second (session) variable CN, and the error goes away.

Second question, it looks like I need access to the session variable
Session("CN"). How do I get that into this action.

(In over my head)

Thanks



Re: getURL and session variables theco
10/28/2004 9:36:41 PM
Try splitting your url string

on (release) {
getURL("AT_Render.asp?PN=<%infopage%>&CN=<%=Session("+"CN"+")"+"%>");
}

[quoted text, click to view]

Re: getURL and session variables Jon Moyles
10/29/2004 9:57:24 AM
[quoted text, click to view]

your problem is in attempting to put quotes inside a string

i.e. trace(""");
does NOT output "

putting a backslash \ in a string makes it use the character after it as
part of the string. so try:

Re: getURL and session variables VisionaryStudios
11/4/2004 12:38:24 AM
Either the other posters or I am way off base. I am working from assumptions
below that I am not sure about but am fairly positive of. The <%infopage%> or
any other sessions variables will not work because they are external to flash.
How does flash know what those variables are supposed to be? Flash will out
put that as you see it. Not interpret the asp variables. And neither should
the browser in a Flash command. So your URL will still look like this when
output: AT_Render.asp?PN=<%infopage%>&amp;CN=<%=Session('CN')%> And I am sure
that is not what you are looking for. Second, one poster is right, you can't
use the quotes in the URL. So Flash will tell you that is the only error,
because it cant read your mind about wanting to translate the ASP variables
since it does not speak ASP. It will assume you want those exact ASCII
characters. So, even once you get rid of your SYNTAX errors you will not get
the results you want. Third thought, you dont need to have them in the URL at
all. If you do getURL(AT_Render.asp, 'GET'); it should add in the variables
for you? You need to have the ASP variables passed into Flash and have Flash
re-out put them in its native format. Sorry about rambling, its been a long
day. I hope I made some sense.
AddThis Social Bookmark Button