Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Passing A Variable To A Query String



I am trying to create a form in Flash that passes variables to a query string. Simple enough, but when my variables have an underscore (eg variable_one) Flash coverts the underscore to “%5F”. I noticed that it seems to convert all non letter or number characters to something else. Unfortunately I don’t have the option to change the names of the variables I am passing.

This is the code:

submit.onRelease = function () {
getURL ("http://www.actionscript.org","", "GET");
};

Has anyone encountered this? Help Please!



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-24-2007, 06:12 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Passing Variable From An HTML Query String
HELP?

I am using the javascript

window.document.smoothie.SetVariable("_root.texty" , query);

in an HTML page, to pass the value in 'query' to a dynamic text box, 'texty' on the main timeline of my Flash movie.

The passing of the variable works, and can be seen on any one of these 3 pages:

http://www.runspotrun.com/test/page2.html?chewbacca
http://www.runspotrun.com/test/page2.html?hansolo
http://www.runspotrun.com/test/page2.html?obiwan

If the value of query is 'chewbacca' then what loads on the page is different than if the value is 'hansolo' and so on...

The passing of this variable works, EXCEPT - one needs to RELOAD the page to see it. When the movie/page first loads, the value doesn't appear. If it is reloaded, then the value appears. A following visit to the same page, even passing a different variable will work fine also. It's just that very first visit, the first time the movie is opened on a particular browser.

After many hours of trying to figure this out, I am at a loss. Can anyone help me with this please?

ThankS!
mark

Passing Variable To FLVPlayback Via Query String
This seems very easy but I am stuck here....
Here's the html that I'm trying to pass the flv name to the FLV component







Attach Code

In the html
<param name="movie" value="/proxy/MC-video-component.1.swf?flvName=vod/q1_2009_mkt_story">


and in AS i have an instance of the FLVPlayback component on the stage

var flvName;

myFLVPlayback.source = "rtmp://myFMSserver.org/" + flvName +".flv";

Any help?

Passing Data With Query String
I'm trying to 'pass-through' a variable in a flash movie.

Basically I'm using flash to create a form that needs to be posted back to a server side database, using get url this is no problem.

However I want to populate the flash movie with a value that when the get url command is exectued, this value is passed back to the database.

e.g.

I have a variable called "AdvertID" it's value is "100". I know this before I play the movie, so I call the movie thus:

embed src "movie.swf?AdvertID=100" etc.

However when flash posts this data back using get url, it doesn't appear as one of the variables.

I do not want the user to see this value (however if they must I can live with it).

Do I have to declare "AdvertID" as a variable for this to work?

If I do where?

Thanks.

[CS3] Passing Variables From Query String
Hi there,

i'm trying to pass a variable from a web page to a flash file. The flash file has a dynamic text box with the var value set to formError.

In the webpage i have the following code:

<script type="text/javascript">
var so = new SWFObject("flash/index_030308.swf?t=150", "mymovie", "938", "305", "8", "#FFFFFF");
so.addParam("allowScriptAccess", "sameDomain");
so.addParam("quality", "high");
so.addVariable("formError", "<%=request.QueryString("formError")%>");
</script>

to test i am typing in the address bar default.asp?formError=woteva, hoping to see "woteva" displayed in my dynamic text box in the flash file, but this isn't the case. Where am i going wrong?

Passing A Query String To Flash
Here's the need:

I'm going to be making a gallery of "thumbnails" which are all a flash file dynamically loading new content in each. So a single html page will house up to 48 copies of that same swf loading a new picture in each.

There has to be a way to load a flash file with a query at the end, right (in the html source code)? Like filename.swf?id=123&thispage=123 right? If so, how do I access those variables passed to flash?

My idea was to write my standard loop (in PHP) posting a new swf in each iteration but change the query string with each so that I can load the new content.

Passing Variables Via Query String
i am trying to load different xml that get generated through .net when I am trying to pass varibels i am getting undefined. Can someone give me a heads up on what i might be doing wrong. from what I have read and learned I can pull via-

Code:
xmlData.load("/family/galleryimage.xml.aspx?pid=" + _root.loaderInfo.parameters.pid.toString());

Then I am defining pid in within the object class.

Code:
<param name="pid" value='<% =Request.QueryString["pid"] %>'>
However I am getting undefined. Any help is much appreciated, thanks.
MT

Passing Query String From Address Bar URL Into Swf
Hi All,

Let me preface this by saying that I'm primarily a design/animation/marketing guy so this could be a stupid question with an obvious answer. However, I have been scouring the web for two days now and have yet to find any posts/tutorials which offer a solution.

Here's the challenge:

I have a flash movie that movie is contained within the same included file on every page of a site. I need some way of telling the flash which pages it's on so it can display the appropriate XML feed. Since each of my pages has a query string in the URL (i.e. thesite.com?page=1) I imagine the best way to do this is to somehow send the string into the flash movie. Once it's inside the movie I'll write a function that pairs the each string with it's corresponding XML feed (btw, if anyone has an a similar script they can post it would be a huge help to me!).

Note that because the movie is part of an include that is on ever page its parameters (such as EMBED tags) cannot be changed either.

The only solution outside of directly passing the query string from the page URL (as it appears in the address bar) to the flash would be to create some sort of Javascript in the HTML that captures the query string and then sends it along.

If anyone can help me out with this it would be GREATLY APPRECIATED.

Thank you in advance!

Passing Special Characters On A Query String
Hi,

I have a project that requires to send a string variable to a swf movie using a query string in html like this:

<PARAM NAME=movie VALUE= "movie.swf?text=Vous ętes dans le Hall d'entrée.">

My problem is:
this text is read from a database using jsp and has special characters like é, č, ŕ and other french specific ch.

I've seen the posts for external txt files using unicode, tried to save the html file as unicode, but still no results. My text field doesn't look right.


Can anyone help me? I ran out of solutions.
Thank you.

Passing Query String Var Into Flash Only Works Sometimes...?
I'm trying to pass a variable into Flash from a query string, and for the most part it works great.

flashmovie.swf?page=home

On any page other than the home page, the Flash movie should skip it's build animation and go right to a resting state. Code:

if (page != "home") {
gotoAndPlay("navigation");
} else {
play();
}

This only works as intended after visiting several pages. Lets say I arrive on the home page and the movie plays through all it's animations. Fine, great. Now I go to any other page and it should skip right to the 'navigation' keyframe - right? Wrong, the movie skips ahead only about 40 frames, and plays out the rest of the intro. All other pages afterward behave correctly as coded. And revisiting that second page also now behaves normally.

What's the deal?

Passing Accented Letters Through Query String
I want to pass the variable="tést" through the query in html,
so I urlencode it and do this:

myswf?var=t%E9st

..but all I get on the flash side is a string two letters long, the second letter beeing not readable! I'm unescaping it and still nothing...
Am I missing something or flash does not accept 'ALL' urlencoded characters...

I'am just very surprised to see this....

pitu

Passing Variables From HTML To Flash Using Query String
Am using query strings in HTML to pass variables to my flash movie so I can use the same movie but different title on each page. See www.gogojuicebars.com

Works fine when I test locally, but when uploaded the movie seems to display only the first "welcome" title on each page until you have clicked all of them. Then it works correctly???? Is almost like the flash movie is loading before the varaibles can be passed, but how can this be??

Any ideas on how to fix this?

Variable From Url Query String
simple ish

i understand the whole moviename.swf?variablename=content format to pull a variable into flash

but i cant seem to apply that formatting to the new method that dreamweaver uses flash

any ideas?


Code:
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','700','height','273','src','script4_pressures','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','script4_pressures' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="700" height="273">
<param name="movie" value="script4_pressures.swf?page=climate">
<param name="quality" value="high">
<embed src="script4_pressures.swf?page=climate" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="273"></embed>
</object></noscript>
i should be able to take the "page" var and use it, but its not working, could this be something to do with the dreamweaver fix for embeds?

cos my browser is using javascript it's not getting to the <noscript> tag

how can i parse the url using the above format?

any help would be appreciated

thanks

ds

Getting A Variable From Query String In The URL
Hello all, here’s what I’m trying to do:

I’m linking to a HTML page using a link like this ‘<a href="www.myhtmlpage.html?MyVar">To view your profile click here</a>” What I want is for the flash file on this html page to read in the url and get the passed variable “MyVar”. How is this done, or is there a better way of doing this?

Any help would be greatly appreciated

Thanks, -L

Passing Variable Via Query
HI

I wanted pass a variable from the html page to the flash page and direct the user in a specific part of the flash. So i would need just a variable with a number to pass into flash.
Could I use something like <a href="http://www.mysite.com/test.html?sectionNum=5">Section 5</a>

How would I get that variable to pass into flash to send the user directly to Section (Frame) 5?

thanks for any help!

Passing Variable Thru URL Query And PHP
I know there are a thousand posts about PHP/Actionscript problems, but I'm really lost and can't seem to find a solution. So any help is highly appreciated.

I have an ID number that is created within PHP. The ID number then is passed thru a plugincheck.swf and then passed on to the main application - all over URL query.

This is within the plugin.swf

getURL("main.php?id="+_root.id);

and it creates this URL

https://www.site.com/main.php?id=226


First questions:
This works fine in Firefox and on Mac, the ID shows up within the application. But Internet Explorer doesn't seem to read the ID. Any ideas on that?


Second question:
Within the main.swf, I put the ID number into another var like this:
var passID = id;

And then later, when you click a send-button in a form, it should open the next php file and do it's magic, with this code:

loadVariables("https://www.site.com/form.php?id="+_root.passID, this, "POST");

But it doesn't do anything no more. In fact, the form.php would make an entry into the Db as soon the file is called up, but nothing happens.

Any ideas?
Thanks a lot.

Query String Variable In A Loaded SWF
Hi there, this is what i would like to happen.

- A Variable is set in the query string of the HTML
e.g. flash.swf?number=1

- In flash.swf, a movie is loaded into a container using the if function


Code:
if(number == 1){
loadMovie("my_mc.swf", loadhere);
}


- However, I would like the loaded movie (my_mc.swf) to also read this variable and play an action. For example


Code:
if(number == 1){
loadMovie("my_mc.swf", loadhere);
_root.loadhere.gotoAndStop(2);
}


In theory this should work, but it just doesn't. Anyone got a solution?
I've tried levels to no success as well.

Pass Variable Via Query String
i'll try to explain this the best I can.

I have a flash header that I need included in a shopping cart site that will have nav and the header descriptions for each site page. It has 2 navigations, top and side. Side nav only controls the flash itself to display stuff that won't be in the rest of the site, like an about us section. The top nav controls what page the shopping cart goes to AND the flash header display. For example, when I click on my top nav button 'systems' I need it to go the 'systems page' and change the flash header to display info about the systems. Now when the 'system' button is clicked the page changes to the 'systems' page but since its a header the flash just pops up on the new page reloaded to its original state. So how would I fix this? could flash pass a variable via the query string to determine what frame it should be on when going to a new page?

Setting A Variable From A Query String...
I'm creating a banner for a client that pulls in images via XML (sub_banner.xml.php) and depending upon which section of the site the user is in, PHP writes a query string sent via flashvars to set which section images to pull in.

The URL for example, after the query string is set for 'conferences' section of the site will be: sub_banner.xml.php?headerImages=conferences

All the PHP is in place, I'm just having trouble setting the query string variable (headerImages) in flash.

I've tried: var headerImages:String = headerImages;

Any idea on how to set a variable passed through flashvars??

My background is HTML/CSS based and still learning AS2 so any help is much appreciated!

Actionscript Variable From PHP Query String
Hi All,

I all rather new to the scripting side of flash, please can someone advise me on where I'm going wrong.

I'm send the variable 'id' via both the movie URL (value = "1001.swf?id=1001") and within the FlashVars (value = "id=1001").

I've been tearing me hear out try to get the actionscript to write the 'id' within a dynamic text instance box.

Please help and thanks in advance

HELP NEEDED With Sorting Query String Into Variable Array?
Hi,
I need to sort a query string with a number of variables into an array of variables..

Here is the query string being sent to the swf file:

order.swf&LOCT0=bedroom&LOCT1=dwelling&LOCT2=kitch en&LOCT3=landing

Below is the script im using:

Location = new Array;
for (i=0; i<"LOCT"; i++) {
Location[i] = eval("LOCT"+i);

It doesnt work! what is wrong in my script??? Please help!

thanks,
Shahid

AS 2 Problems Setting Variable From Query String In Flash...
I'm creating a banner for a client that pulls in images via XML (sub_banner.xml.php) and depending upon which section of the site the user is in, PHP writes a query string sent via flashvars to set which section images to pull in.

The URL for example, after the query string is set for 'conferences' section of the site will be: sub_banner.xml.php?headerImages=conferences

All the PHP is in place, I'm just having trouble setting the query string (headerImages) in flash. I've tried: var headerImages:String = headerImages;

My background is HTML/CSS based and still learning AS2 so any help is much appreciated!

Pass Frame Variable Via Query String Bettween 2 Swf In 2 Different Html Files
Hello, I have an swf movie embedded in an HTML. One of the links calls to another HTML with a different SWF embedded. I need to link back to the original HTML/SWF but to a certain frame within that SWF using HTTP query. I understand that I can do this with Javascript and by parsing the HTTP query. Can anyone direct me to a tutorial or give me some help?

Thank you

maknenoiz

Passing A String Into A Variable Name
I have a function, and as a result of the function, I want it to create a value in a variable. The string is passed in a button as this,

on (release) {
this.boxCheck("x1");
}

function boxCheck(letter) {
if (this[letter]._currentframe == 2) {
this[letter].gotoAndStop(1);
} else if (this[letter]._currentframe == 1) {
this[letter].gotoAndStop(2);
}
HERE I WANT TO CREATE A VARIABLE THAT WOULD CONTAIN THE STRING IN IT. SO FOR THIS INSTANCE, I WANT TO CREATE A VARIABLE NAMED: x1selected = 1;

How can I do this passing the string to keep it dynamic?
like this? this[letter] + "selected" = 1;


}



Any ideas?

Passing A Filename As A Variable..is It A String?
Hey can someone help me,

I want to set a variable as a file name,

i.e variable_1 = "file_1.exe";
How should I declare it? I was declaring it as above but it was being passed as a string and wasn't being picked up by my other functions, I also tried without the inverted commas and it wasn't being picked up at all, any advise?
Cheers

Passing A Variable To Flash Via Url String
I understand how to get a variable into flash when it's hard coded into the html using Flashvars or this is how I do it with SWFObject:
where variable: location=subdirectory

Code:
<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("featuredviewer.swf", "featuredviewer", "620", "480", "8", "#fff");
so.addVariable("location", "subdirectory");
so.write("logo");

// ]]>
</script>
What I don't understand and can't find is how to do this...
I have an html file with an swf in it. Different buttons in the file open a popup window via javascript. I want to pass a variable to the swf in the pop up window, possibly like this:

Code:
on (release) {
getURL("javascript:Launch('featuredviewer.html?position=one')");
}
But how do you extract the variable position=one out of the url and get it into flash?

Passing Variable On Querry String To PHP
I'm building a upload app and need to send my php script some info when I call my upload script. I've established a var ID.

Can someone confirm if my syntax is correct.

ActionScript Code:
fileRef.upload("upload.php?userid='+ID+'");

Thanks!

Trouble Loading A Text File When Passing The Variable In The URL String
I am trying to load variables into Flash from a text file. I pass the name of the text file as a variable in the URL string and then use that variable in the loadVariables command to pull in the text file. It works fine locally but is unreliable up on the server.

I seem to have got past this problem by moving the action to frame 2 from frame 1.

Has anyone else experienced problems with this and has found a better resolution?

Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.

I am have having the following error:

Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs

I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.

I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.

stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);

function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;

var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);

status_txt.text = “Sending…”;

}

function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}

function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}

and the following asp.net code:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"

Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")

'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)

'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody

'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)


Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)

Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>

String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?


Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:

Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

Query String
in the src parameter in my html file I've got

http://www.myDomain.com/myMovie.swf?var=val

What is the best way to extract the values in this query string...I do have a method, but it is longer than i think it needs to be...any ideas?

Query String
How to read Query String for example:
test.swf?test=1&id=23&line=23,
how to read the values of test, id and line inside the flash move in script?

Query String
I want to pass variables into a flash movie using a query string... How can I do it?

i.e myPage.htm?id=4

I want to be able to get the id variable from the query string into flash

String Query
how can i change the font color using string query?
so other people can use the file with their own text and font color.

sample:
myflash.swf?text=Hello World!&fontcolor=0xFF0000

i also want to load a pic using string query,
sample
myflash.swf?text=Hello World!&fontcolor=0xFF0000&image=mypic

thanks, hope you can help me.

How To Get The Query String?
Can somebody tell me how to get the query string? this._url always returns the value at compile time, which of course is my local file:///....myMovie.swf. I'd love to get everything after the question mark, e.g.

mydomain.com?test=test

Any ideas?

<edit>I know that you have to try this from a webserver, in which case it does the same thing, except http://... rather than file:///...</edit>

<edit>Is the only way to do this via javascript?</edit>

URL Query String
How can I get the document URL and query into a variable in actionscript?

I tired using the method below, but this does not work in IE.
http://actionscript.org/forums/showthread.php3?p=561688

Here is an example you can try in both Firefox and IE.
http://hombrefeo.com/fla/?foo1=bar1&foo2=bar2

AS2:: String Query
I have a string that looks something like this:

TestString - "1,0,0,0,0,0,1,0"

I need to create some sort of loop (I think) to search though the string and look to see if it contains any 1's.

How was I go about this?

Any help would be great thanks.

Query String ?
a client is asking me for this:
is this possible?

We would like to present our visitor with a different scene within the
movie depending on the location. For example:

http://www.xxx.com/links.asp?cat=52&Dest=Malta

Would load a scene with a backround picture of Malta

http://www.xxx.com/links.asp?cat=44&Dest=Greece

Would load a scene with a backround picture of Greece

The image file is located in the root and is called greece.jpg

If no picture is found then a default picture is displayed.

In/Out Query String
I am working on parsing a query string from an html doc to flash. It comes into flash but won't come back out to the link I have. I don't know if what I'm trying to do is possible or if I need to use another method. I can't server side .

Thank you

here are the files : http://www.joshspoon.com/js_queryString.rar

Get A URL Query String ID
Is it possible to request a url query string ID in flash mx?

Query String With %D8
Dear everybody

I have changed from Flash 5 to Flash MX. In Flash 5 it was possible to call a flash movie with a query string containing the danish letters ć, ř and ĺ, which all have numbers beyond 127.

The same query strings write nonsense in my flash movie text fields.

I have also tried to use FlashVars as documented on

http://www.macromedia.com/flash/ts/...s/flashvars.htm

but it gives the same error.

Have I forgotten something? How can I transfer letters like %D8 to the flash 6 player?

Torben

Pulling From A Query String
alright I've fidgured some things out and this is what I am currently doing.

I am attempting to load variables placed into the query sting (url) into a dynamic text field with the same variable name. Currently it is effecting the variable but it is not putting the values into the text field
Here is my code:

loadVariablesNum ("void", 0, "POST");
to = "0";
from = "0";

I have attempted sending the variables using "GET" as well as "Don't send" with the same results

the page is
http://www.familyties.com/dogDaystes...=josh&from=bob

If you remove the "to" and "from" on the query string the default value of "0" appears in each variable

What am I doing wrong?

Sending Query String To ASP
I've tried to send a query string to an ASP page using loadVariablesNum as belows:

loadVariablesNum ("http://www.domain.com/test.asp?type=1", 0, "GET");

But, I can only see that Request("type") from ASP return null value. What's is the problem?

Thank you for your help.

Sending Query String
Hi all!!

I am using Flash 5.. doing a CD presentation in flash projector or exe..

on click of a link I want to send a query string:

pagename.html?Firstname=Joe

but when it opens the page I am not getting "?Firstname=Joe" in the addressbar of the browser..

pls help..

Load Swf Into Swf (specifying In Query String)
Hi I have the following problem (I am not too experiences with flash AS, but trying to learn).

Basically I have the following model:

player.swf (interface that looks like winamp for instance)
song01.swf (swf with imported mp3)

What ends up happening is song01.swf is loaded into player swf. The way it works right now is I have to hardcode the name of the song to load into each player.swf. But what I'd like to do is to specity which song I want to add in a query string and player.swf will pick it up. For instance:

www.mysite.dom/player.php?song=song01.swf

then player.swf in player.php will pick up the variable song01.swf and laod it into itself.

Can anyone give a quick hint? Thanks much guys.

And lastly, I am doing it all in Flash 5.

Vladislav Kulchitski

GetURL With Query String And Asp
kay. i've got a variable in my asp page keeping track of user preferences. i'm making a link graphic in flash 5 that needs to grab this variable, and redirect to another page within the site... so, in plain jane asp, the link goes:

response.write "<a href=""description.asp?" & strQSMin & "&pid=90210"">"

easy enough, but when i try the matching string in actionscript:

on (release) {
getURL ("description.asp" & strQSMin & "&pid=90210", "", "GET");
}

it's a no go...
i've tried a dozen variations here, none of which have resolved anything.

any hints as to what's up here?

cheers
staceass

Query String In Flash
I have a dynamic text field and the variable name for it is "name". I want to change this text field using query string.

I have two pages.
1) Where there is a link to the flash page called "Click here"

2) The second page is flash html page and the name of the page is "hello.html".

Both the files are in the same folder and I am using the following code as a hyperlink with "Click here".

<a href="hello.html?name=John">Click here</a>

I want the name field to print "John" but it does not work.

Please help

Read The Query String
Is there any way to read the querystring? or if not is there a way to pass it in to the movie using asp?

Query String Into Flash?
Friends ..

I m really having difficulty in retrieving a querysting into flash ... i've searched through the forum n found links at the bottom, related to my problem .. well i need to load one querystring from a few into Flash e.g:

http ~~~com?flashvar=value?othervar=value

i want this (flashvar=1) value to goto different scene if the value is 1 then
gotoAndPlay("scene1",1); if (flashvar=2) so on .... !! I need the flash code from which i can get this value ... kinldy compile my request ... n gimme no error zero warning .. ... i m requesting this thread again, i haven't got any reply from the last one ..... thanks a lot .. the links r these !!



http://www.permadi.com/tutorial/fla...ring/index.html
http://www.actionscript.org/forums/...ed=1#post285398
http://www.actionscript.org/forums/...03&page=2&pp=15
http://www.actionscript.org/forums/...ead.php3?t=2219
http://www.actionscript.org/forums/...ead.php3?t=2946
http://www.macromedia.com/support/f...local_query.htm




have a nice time ...

My Query String Function
In case anyone was interested, here's a query-string routine I wrote that may be of some use to people. It works just like __GET(tolken) in PHP or Request.QueryString(tolken) in ASP. Just call queryString(tolken) where you want the value of a string you passed to the .swf file in URL. For example: ...src="mymovie.swf?valA=hi&valB=there"
queryString("valA") will return 'hi' and queryString("valB") will return 'there'
Below is the function definition. Just slap it wherever, the function is defined on the global scope.


Code:
_global.queryString = function(tolken) {
// Written by Gus Crawford. No usage restrictions,
// don't have to credit me, be happy and solve problems.
// The entire queryString:
var theQueryString:String = new String();
var theStart:Number = new Number(0);
var theLength:Number = new Number(0);
theQueryString = unescape(_root._url);
theStart = theQueryString.indexOf("?", 0);
theLength = theQueryString.length - theStart;
theQueryString = theQueryString.substr(theStart, theLength);
//_root.out.text = tolken;
// Good, we have the ENTIRE qstring isolated.
// now find our specific tolken
// look for our tolken name preceded by a ? or & symbol.

// look for ?tolken= or &tolken=
var valStart:Number = new Number(0);
var valEnd:Number = new Number(0);
var valLen:Number = new Number(0);

valStart = theQueryString.indexOf("?" + tolken + "=", 0);
if (valStart == -1) {
valStart = theQueryString.indexOf("&" + tolken + "=", 0);
if (valStart == -1) {
return "undef";
}
}
valStart ++;

valEnd = theQueryString.indexOf("&", valStart);
if (valEnd == -1) {
valEnd = theQueryString.length;
}
else {
valEnd --;
}

valLen = (valEnd - valStart) + 1;

var FinalValue:String = new String();
FinalValue = theQueryString.substr(valStart, valLen);

var ChopHere:Number = new Number(0);
var ChopThisLong:Number = new Number(0);

ChopHere = FinalValue.indexOf("=", 0) + 1;
ChopThisLong = (FinalValue.length - ChopHere) + 1;
FinalValue = FinalValue.substr(ChopHere, ChopThisLong);
return FinalValue;
}

Copyright © 2005-08 www.BigResource.com, All rights reserved