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




Receiving All But One Querystring Variable



Hi. I have a flash 8 movie that is getting passed these vars:

MYURL.swf?bandid=7&instanceid=ea897df58655977f988a a8a7e70ddfd2&cur_instanceid=9ae6787d0a29af22c1206e dd111fb391&affiliateid=0&autoplay=1

All the vars are being received by Flash except for cur_instanceid. I thought maybe the underscore was causing the problem (though underscores are legal in variable names), so I changed the var to currentid. But no matter what I do, that var has a value of undefined. The ones before and after it are fine.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 11-17-2006, 03:52 PM


View Complete Forum Thread with Replies

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

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.

I Want To Load A Variable From Querystring To A MC
I'm using flash with ASP. I can get a url variable using Request.querystring("variable")... but I don't know how can I load it into flash...

If someone knows how please...reply

Receiving ASP Variable
Hi, my name is Dave Birch. I'm working on a flash training website which consists of a series of html pages with flash embedded. We are trying to save where the user is in progress by using ASP. The idea is that flash interacts with ASP, with a "Continue where I left off" function that will take you back to the flash slide you were on in your last session. Flash will also update your current frame and html number. We've created a variable "lastPage.asp" which holds a series of numbers concatonated with a ",". The format is this. "htmlNumber,frameNumber".

The problem I am running into is that although my document is sending out the updated variable to lastPage.asp it isn't receiving the lastPage.asp when you click continue where I left off.

I have this code in the first frame of my movie. Pretty simple. I am attempting to check and make sure the variable is loaded first of all, and then to check that the current htmlNumber equals the htmlNumber in lastPage.asp. If not, it should go to the first frame. Finally, if current htmlNumber is correct it should gotoAndStop(frameNumber).

Is my code correct. Please help. I am at a loss for why this is not working.

Thanks

Dave Birch

---actionscript code follows---


Code:
lv = new LoadVars();
lv.load("lastPage.asp");
lv.onLoad = function(success){
if(success){
trace("Variables Loaded");
if(lastPage.substr(0,1) == "2"){
var frame=parseInt(this.lastPage.substr(2,3));
_root.compaccountmc.gotoAndStop(frame);
}
}
else
{
trace("Error loading variables");
}
};

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??

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!

Variable Sending And Receiving With Php
how do i send a variable to a php script and then have the php script send a variable to flash i'm hoping to make a user account thing with flash and php

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

[F8] Receiving New External Variable. No Refresh
Hi,

My english is not perfect so I hope I can make myself clear...

My question is whether or not Flash can receive a new or updated value of an externally created variable WITHOUT refreshing the entire html-page?

I'm working on a hybrid-site that has a video-section with several movies, to be shown in the flvplayer component. The name of the file to be played will be send outside of flash and the page must not refresh, according to the boss...

Any help is appreciated!

Receiving A Variable Passed Via HTML In AS3.0
my HTML is sending a variable called "username" to my flash.
how can I receive it in flash?

i tried like below.

in HTML

Code:
<param name="flashvars" value="username = MYNAME" />

in FLASH

Code:
var username:String;
var value:String;
var obj:Object=LoaderInfo(root.loaderInfo).parameters;
username = String(obj[value]);
thank you.

Sending/receiving Variable To Javascript
This may be in the wrong thread, not sure.

I have a frameset set up with two frames, top and main. I have a movie in the main frame that needs to send a variable to the top frame when a button is clicked. Then when I load a new movie into the main frame I need it to read the variable from the top frame.

I think I have to use fsCommand to send and receive the variable, but I'm not sure how to do it. Searching the web I have found how to send it to the same page, but not a seperate frame. Help, please?

Thanks in advance,
rhombusleech

Sendandload Undefined Variable Receiving
output is "error" even i send "hello". what is the problem here?

actionscript

Code:
function dothis() {
sv = new LoadVars();
rv = new LoadVars();
sv.v1 = "hello";
sv.sendAndLoad("newsletter.php", rv);
rv.onLoad = function(obj) {
trace(rv.var1);
};
}


php

Code:
$var1=$_POST["v1"];
if($var1=="hello") echo "&var1=ok&"; else echo "&var1=error&";

Receiving A Variable Passed Via HTML In AS3.0
my HTML is sending a variable called "username" to my flash.
how can I receive it in flash?

i tried like below.

in HTML

Code:
<param name="flashvars" value="username = MYNAME" />

in FLASH

Code:
var username:String;
var value:String;
var obj:Object=LoaderInfo(root.loaderInfo).parameters;
username = String(obj[value]);
thank you.

Sending/receiving Variable To Javascript
This may be in the wrong thread, not sure.

I have a frameset set up with two frames, top and main. I have a movie in the main frame that needs to send a variable to the top frame when a button is clicked. Then when I load a new movie into the main frame I need it to read the variable from the top frame.

I think I have to use fsCommand to send and receive the variable, but I'm not sure how to do it. Searching the web I have found how to send it to the same page, but not a seperate frame. Help, please?

Thanks in advance,
rhombusleech

Receiving A Variable Passed Via HTML In AS3.0
my HTML is sending a variable called "username" to my flash.
how can I receive it in flash?

i tried like below.

in HTML

Code:
<param name="flashvars" value="username = MYNAME" />

in FLASH

Code:
var username:String;
var value:String;
var obj:Object=LoaderInfo(root.loaderInfo).parameters;
username = String(obj[value]);
thank you.

Passing Querystring Variable Using Activex Bypass Scripts
I have been using menu systems with carats that position themselves according to variables passed in the URL string. This setup uses JS to parse to the variables and include them in a script that writes the Flash code in the HTML doc. With the advent of MS wonderful activex control, I need to figure out how to incorporate variable that are parsed into that AC_FL_RunContent() function.

If anyone knows what I mean and has some solution, I would be very thankful.

Receiving Variable Actions Over State Of Button
Hi - I am receiving a variable into an animated flash floorplan. The variable reflects the room name on the floor plan. I am successfully receiving the variable but need to show the room in a hover state (i.e. button over) when flash loads - does anyone know how I can do this. Sorry I am still trying hard to learn flash - so this may seem simple to all the experts.

I'm Having Trouble Receiving A Variable Back From My Php Script Using SaveAndLoad
Here is the action script in flash MX that im using

function doSubmit(){
sendData = new LoadVars();
recData = new LoadVars();
sendData.name = name;
sendData.species = species;
sendData.speciesType = speciesType.getValue();
sendData.residence = residence.getValue();
recData.onLoad = getResponse();
sendData.sendAndLoad("register.php", recData, "post");

}
function getResponse(result){
if (result == true) {

field.text = "test";
}
else
{
field.text = "Error loading file.";
}
};

And here is the PHP script i'm using
<?
$name = $_POST['name'];
$species = $_POST['species'];
$speciesType = $_POST['speciesType'];
$residence = $_POST['residence'];
$connection = mysql_connect("localhost", "root", "") or die ("unable to connect!");
mysql_select_db ("test") or die ("unable to select database!");
$query = "INSERT INTO aliens (name, species, speciesType, residence) Values ('$name','$species','$speciesType','$residence')"; $result = mysql_query($query) or die ("error in query: ". mysql_error());
mysql_close($connection);

$field="success";
echo "field=".$field;

?>

I am able to send data to the database but the script does not send back the variable data "success" any suggestions?

I have 2 input fields on my form, one drop down and 2 radio buttons, a dynamic text field and a Butto.

the data from the input fields, the drop down and tyhe radio buttons all get to the database, this part is working great.

The dynamic text field shows the data from the error loading variable "Error Loading file".

When it should have picked up the variable from the php variable and show the word "Success"

Does anyone know why it send my data to the database and won't return the variable from php?

Local Connection Question - 2 Swfs Sending/receiving Same Variable?
All of the tutorials I have found re: local connections seem to outline 1 swf sending info & the other swf receiving.
Is it possible to have two swfs using exactly the same action script for their variables to effect each other?

I've got two swfs with 2 different sets of buttons who react the same way on roll over. Once a button is selected it remains highlighted.

I want to know if I can have a button in swf 1 highlighted but un-highlight when a button in swf 2 is selected?

Anyone done this before?
Where do I start?

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 In Flash?
how do associate a url to a button from a querystring?

tks for your time

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

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

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.

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.

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

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.

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

Calling A Querystring Into Flash?
any ideas how this is done.....
I wanna take a querystring that is in the url and pull it into flash......

Thanks in advance

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??

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