How To Get Querystring Into Flash?
I'm trying to make my flash read from the querystring of my website, e.g. http://domain.com/page.asp?q=abc.
I want the querystring abc to appear in the dynamic text field of my flash. This will enable me to change the querystring dynamically.
How should I do that?
Thank you.
FlashKit > Flash Help > Flash MX
Posted on: 01-12-2006, 09:33 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash 6, PHP And The Querystring
I have been using a lot of flash interfaces recently and I was wondering if anyone knew of a way to get Flash to read the querystring rather than use PHP to define the querystring as a variable.
I ask this not just because I am tired of writing $flash_var = $_GET['page'], but because this method gets burdensome when the menus become complex. For example I am currently working on a project with a series of nested menus:
Products
>Category1
>>SubCat1
>>>SubSubCat1
>>>SubSubCat2
>>SubCat2
>Category2
Now if I was using javascript or php to generate my menus I would just reference the querystring for my location so that the Menu is open to appropriate category when I reload the page. However flash, or least the only way I know how to do it, demands that the variable be defined in the page (I guess it can only parse the text file). This seems stupid with all of the dynamic flash sites that are popping up. So if anyone knows a better way, I would be grateful.
--Matt
Querystring Help In Flash
i have a flash file in first frame i have a dynamic text section
now when i call that html file through querystring
suppose http://localhost/movie.html?section=1
the section text shd be 1
pls help me in this
thanks
Querystring Flash To HTML
Please please please help me.
I have created a movie with a set of buttons on, I need to pass a variable via the queystring, I have tried the following;
loadvariableNum("default.asp",this,"POST");
(also tried variations on this)
This, when previewed via Flash, pops up the default.asp WITH the vaiables in the querystring. Great I here you cry, the problem is, when I place the movie WITHIN a HTML papge, then click the button, it goes through to default.asp but with no variables in the querystring.
Anyone explain please ?
Flash Querystring Variables?
I can find 9 bajillion tutorials/articles dealing with sending variable TO a flash movie or between flash movies, but none that go the other way. I am not a flash guiy, but rather and ASP.NET programmer. I need to have 2 textboxes in Flash. When a button (also flash) is clicked, the contents of the textboxes are passed to and ASP.NET page via the query string or even through cookies or any other suggestion that someone might have (not sure if Flash and ASP share sessions or not). Are there any decent tutorials out there that you know of? Any help is appreciated.
Flash-asp-appending Querystring To Swf.
i have a flash-asp application that works inside of a asp-html program. the problem is that i have variables coming from flash and variables that i need from the program the flash app is running in. so i want all the values in one location (flash) which then i'll send them all out to a db.
//here i build a query string for flash to
//recieve the variables
<%
new_url="conf_bars.swf?"
new_url=new_url+"order_id="&request.QueryString("order_id")
new_url=new_url+"&session_id="&request.QueryString("session_id")
new_url=new_url+"&connection_id="&request.QueryString("connection_id")
new_url=new_url+"&question_id="&request.QueryString("question_id")
new_url=new_url+"&ip_number="&request.ServerVariables("REMOTE_ADDR")
new_url=new_url+"&response_num="&request.QueryString("response_num")&"&"
//then call the embedded swf with the new_url
%>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH="400" HEIGHT="400"
id="conf_bars" ALIGN="">
<PARAM NAME=movie VALUE=<%=new_url%>> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src=<%=new_url%> quality=high bgcolor=#FFFFFF WIDTH="400" HEIGHT="400" NAME="conf_bars" ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
//this is a view-source piece, it has everything i want.
<PARAM NAME=movie VALUE=conf_bars.swf?order_id=1&session_id=445&connection_id=944862780&question_id=1049&ip_number=111.1.1&response_num=1&>
i'm not getting any of the values in flash from the querystring, the only one i get is the ip_number which i'm requesting ServerVariables. another thing is that if i put dummy variables in like; &order_id=blah" flash will pick up the blah. thanks for any help.
Appending A Querystring In Flash
Greetings GrandMaster Flash types,
I'm trying to build a little "Download Cart" in my Flash app. I want for the user to be able to download multiple .docs (up to 5) at once. The final url will be passed to my ASP page. The files will be dynamically zipped and provided for download. Essentially I need to Flash to:
1. Keep track of the total downloads (1-5) and then
2. Pass the file name as a variable to append the final url
3. Construct the URL using the necessary "?" and "&"
The outgoing URL will be something like
cart_process.asp?total_files=2&file1=instruct.doc&file2=instruct2.pdf
Any ideas?
J
Email Querystring Variable To Use In Flash - How?
I want to email a list of people a querystring such as
http://www.suchandsuch.com/email.swf?fname=Jen
and use the fname variable in the flash. I can get my flash movie to read the variable from a text file, but I'd rather not go through having the script write a text file for every request.. wondering if this way is doable. I have a url that does this, but can't figure out how it's done. can forward it to anyone who is interested..
Any ideas??
Receving Querystring Into A Flash Movie
I need to have a flash file which takes a querystring or form variable from an asp page and then uses that variable in flash and display it on screen.
Other wise I need to create 30 flash files with the only difference being 1 number from 1 - 30.
[MX04] Querystring Not Sending From Flash
Hello,
I've been pulling my hair out over this problem I'm having and was really hoping that someone might be able to help.
I have some flash nav on an HTML page. When I click a link I go to another page with flash embedded and hopefully load an swf based on a variable I pass through.
The code on the buttons looks like this:
about_btn.onRelease = function() {
var section = 1;
getURL("default.htm?section="+section, "_self", "GET");
};
This however takes me to default.htm rather than default.htm?section=1.
On the default page i have a flash movie with a FlashVars param:
<param name="FlashVars" value="section=section">
What I'm trying to do is get the value of the section variable passed through from the flash query string and then get that into flash.
The flashvars works if I manually put in the value of section so I know that flash is retrieving the variable. What isn't working is the passing of that variable in the querystring from flash and then the HTML getting it.
Does that make sense and if so doesn anyone have any idea how to resolve this?
Many thanks
Matt
Reading Querystring Into FLASH Variable
I can't believe I can't make this work. I've even done this in the past, but everything I try, fails.
i want FLASH to read the querstring value from the address bar, apply that value to a variable, and be able to use it. I've read the articles all over the net about grabbing the QS value in the page that loads the SWF and sticking it into the embed and movie tags as well as the ones about using PARAM=FLASHVARS etc.
can't make it work.
I can grab the QS value in the .asp page that loads the SWF, but I can't for the life of me pass that value into FLASH. Can someone please give me two things:
1. whats the most effective/efficient way to pass the variable
2. the syntax for assigning the value to a variable in FLASH
Thanks tons all!
Accessing An External Querystring For Use In Flash
Hello. I was wondering if there is a way to grab name value pairs from a URL's querystring and set them as variables for use in flash. I have an index page that onLoad opens up a .swf in a new, sized window. I would like to be able to grab a value from the index page and use it in flash to determine weather or not to perform a certain action. Any help would be appreciated. Thanks.
Flash - Posting As A Form Instead Of A Querystring
Hi all, I've got my form posting and everything is great except I'm hitting some kind of upper limit on the length of a querystring and I'm not getting all my data. What I've got now is:
formdata= new loadvars( );
formdata.[Variable]=[Variable];
getURL[[URL], "_self", "GET");
This works fantastic, I need to do exactly the same thing, except I want the data to go to the forms collection instead of the querystring collection.
Does anyone know how I can do that? I'm sure it's a one line change where I'm using getURL, but after playing with some of the other methods, none of them seem to work.
Thanks.
Can Flash Pass Multiple Parameters In A Querystring? - Please Help
Ok, I know that this works with one parameter:
PHP Code:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="249" HEIGHT="249" id="HolidayInvite" ALIGN="">
<PARAM NAME=movie VALUE="http://www.mycompany.com/invites/HolidayInvite.swf[b]?myURL=http://www.mycompany.com/cp/show.asp?id=60426[/b]">
<PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="http://www.mycompany.com/invites/HolidayInvite.swf[b]?myURL=http://www.mycompany.com/cp/show.asp?id=60426[/b]" quality=high wmode=transparent
bgcolor=#FFFFFF WIDTH="249" HEIGHT="249" NAME="HolidayInvite" ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
but why not with two? ie -
?myURL=http://www.mycompany.com/cp/show.asp?id=60426&Name=Test"
The 2nd parameter (name=test) get's removed...
The code in my movie is as follows:
On a button I have:
Code:
on (press){
getURL(myURL);
}
So when the button is pressed, it will call the variable myURL
which is a URL that has 2 parameters...
What am i doing wrong?
Thanks in advance!
Send Querystring To A URL Without Refreshing Flash Page?
I am appending a query string to a URL with the values of some input boxes in my .swf. When I send it, however, the page refreshes.
I'm using a simple getURL like this:
on (release) {
getURL("http://www.theSite.com/servlet/servlet.WebToLead?email="+_root.email.text+"&first _name="+_root.firstName.text+"&last_name="+_root.l astName.text,target="_self", "POST");
Should I be using some other means to do this?
Thanks in advance.
Passing A Querystring Variable To Flash Player
<div id="newxspf">
<script type="text/javascript" src="/FMP3/swfobject.js"></script>
<script type="text/javascript">
<!--
var flashObj = new FlashObject
("/FMP3/XSPF_EV.swf?action=stop&vol=80&playlist=/vacilon/jan2006/jan23-jan28/fri/playlist.xml&folder=/FMP3/&textcolor=&color=&loop=playlist&lma=yes&viewinfo=false&display= 1@. - @0@ - @","newxspf", "265", "225", 7, "#800000", true);
flashObj.write ("newxspf");
// -->
</script>
</div>
The code above is the Javascript I use to display the XSPF Flash Player on my web page. It works fine. The problem is, I have several playlists that I want to load to the player depending on the link the user clicks. So, what I want to do is add variables to the playlist part of the code:
("/FMP3/XSPF_EV.swf?action=stop&vol=80&playlist=/vacilon/jan2006/jan23-jan28/fri/playlist.xml....
So instead of having /vacilon/jan2006/jan23-jan28/fri/playlist.xml
I want to have something like /vacilon/&month&/&week&/&day&/playlist.xml
...where month, week and day are variables.
I tried using FlashVars but if I take the "playlist" parameter outside that parenthesis, the player won't load. For instance, if I add this line below the var flashObj line:
flashObj.addParam("playlist", "/vacilon/jan2006/jan23-jan28/fri/playlist.xml")
I also tried addVariable in the same way and the player doesn't load:
flashObj.addVariable("playlist", getQueryParamValue("playlist"))
The only way the player loads is when the playlist parameter is included in the same line with the rest of the other parameters action, vol, folder, etc. I want to know if it is possible to take the playlist out of there or if not, I would like to know if there is a way to add a variable into the line itself. So far, my attempts to add a variable only result in the player not loading. The player loads and plays fine once I make the code look like posted above.
Thanks
Getting Querystring
I want to get a variable out of a query string from an html page that launches a pop-up html window that contains the .swf
The .swf is in the html pop-up, so how do I get the variables without targeting the query string?
Querystring
how can i post query string or some vlues to url, like in html
<a href productdisplay.asp?table=products>
[Edited by ahmedsoliman on 07-29-2002 at 02:01 PM]
Querystring / Get
is it possible in flash to get a querystring of some sort? If I have the following link www.jaga.be/adresses?lang=1&count=4
Now i would like to put the lang Id into a text filed on the stage.
so I would like to get the 1 out of the link.
Is it possible by a get or so?
Querystring
I have a couple of .swf files in my site that link to other parts of my site. I also have a querystring argument called GUID that holds the users sessionid. How can I get the .swf to read the querystring and append it to the URL I have in the click event?
Querystring
I have a couple of .swf files in my site that link to other parts of my site. I also have a querystring argument called GUID that holds the users sessionid. How can I get the .swf to read the querystring and append it to the URL I have in the click event?
Querystring? Help
Hi,
I am creating a data capture form in flash.
It is to have 4 fields, name, address etc
The 4th field is to be hidden but I need to load a variable in to it from the html src code.
The html looks like this
......... <EMBED src="SPG.swf?id=23"
I need to load in the figure '23' into a hidden field in flash.
Please offer any advice
Thanks
Querystring Help
hi i am new to flash and i would like to recive a querystring into the flash file but have no idea how to do this in flash
example
http://www.domain.com/play.swf?id=123456
i then need the flash file to recieve that querystring into a string in the action script
can anyone help
thanks
dan
Querystring
hi does anyone know to to request a querysting in action script
thanks
dan
Querystring Variables
How can i pass a querystring variable into my flash movie?
I have a simple quizz that is loading the Q and A from a DB and right now I have the quizz ID hard coded into the page.
In flash I am loading my Q&A like this
stop ();
loadURL = "http://www.mysite.com/trivia/get_content.asp";
I have the url to the game http://www.mysite.com/trivia/index.asp?QID=5
how can I make my flash ur look like
loadURL = "http://www.mysite.com/trivia/get_content.asp?QID=querystringvar";
Multiple ?s In Querystring
Is there a way to encode the ? so it doesnt mess with the variables when being passed to a swf via the ?etc=blah method.
I need to pass a string like
"/vinyl/asp?SortBy=Label&genre=HARD+HOUSE&PageNum=2" as a single variable into a flash movie. but due to ?s and & symbols its only getting "/vinyl/asp?SortBy=Label" the rest is getting treated as additional variables, Anyone know a way around this?
Ive tried sending it in as a ASP Server.URLEncoded() but it dont seem to make any difference. Flas just encodes the ? back and rips the string apart.
Please or im gonna have to rebuild a complex movie from scratch.
Kristian
Querystring To Swf Via Html
Hi everyone
I'd like to receive a variable in flash that will be passed in the url as a querystring.
so we have the url: myfile.html?myvar="hello"
or other syntax (I don't know)
myfile.html is opening myfile2.html and that one is loading the mymovie.swf where I want to receive the variable myvar filled with "hello"
any idea ?
looking very much forward to your light
Loading Querystring In F5
I have a client that needs a flash intro that will be accessed through a link in an email campaign. When the user clicks the link in their email, it sends them to this flash intro, but also sends a querystring with it. I need the flash file (v5) to read the querystring, use it during the movie, and then pass it on to an asp page when the intro is done playing.
What is the best method to do this?
Thanks,
Dan
Max Length Querystring
I've made a flah movie that loads some variables from a querystring (moviename.swf?query=string). In FireFox this works perfectly, but in Internet Explorer it doesn't. It begins loading the page and doesn't show the movie at all.
Is there a maximum length for a querystring in Internet Explorer?
FYI, my querystring is about 1700 characters long.
Reading URL Querystring
Please help me
I have been working on this issue for an embarrassing amount of time.
I am trying to figure out how to get flash to read parameters that are passed through a url as a query string.
For example, I may send an email to a client with a link such as:
<a href="http://www.yourdomian.com?id=20034"> so that they can view a particular product on my flash website.
When the user clicks the link, the url is correctly displaying the querystring above. But, I cannot get the flash file to get the parameter.
What code do I need to put into flash in order to be able to capture the id=20034 ?
Please save me
Loadvars Querystring
I want to put a link in my JSP file to open a popup containing my swf file.
the link in the jsp is help.html?xmlfilename=wizcontrol_en
and then to parse the variable - xmlfilename
helpContents.load(xmlfilename + ".xml");
the question is how do I get the xmlfilename from the jsp link to the load xml method?
[fmx] Request Var Querystring
want to put a link in webpage to open a popup containing my swf file.
the link in the html is help.html?xmlfilename=wizcontrol_en
and then to parse the variable - xmlfilename
helpContents.load(xmlfilename + ".xml");
the question is how do I get the xmlfilename from the link to the load xml method?
Is There Any Way To Catch Querystring In .swf
I want to get url querystring value in the .swf file. Suppose when mypage.html?itemname=xyz is requested, flash file should automatically catch "xyz" and display it.
Thanks & Regards,
Netfunda
GoToFrame And ASP QueryString
I built a flash file (Flash 5, ASP 3.0, SQL Server) that allows users to search for our clients by company name. I have the results come back and display all matching company names in a dynamic text box. This part is working correctly.
What I want to do is allow the users to click on a given company name in that inital resultset, requery the database and bring back detailed client information for the respective company name chosen.
When I do this in just straight ASP coding, usually I wrap a link around a company name, build the company id into a querystring and pass back the resultset. Then the user clicks on a company name and they see the corresponding info. I am not sure how to do this in flash.
If someone could point me in the right direction, I would be most appreciative.
Request QueryString
How do I request variables from a query string in flash? For example if I had the URL http://www.whatever.com?name=Harry How can I retrieve the value Harry and assign it to the text property of a TextField?
[fmx] Request Var Querystring
want to put a link in webpage to open a popup containing my swf file.
the link in the html is help.html?xmlfilename=wizcontrol_en
and then to parse the variable - xmlfilename
helpContents.load(xmlfilename + ".xml");
the question is how do I get the xmlfilename from the link to the load xml method?
Variables From Querystring
Hi,
Either my web searching skills are very questionable or this is a rarely asked question...
How do you get variables from the querystring in Flash?
I've got a flash form that posts back to itself adding ?mode=done to the querystring if valid. A datacapture asp script looks at the mode value to get the posted flash variables, but I also want the flash form to check for mode=done so it can display a thankyou message...
Any help would be great.
QueryString Question
Hi all!
For some strage reason i open my page...
mypage.asp?category=info
then within mypage.asp i do this in the flash code...
Navigation.swf?category=<%=Request.QueryString("category")%>
Flash DOES read the variable! displays it in a dynamic box....
BUT!
mybox.text = _root.category;
if (_root.category == "info" ) {
gotoAndPlay(2);
}
It Freezes my movie?! (I do have frames ) Just everything completely freezes... but i can still highlight the text in the dynamic box.
anyone know why?
Querystring... Urgent
Hey!
Anyone who can give me help with this one..
I´m loading in an XML-file through a variable in SWFObject.
In flash I have
ActionScript Code:
var str:String = _root.XMLFile;
xml.load = str;
(of course there are more code than that )
in my html
Code:
<script type="text/javascript">
//<![CDATA[
var so = new SWFObject("snodd.swf", "snodd", "960", "210", "9", "#FFFFFF");
so.addVariable("XMLFile", "http://www.myurl.com/ListToXML.aspx?ListTitle=FlashImages&ProductArea=AR");
so.addVariable("slideINT", "0.5");
so.addVariable("slideSPEED", "8");
so.addVariable("startTIME", "1500");
so.write("flashcontent");
// ]]>
</script>
It all works fine if I just have:
Code:
so.addVariable("XMLFile", "http://www.myurl.com/ListToXML.aspx?ListTitle=FlashImages");
but when I add another I can´t get it to work.
like this:
Code:
so.addVariable("XMLFile", "http://www.myurl.com/ListToXML.aspx?ListTitle=FlashImages&ProductArea=AR");
Any ideas?
What can I do?`
Thanks
/Pierre
Using Variables From QueryString
what is the best way (if any) to pass a variable from a url querystring into a flash movie?
for instance, if i call the page news.asp?id=15 then it will load the news movie with the article relating to id:15.
Getting Variable From Swf Querystring
'lo,
I have this code to retreive to check for the variable 'pag'..
-----
if (pag=="sonidos") {
loadMovieNum("sonidos.swf", 1);
} else {
}
------
It's sent from this page when you click on a button in the querystring:
-----
on (release) {
loadMovieNum("enter_backpage.swf?var=sonidos", 0);
}
---
the second page isnt picking up the variable, how do i retrieve it?
Thanks.
How Can I Escape An & Character In A Querystring
I am using Flash in conjunction with PERL to get data from a MySQL database, and have run into one little problem... some of the data I need to send to flash contains a & in the field. Is there an accepted way to escape it so flash doesn't break the string in the wrong place, or should I convert it to something else and change it back when it gets to flash? Any help would be appreciated
Sending Data In Querystring
Hi all,
I'm making a calendar with php/mysql backend - it loads data re events using the xml object and I've been trying to stick to one function that loads the xml and sends requests to insert/update/delete in the querystring too - this works for delete and null (just do a select query) but not insert or update:
Code:
function doXML(arg,queryString) {
if (!myXML) {
usersXML = new XML();
usersXML.onLoad = usersHandleLoad;
usersXML.load("security.php?action=users");
myXML = new XML();
myXML.onLoad = handleLoad;
SearchResults = new XML();
searchResults.onLoad = searchResultsHandleLoad;
}
if (objectHolder) _root.objectHolder.removeMovieClip();//remove clip containing data objects if there is one
_root.attachMovie("holder","objectHolder",topDepth);
topDepth++;
if (resultsHolder) resultsHolder.removeMovieClip();
_root.attachMovie("holder","resultsHolder",topDepth);
topDepth++;
setDateVars();
var theURL = "action.php?action="+arg+"&startMonth="+phpStartMonth+"&endMonth="+phpEndMonth+queryString;
var altURL = "loader.php?action="+arg+"&startMonth="+phpStartMonth+"&endMonth="+phpEndMonth+queryString;
arg == "search" ? searchResults.load(theURL) : myXML.load(theURL);
}
Seeing as this doesn't work I've tried other ways, like using loadVariables with the POST action to send the inser request and used xml only to receive events, but I can't make that work either. I know my php works though because if I send it in a getURL it works fine. (This needs to be in the background though).
Thx for reading this - any ideas??
Pop Us Using Javascript & Send Querystring...
Hi,
I am trying to have a button in my flash movie that when clicked will open a pop up window that contains a form. I also need to send a value to the pop up window via QueryString. Here is the script I have attempted, but it doesn't work:
on (release) {
getURL ("javascript:window.open('./events/rsvp.asp?meeting=Sept11','RsvpWindow','toolbar=no, location=no,directories=no,status=no,menubar=no,sc rollbars=no,resizable=no,width=400,height=400,left =110,top=10');", "_blank", "GET");
}
When the button is released a window opens up with
[object]
showing. Then the popup window opens right after that, but it is blank.
I am obviously doing something wrong. Can someone help me out with this please.
Thanks a lot,
rplmri
Loading Variables From QueryString
I haven't used flash for a couple of years as I have been concentrating on ASP. However I now have the need to merge the two and today have plunged into MX. What a change since flash 4!
I have figured out how to forward variables through the GET method on the querystring but how do I read them back in? I have looked at the dictionary which shows:
loadVariables ("url" ,level/"target" [, variables])
but the level/"target" is confusing me.
If I have a variable such as page=hbg I want to read the variable in then on the first from do an if then statement to forward to a particular frame. I just can't read the variable in. How do I format the load Variables for this particular statement? Am I using the correct action to pull the variables in?
Is there a good book that anyone can recommend that details more on ActionScripting?
Querystring=a Movie Clip, How?
I am very new to the actionscript and need to basically do something like this.
Set var = pageid
set var = movieclipname
pageid = request.querystring.("name")
swapimagerestore = movieclipname
startimage = movieclip name
I don't know how to change a specific object according to a querystring.
Any help would be welcome. Thanks
|