Please Help Me With Passed Variables In GetURL Address
Hello, I haven't asked anything here in a looong time so I hope you'll be kind with me because I really don't know how to go about this...
I am building a multi-lingual PHP website with Flash menus.
I know how to DISPLAY a variable within a Flash movie that is passed to the movie in the url (ie "movie.swf?var=value" or "movie.swf?var=$phpvar") but I don't know how to use that variable... In other words, if I wanted to DISPLAY that particular variable within Flash MX I would simply create a text dynamic field and enter the name of the variable (var) in the Var property field of the dynamic text field. When loaded the movie will display the word "value" in the first example or whatever is stored in the $phpvar variable. My problem is: how do I use the variable's value in an URL???
Here is my situation. When on an english page I am calling my movie like this:
movie.swf?l=en
This should tell my menu to change all the menu's link to english links, which would mean adding ?l=en after all of them.
So now I am in Flash MX and I have to create link with getURL. What is the value of the URL field? How to I use the variable I sent to my movie within that field? That is my question basically...
I know that in PHP I would simply do this: echo '<a href="link.php?l='.$l.'">link</a>'; but how do I do it in Flash???
I hope somebody is nice enough to give me the solution!
FlashKit > Flash Help > Flash General Help
Posted on: 03-04-2003, 09:00 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading Variables Passed By GetURL?
Seen this?
getURL("http://www.someurl.com/somepage.htm", _top, "GET");
The URL on your next browser window will be:
eg: http://www.someurl.com/somepage.htm?input=1
How do I get a .swf to read the variable input?????
All examples that I have seen online give me laodVars() or loadVariables() which use text files for input.
I need a string on my browser as input!
Any ideas?
Movie Clip Variables Not Passed With GetUrl Action.......
Hey all.
I've got a simple Flash form with which I'd like to pass the form field
values in a Url String to my test output page. Here's the problem:
The hidden variables and the external text file variables that I set in
frame 1 of the main timeline get passed along fine with the GetUrl action.
However, the variables set in the 5 movie clips (the main timeline, by the
way, only has one frame with a stop action) are not getting passed with the
GetUrl action.
Now, how do I pass the variables set in the movie clips? It seems that since
there's a stop action in frame 1 of the main timeline, the user's clicking
the submit button (i.e. triggering the GetUrl action) is only passing the
variables I set in frame 1 of the main timeline.........
Any ideas? I can't find Jack in MM's tech notes, or the Action Script
reference guide. Thanks for any clues,
--Noah
Variables Passed In GetURL In Flash Not Recognized By MySQL Query
If I type this in the URL: “page1.php?var1=shop&var2=sports”, the page loads with the correct data, etc. The MySQL query finds the record matching “shop” and “sports”, sends stuff to PHP, PHP sends stuff to the Flash movie inside the HTML page, and everything shows up correctly.
However, if I put the same URL in a getURL inside a Flash movie in another HTML page, the MySQL query returns a 0 result. I’ve tested the length of the string of the variable “var1” when it comes through on the PHP side. It’s correct, and the variable displays correctly in PHP, but the MySQL query still returns a 0 result.
Is there something funny that happens to this variable in the URL? – or between Flash and the URL?
Flash movies use the UTF-8 character set. Is it necessary to change the characterset in all the HTML files for this site to UTF-8? (That might also have some other unwanted effects?)
Open No Address/scroll Popup With A Passed Variable...
I was able to fix my login problem... but i am trying to open the window with no scroll bars or address bar
im having some issues with the proper script to pass the variables and load it in the featureless window
here is the code on the submit button...
Code:
on (release){
this.username = this.username.text;
this.password = this.password.text;
getURL("clients/redirect.php", "_blank", "POST");
}
can anyone help? i am at a COMPLETE loss
Opening Pop Up Windows With A Variable Passed To GetURL
Hi,
I have a flash movie that opens separate pages with a url defined by the variable url:
the code looks like:
url="http://www.mydomain.com/"+var1+"/"+var2
getURL(javascriptpenNewWindow(url,'winname','hei ght=408,width=800,left=0,top=0,toolbar=No,location =No,scrollbars=No,status=No,resizable=No,fullscree n=No')
in the html file I have the openNewWindow function defined by:
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
my question is - it doesnt work, but it does if I hardcode the url instead of using the variable. Can anyone help?
thanks
Kevin
Trying To Use UNC Or IP Address In GetURL
I am trying to write a small little network diagram application. Nothing fancy, just an overview of my office. Each computer represented by an icon. If you mouse over the icon it gives you the user, computer name, and IP address. If you release, it will take you the machine.
I want to use the computers UNC names (\server or \workstation), but it will not go through. So I tried the IP address, that didn't work either.
Any thoughts?
Thanks
Whopula
Help With Variables Passed From URL
I am opening my flash movie and attempting to send variables into it by calling the following from my HTML:
moviename.swf?var1=1&var2=1
2 potentially stupid questions:
1. Does this work?
2. Once the variables are loaded, do they stay in the movie when you switch scenes.
Thanks for any help.
Greta
How To Use Variables Passed From PHP
Hi I use the following to get variables from a php script which generates something like this
&load1=http://www.domain.com/images/image1.jpg
&load2=http://www.domain.com/images/image2.jpg
&load3=http://www.domain.com/images/image3.jpg
&load4=http://www.domain.com/images/image4.jpg
I can display these variables in a textbox by setting the var=load1 and so forth. But if I want to use the variable load1 inside a
loadMovie(load1);
this has been simplified! I have tried to type in the exact URL to the image which then shows the image in my FLASH movie. But when I enter my variable i.e. load1, it doesnt sho the image???
Pls Help,
Thanks, Mads Andersen
Variables Not Being Passed
I am trying to use the tutorial on this site to create a simple form submission to my database via ASP. I couldn't open the sample - I am on MX. But I followed the steps on the webpage.
My variables are not being passed. All of the Response.Write statements in my ASP page are coming up blank.
So I have the 3 input text fields. I specified each with the same variable name as used in the tutorial (fname, lname, email, message). I also used those same names as the instance names but that didn't help so I've deleted it. So currently there are no instance names, just variable names.
And then there is a submit button with the code from the tutorial:
on(press){
getURL("http://mysite.com/processForm.asp",0,"post");
}
Thats all that is in the movie.
The ASP page comes up, and the database submission completes, but all the variables and database fields are blank.
Variables Not Being Passed
I am trying to use the tutorial on this site to create a simple form submission to my database via ASP. I couldn't open the sample - I am on MX. But I followed the steps on the webpage.
My variables are not being passed. All of the Response.Write statements in my ASP page are coming up blank.
So I have the 3 input text fields. I specified each with the same variable name as used in the tutorial (fname, lname, email, message). I also used those same names as the instance names but that didn't help so I've deleted it. So currently there are no instance names, just variable names.
And then there is a submit button with the code from the tutorial:
on(press){
getURL("http://mysite.com/processForm.asp",0,"post");
}
Thats all that is in the movie.
The ASP page comes up, and the database submission completes, but all the variables and database fields are blank.
How To Use Email Address From .xml In GetURL Action?
Hi,
I am working on transforming a gallery into an XML-loaded one which is working very well thanks to all the tutorials and posts here at Kirupas!
However, if I want to make this gallery-site completely updatable through the .xml document(s) it seems I need to be able to put in an emailaddress coming from the .xml into a getURL-action. Is this possible?
If I import the email address from a .txt file with newLoadVars I can make the text htmlText and in that way make it a link. It doesn't seem to work with xml.
I have made the address into <![CDATA[[> but it doesn't work.
My code:
ActionScript Code:
emailMC.email.htmlText = xmlNode0.childNodes[10].firstChild.nodeValue;
and the xml:
Code:
<emailaddress><![CDATA[<a href="mailto:name@myname.com">name@myname.com</a>]]></emailaddress>
The text displays fine but the action doesn't happen.
Netscape And Passed Variables
I am passing variables from the object tag of my movie.
param name=FlashVars value=address=value1&secure=value2
These variables are passed fine in IE but not in Netscape. Has anyone had this problem and if so do you have a solution?
Thanks!!
Variables Not Being Passed To Function
I have a function with a while loop that uses the i and j to peace together a path and then calls a loadvar() to check if the path exists. The Loadvars() however is not picking up the i and j at all which is starange because it picks up the array "leftpics" which is right above the two.
I know this because in the output window it will trace the correct path to the thumb but mess up because it says j is == to 0. The while loop will trace the correct numbers but the loadVars never Changes, and it never trys to load the original value of j.
Code:
/// set up ghey variables
leftPics = [_root.leftMenu.leftBtn1.leftPic, _root.leftMenu.leftBtn2.leftPic, _root.leftMenu.leftBtn3.leftPic, _root.leftMenu.leftBtn4.leftPic];
i = 3;
j = i + 1;
//// check the thumbs
var fileExists:LoadVars = new LoadVars();
fileExists._parent=this;
fileExists.onLoad = function(success){
//success is true if the file exists, false if it doesnt
if(success)
{
trace("pics/"+_root.theTxt[_root.moveNumber]+j+".jpg");
}else{
_root.leftPics[i]._alpha = 0;
}
}
//// load thumbs in to the buttons on the left \\
_global.loadThePics = function(){
trace("loading the pics");
//_root.leftMenu.leftBtn1.leftPic.loadMovie("pics/Web Design1.jpg");
while(i > -1){
fileExists.load("pics/"+_root.theTxt[_root.moveNumber]+j+".jpg")
trace(i);
trace(j);//initiate the test
j--;
i--;
}
}
Variables Not Being Passed In FireFox?
Hello guys and gals,
I've got a rather odd problem here.
I'm writing a banner ad script, which uses ASP to pull out various variables from a database, and write them to the HTML parameters which call in a container Flash movie.
The Flash movie then loads in the 'bannerRef' swf, and assigns itself the urlString value so that when it's clicked, it goes to the site contained in the database.
Not the best explanation, I know, but I'll try and break it down a bit more:
1) The ASP pulls in 3 arguements - the filename of the banner that the container clip must load; the destination URL of the banner ad; the current page that the user's viewing to add to our stats counter page - and writes them into the HTML of the page.
2) The 'container' movie clip has two mcs inside - one's a blank placeholder which loads in the banner specified in the query string, the other's a button which sits on top of this banner and gets assigned the destination url that's passed over in the querystring.
3) When displaying correctly, all the user sees is the banner that is contained in the database record - the container clip is to all intents and purposes invisible.
The reason I did it this way was because I was fed up of making Flash banners and having to remember to put in the full URL query strings in the Actionscript every time. This way, I figured, I could make just the container and when a banner's needed I can just work on the animation and not worry too much about scripting.
The problem is this: it works fine in Opera and IE, but only the container movie's loaded in FF. The button is there - you get a hand cursor when you mouseover the empty container, and the correct url is passed over - but no external banner gets loaded.
Here's the code that the script outputs:
[HTML]<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="468" height="60" id="bannerAd" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="../pix/banners/banners/bannerAd.swf?bannerRef=test.swf&linkRef=http%3A%2F %2Fwww%2Ediecast%2Dcollector%2Ecom&flashRef=http://wgp.outandaboutlive.co.uk/main/default.asp%3F">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="wmode" value="transparent">
<embed src="../pix/banners/banners/bannerAd.swf?bannerRef=test.swf&linkRef=http%3A%2F %2Fwww%2Ediecast%2Dcollector%2Ecom&flashRef=http://wgp.outandaboutlive.co.uk/main/default.asp%3F" quality="high" bgcolor="#ffffff" width="468" height="60" name="bannerAd" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>
</object>[/HTML]
I know it's probably something in the 'param' text, as normally when FF refuses to load a movie it's a problem with that, but I'm buggered if I can see it.
Any ideas?
Cheers,
-Mike
LoadMovieNum And Variables Passed From Php
k I'm working on a new site which is a confusing mixture of mysql, php, and flash.
This is basically a simplified example of my problem:
"flash1.swf" is the root flash file
"flash2.swf" is the file being loaded into "flash1.swf"
"variable1" is the name of the variable
Basically when I visit a page, I send "variable1" into "flash1.swf" using FlashVars. This assigns "variable1" to the root of "flash1.swf". Now if I load "flash2.swf" into any level of "flash1.swf" I am unable to access "variable1" from "flash2.swf" but I'm not sure why. I've tried loading "flash2.swf" into level0 and level1, no difference and I've tried using _root.variable1, _level0.variable1
Any ideas?
Anomalies In Passed Variables
Hey everybody,
So, yet again, I'm knee deep in an xml based project, and am noticing some interesting weirdness going on when I pass variables between functions.
Basically, I have an XML object which is pulling layout variables, and then those variables are being passed to another XML object which is sourcing some video thumbnails.
And its actually working fine, but only after some tinkering. It seems that the passed variables have to be redifined in some fashion within the scope of the new function.
It might be easier to explain with the code:
function makeGrid(backwidth, thumbHolderX, thumbHolderY, numCols, tSpacing) {
trace(backwidth);
trace(tSpacing);both trace just fine but (See spacing variable below)
var z = 0;
var a = 0;
var thumbwidth = backwidth/numCols;
var thumbheight = 60;
var thumbsPerRow = numCols;
var spacing = tSpacing/1; //unless I do this, the XML object won't recognize the variable (i.e., it won't just take tSpacing as the variable)
trace(thumbsPerRow);
var numthumbs = 6;
_root.createEmptyMovieClip("thumbholder", 7000000);
_root.thumbholder._x = thumbHolderX;
_root.thumbholder._y = thumbHolderY;
var vidXml:XML = new XML();
vidXml.ignoreWhite = true;
vidXml.load("videos.xml");
vidXml.onLoad = function(success) {
var numThumbs = this.firstChild.childNodes.length;
for (i = 0; i<numthumbs; i++) {
var thumb = this.firstChild.childNodes[i].attributes.thumb;
if (z==thumbsPerRow) {
a++;
z = 0;
}
_root.thumbholder.createEmptyMovieClip("thumb"+i, i);
_root.thumbholder["thumb"+i]._x = z* (thumbwidth+spacing);
_root.thumbholder["thumb"+i]._y = a* (thumbheight+spacing);
_root.thumbholder["thumb"+i].loadMovie(thumb);
z++;
trace(a);
_root.thumbholder["thumb"+i].onRelease = function() {
trace("caption"+i);
}
}
}
}//end thumbnails
anyone care to take a crack at explaining this?
Variables Passed Thru HTML
ok, here's another mind-boggler.
I have an HTML page that passes a variable, the easy way.
This is the HTML generated by Flash, to which I've added the part in bold (that is, P1=BARTHEZ, thus passing the variable P1 to flash, whose value is BARTHEZ
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>FOOTBALL TEAM SELECTION</title>
</head>
<body bgcolor="#ffffff">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="960" height="570" id="football_13" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="football_13.swf?P1=BARTHEZ" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="football_13.swf?P1=BARTHEZ" quality="high" bgcolor="#ffffff" width="960" height="570" name="football_13" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
In my flash movie, I have a text field named "player".
In my code, I have
Code:
_root.player.text = P1
When I launch the HTML page, the field is correctly filled with "BARTHEZ" in my flash movie.
Now...
if I code
Code:
_root.player.text = P1
if (P1 == undefined){
_root.gotoAndStop(3)
}
else _root.gotoAndStop(4)
it should work just fine, but I always get to frame 3, even when the player.text displays "BARTHEZ"
Any help or hint would be greatly appreciated...
Get Variables Passed In From Swfobject?
hello
i am passing a variable into my flash movie using swfobject. how do i access the variables once i pass them in?
Code:
<script type="text/javascript">
var so = new SWFObject("movie.swf", "movie", "480", "500", "8", "#FFFFFF");
so.addParam("title", "This is the test title");
so.write("flashcontent");
</script>
i thought in my movie, i could just do
var t:String = title;
but i am getting undefined
thanks for any help!
Variables Not Being Passed From Form...
Hello,
There is a contact form which when submitted is not sending the user input.
Here is the url using the $_GET method (notice there is no value for your_name, your_email and message):
Code:
http://www.camelotandalusians.com/tim/contact.php?server_option=php&recipient=mousel@defend.net&your_name=&your_email=&message=&url%5Fvar=server%5Foption%3Dphp%26recipient%3Dmousel%40defend%2Enet%26your%5Fname%3D%26your%5Femail% 3D%26message%3D
Here is the actionscript that appears to be responsible:
PHP Code:
on(release) {
url_var = "server_option="+_root.server_option+"&recipient="+_root.recipient+"&your_name="+_parent.your_name+"&your_email="+_parent.your_email+"&message="+_parent.message;
getURL("contact."+_root.server_option+"?"+url_var, "_blank", "GET");
_parent.your_name = "";
_parent.your_email = "";
_parent.message = "";
}
I'm helping a friend to get this working yet I know virtually nothing about flash. Could someone give me some advise? Or, if someone could fix this I'm sure she'd be willing to pay for some help.
Thanks,
Tim
Using PHP Variables Passed By URL Into Flash
I have a problem with getting my php variables from the page to the swf movie.
I have a phone number which I want to get into the flash and can't hardcode because it varies but I keep getting "undefined". In HTML I have:
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="(URL address blocked: See forum rules)=9,0,0,0" name="needle" width="960" height="195" align="middle" id="needle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="needle.swf<?php echo "?phone=$phone"; ?>" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#121536" /><embed src="needle.swf<?php echo "?phone=$phone"; ?>" menu="false" quality="high" bgcolor="#121536" width="960" height="195" name="needle" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="(URL address blocked: See forum rules)" />
</object>
In flash I have a dynamic text box: Instance name: "display_box", Var: "display_phone"
First frame of timeline, though I also tried it a few frames later, I have: display_phone = phone;
If I set the variable in flash directly it works fine:
var phone = "123-456-7890";
If I pass the variables directly in the browser it works fine: www. domain .com/needle.swf?phone=123-456-7890
Anyone see where I'm going wrong?
GetURL Url Address Defined By Entered Variable
Can I use the getURL command like this?
var user:String;
>visitors enter a string into the user variable
>then
getURL (http://www.homepage.com/"whatevertheuservariableis".htm, _blank);
Limitation Of Number Of Variables Passed
Does anybody know if there is a limit on number of Variables passed in to Flash? Is there a limit on values that are passed in the string? Please let me know if there is any documentation about this stuff. Thanks
Finding Difference Between Passed Variables
alight I have two variables I'm passing into my FLASH file via JS,
gold and minecost. I want to be able to compare them as numbers ... seeing how they are numbers. But they are being treated like strings ... how to I fix this?
_level0 Variables Not Passed To Imported Swf
Hi, hope you can help.
Having parsed an XML document, I've established a variable in the first frame of my main timeline as the first index of an array . e.g. currentClientName. Debugger verifies.
In my imported swf, I have Dynamic Textfields set up to display the variable "_level0.currentClientName"
Testing the movie on the local machine, it works fine, but testing on the webserver, the varible appears to be empty.... any ideas? Could it be that the XML hasn't finished parsing on the webserver? If so, any tips on ensuring that the XML IS parsed before my new movie loads, expecting that variable.....
Thank you in advance...
Default Function Passed Variables
how do you set the default value to be passed to a function? in php you can do something like
PHP Code:
function ($sd=02,$mb) {}
so if you don't pass anything to $sd it will auto pass '02'
can you do that in actionscript?
Javascript Pop Up Window With Variables Passed
Hi,
I have a flash form that sends a mail using a ASP Page using POST method.i need the mail.asp page to open in a pop up window with a thanks message after user clickes on the send button.
does anyone know the solution pls let me know..
Thanks
Nameez
Attaching A Link To Passed Variables
Hi all,
I'm only new to flash and I'm currently working on a project where I read in data from a csv file into a flash page. Once the values are displayed on the page I want to be able to select each value and link it to another page. At the moment I am trying to link each value. Does anyone have ideas?
Below is my code:
Code:
on (release) {
empBox.text = "";
empBox.html = true;
myVars = new LoadVars();
myVars.load("employeeList.csv");
myVars.onData = parseCSV;
var data = [];
function parseCSV(raw) {
var delim = (raw.indexOf("
") > -1) ? "
" : (raw.indexOf("
") > -1) ? "
" : "
";
var temp = raw.split(delim);
var fields = temp.shift().split(",");
for(var i=0;i<temp.length;i++) {
var row = temp[i].split(",");
if(row.length != fields.length) continue;
var tmpObj = {};
for(var j=0;j<row.length;j++) {
tmpObj[fields[j]] = row[j];
}
data.push(tmpObj);
}
term = "L";
field = "Letter";
function findElement(field, term) {
for(var i=0;i<_root.data.length;i++) {
if(_root.data[i][field] == term) {
empBox.text += + _root.data[i].Name + "
";
empBox.text += + _root.data[i].Position + "
" + "
";
}
}
}
search = findElement(field, term);
for(x in search) {
empBox.text += + search[x] + "
";
}
}
}
Any help is much appreciated.
Javascript Pop Up Window With Variables Passed
Hi,
I have a flash form that sends a mail using a ASP Page POST method.i need the mail.asp page to open in a pop up window with a thanks message after user clickes on the send button.
does anyone know the solution pls let me know..
Thanks
Nameez
Variables In JS/HTML Not Getting Passed To SWF On 1st Runtime.
I'm having an issue with getting variables to pass from a query string, to JS/HTML, to Flash on 1st runtime; 2nd, 3rd, ..., Nth runtimes work fine. Here's a the step-by-step explanation of how I am doing this:
Starting out on the http://www.deforestarchitects.com/pages/clients.htm page, if you click on one of the "See their project" links, it should take you to a project page that hosts a SWF file that will then display the correct, corresponding project for that client.
When the "See their project" link is clicked, it will then direct you to a page, but appending a variable in a query string (i.e., http://www.deforestarchitects.com/pages/urban.htm?project=fairhaven).
This variable is then passed to the object, param and embed tags by appending document location search after the *.swf in the param value and embed src properties.
f
Attach Code
document.write('<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="803" height="457">');
document.write('<param name="movie" value="flash/remodels.swf'+document.location.search+'">');
document.write('<param name="quality" value="high">');
document.write('<embed src="flash/remodels.swf'+document.location.search+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="803" height="457">');
document.write('</embed>');
document.write('</object>');
Variables In JS/HTML Not Getting Passed To SWF On 1st Runtime.
I'm having an issue with getting variables to pass from a query string, to JS/HTML, to Flash on 1st runtime; 2nd, 3rd, ..., Nth runtimes work fine. Here's a the step-by-step explanation of how I am doing this:
Starting out on the http://www.deforestarchitects.com/pages/clients.htm page, if you click on one of the "See their project" links, it should take you to a project page that hosts a SWF file that will then display the correct, corresponding project for that client.
When the "See their project" link is clicked, it will then direct you to a page, but appending a variable in a query string (i.e., http://www.deforestarchitects.com/pages/urban.htm?project=fairhaven).
This variable is then passed to the object, param and embed tags by appending document location search after the *.swf in the param value and embed src properties (see attached code).
When Flash acquires this variable, it will then use it in a conditional statement on Frame 10 of the timeline to display the appropriate section of the Flash movie (see 2nd attached Code).
So, upon entering this projects page, the Fairhaven project should be displayed (using the URL/example from the 2nd bullet). However, it only works if you go back to the previous page and click on the same link. What gives?
If anyone has run into similar problems, I'd love to hear what you did to solve you issue. I appreciate any advice or help on this issue. Many thanks!
Attach Code
<object>, <param> and <embed> tags:
document.write('<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="803" height="457">');
document.write('<param name="movie" value="flash/remodels.swf'+document.location.search+'">');
document.write('<param name="quality" value="high">');
document.write('<embed src="flash/remodels.swf'+document.location.search+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="803" height="457">');
document.write('</embed>');
document.write('</object>');
Conditional Statement in Flash:
if(_root.project=="zipperhouse"){
gotoAndStop("zipperhouse");
trace("zipperhouse variable received");
} else if (_root.project=="fairhaven"){
gotoAndStop("fairhaven");
trace("fairhaven variable received");
} else if (_root.project=="tangletown"){
gotoAndStop("tangletown");
trace("tangletown variable received");
} else if (_root.project=="thenest"){
gotoAndStop("thenest");
trace("thenest variable received");
} else {
play();
}
How To Excess Variables Passed From Another Movie
Hi , I am receiving inputs(biomarker and backgd) from another movie.
I am adding them together into a variable called 'sum'.
I want to use 'sum' outside this function which is receiving it from other movie(code for this function pasted below).
But when i do trace(sum) it says undefined. But inside this funtion it gives correct value.
How can I access this variable outside methoToExecute.
Attach Code
incoming_lc.methodToExecute = function(param:Number,param1:Number):Void {
biomarker=param;
backgd=param1;
sum=biomarker + backgd;
trace(sum); //Gives me correct value here
}
trace(sum); //Here it says undefined
Is It Possible For Flash Variables To Take Values Passed By PHP?
Hopefully this will be my last PHP/MX thread for a while
Is it possible for Flash variables to take values passed by PHP?
Say the PHP script strips information from a database for customers, in Flash is it possible to have something along the lines of:
customers = new Array(numerical value taken from PHP)
customers[0] = "customer 1- taken from PHP"
customers[1] = "customer 2- taken from PHP"
ok firstly is this possible? (grrr where is the smoking joint smilie!?)
If so where can I find info for it, or what is the very basics of setting a flash variable as a value from a PHP script - like would it be:
PHP Code:
MyFlashVariable = $phpvariable
any info on this is much appreciated.
Thx very much for all the help so far on these recent topics.
Variables Passed In From HTML, Not Quick Enough?
Hey guys,
I'm having a bit of a problem with external vars and timing.
I'm building a custom FLV player. In the parent HTML I have some boolean variables that I'm passing to the SWf, stuff like autoStart and loopPlayback.
Then in my AS I have this line:
ActionScript Code:
if(autoStart){ nStream.play(videoSource); // play the video}
The problem is that line gets executed before the external var gets in, I think. If I place a dummy var at the top of the AS then everything works fine. And the external var is definitely getting passed in, I have setup a check for that.
I would need something like loadVars.onData ...but I'm not using loadVars, I wnat the vars to come in from the SWFObject HTML, or maybe a query string. Any ideas?
Function Seems To Ignore Passed Variables
This function to replace html tags works:
Code:
var str:String = "De muziek van '<span style='color: rgb(204, 204, 204);'>Porno voor Ricardo</span>' is een mengsel van rock en punk; authentieke Cubaanse underground. De toon is agressief, de teksten soms banaal, maar vaak ook fris en scherp en vrijwel altijd provocerend. Op hun website zegt de artiest geen enkele politieke partij te steunen, zeker de communisten niet.<br /><br /><span style='font-weight: bold;'>Vrees voor repressailes</span><br />'<span style='font-style: italic;'>Wij accepteren dit klote communisme niet. En als de prijs is dat we nergens mogen spelen, dan betalen we die</span>', zegt Águila in de Nederlandse documentaire 'Cuba Rebelión'. De zanger wordt gezien als dé exponent van een jonge, kritische generatie Cubanen. Toch durft niemand hem uit te nodigen op concerten of festivals, uit vrees voor represailles van de regering.<br /><br />Águila is al eens eerder gearresteerd. In 2003 werd hij opgepakt en veroordeeld tot vier jaar cel. Ook nu hangt hem eenzelfde straf boven het hoofd wegens 'sociaal gevaarlijk' gedrag. Daarmee worden in Cuba mensen opgepakt voor elke willekeurige activiteit die de staat niet zint.<br /><br /><span style='font-weight: bold;'>Bekendheid</span>";
begingTag = "<span style='font-weight: bold;'>";
//begingTag = "<span style='color: rgb(";
endTag = "</span>";
newBeginTag = "<B>";
newEndTag = "</B>";
function replaceHTMLtags(rText, beginTag, endTag, newBeginTag, newEndTag) {
while (rText.indexOf(begingTag)>-1) {
beginReplacing = rText.indexOf(begingTag);
if (beginTag.indexOf(">")<0) {
txtTemp1 = rText.slice(0, beginReplacing);
startSlice = rText.indexOf(">", beginReplacing);
txtTemp2 = rText.slice(startSlice+1);
txt1 = txtTemp1+newBeginTag+txtTemp2;
} else {
txt1 = rText.slice(0, beginReplacing+begingTag.length).split(begingTag).join(newBeginTag);
}
txt2 = rText.slice(beginReplacing+begingTag.length);
endReplacing = txt2.indexOf(endTag);
txt3 = txt2.slice(0, endReplacing+endTag.length).split(endTag).join(newEndTag);
txt4 = txt2.slice(endReplacing+endTag.length);
rText = txt1+txt3+txt4;
}
return rText;
}
trace(replaceHTMLtags(str, "<span style='font-weight: bold;'>", "</span>", "<B>", "</B>"));
but this (without setting the variables outside the function) doesn't:
Code:
var str:String = "De muziek van '<span style='color: rgb(204, 204, 204);'>Porno voor Ricardo</span>' is een mengsel van rock en punk; authentieke Cubaanse underground. De toon is agressief, de teksten soms banaal, maar vaak ook fris en scherp en vrijwel altijd provocerend. Op hun website zegt de artiest geen enkele politieke partij te steunen, zeker de communisten niet.<br /><br /><span style='font-weight: bold;'>Vrees voor repressailes</span><br />'<span style='font-style: italic;'>Wij accepteren dit klote communisme niet. En als de prijs is dat we nergens mogen spelen, dan betalen we die</span>', zegt Águila in de Nederlandse documentaire 'Cuba Rebelión'. De zanger wordt gezien als dé exponent van een jonge, kritische generatie Cubanen. Toch durft niemand hem uit te nodigen op concerten of festivals, uit vrees voor represailles van de regering.<br /><br />Águila is al eens eerder gearresteerd. In 2003 werd hij opgepakt en veroordeeld tot vier jaar cel. Ook nu hangt hem eenzelfde straf boven het hoofd wegens 'sociaal gevaarlijk' gedrag. Daarmee worden in Cuba mensen opgepakt voor elke willekeurige activiteit die de staat niet zint.<br /><br /><span style='font-weight: bold;'>Bekendheid</span>";
function replaceHTMLtags(rText, beginTag, endTag, newBeginTag, newEndTag) {
while (rText.indexOf(begingTag)>-1) {
beginReplacing = rText.indexOf(begingTag);
if (beginTag.indexOf(">")<0) {
txtTemp1 = rText.slice(0, beginReplacing);
startSlice = rText.indexOf(">", beginReplacing);
txtTemp2 = rText.slice(startSlice+1);
txt1 = txtTemp1+newBeginTag+txtTemp2;
} else {
txt1 = rText.slice(0, beginReplacing+begingTag.length).split(begingTag).join(newBeginTag);
}
txt2 = rText.slice(beginReplacing+begingTag.length);
endReplacing = txt2.indexOf(endTag);
txt3 = txt2.slice(0, endReplacing+endTag.length).split(endTag).join(newEndTag);
txt4 = txt2.slice(endReplacing+endTag.length);
rText = txt1+txt3+txt4;
}
return rText;
}
trace(replaceHTMLtags(str, "<span style='font-weight: bold;'>", "</span>", "<B>", "</B>"));
Is It Possible For Flash Variables To Take Values Passed By PHP?
Hopefully this will be my last PHP/MX thread for a while
Is it possible for Flash variables to take values passed by PHP?
Say the PHP script strips information from a database for customers, in Flash is it possible to have something along the lines of:
customers = new Array(numerical value taken from PHP)
customers[0] = "customer 1- taken from PHP"
customers[1] = "customer 2- taken from PHP"
ok firstly is this possible? (grrr where is the smoking joint smilie!?)
If so where can I find info for it, or what is the very basics of setting a flash variable as a value from a PHP script - like would it be:
PHP Code:
MyFlashVariable = $phpvariable
any info on this is much appreciated.
Thx very much for all the help so far on these recent topics.
Question About Variables Passed To Flash....
I seriously need help... literally...
I am trying to build a quick scrolling flash news ticker that is database driven...
I'm using ColdFusion to access the database and then send each request back to Flash.
I have been able to get it to show the contents but whenever it gets to the last record, it just keep displaying the last record. So I put a test in my actionscript to stop if my 'flashid' (which tells coldfusion what record to get) equals the recordlength of the coldfusion page (which I pass back to flash as a variable). The problem with this is that apparently the actionscripting doesn't like comparing the flashid variable to the coldfusion variable...I can put flashid > 4 and it will work just fine and stop after number 4 but when I put flashid > mylength, it doesn't work...
is it possible to use a passed variable in a conditional statement?
here is my code:
on the first frame -
loadVariablesNum ("query.cfm", 0, "POST");
**I'm sending 'flashid' to my cfm file, and then passing back 'contents' which is a variable that displays in a dynamic text box (which in turn scrolls down, stops for a couple seconds, then scrolls out...
on the last frame -
flashid=flashid+1;
if (flashid > mylength) {
stop();
} else {
gotoAndPlay (2);
}
PLEASE PLEASE PLEASE... someone help.. I'm new to flash and I've been at this since Thursday of last week...
How To Remove Address Area In The New Window Opened Using GetURL()?
Hello everyone,
I am trying to open a NEW window from Flash and I am using the following code to do so.
getURL("javascript:window.open('http://www.MyDomain.com/demo/','Demo', 'width='+((screen.width*3)/4)+', height=' + ((screen.height*3)/4) + ', top=' + ((screen.height*1)/16) + ', left='+((screen.width*1)/16)+' , fullscreen, toolbar=no, scrollbars=yes, resizable=yes, menubar=no, status=no, directories=no, location=no'), void(0)");
This line of code opens a NEW window but I still have web address area available in the new window. Can someone be kind enough to tell me how I can remove the web address area on the top of the window?
Thank you very much and have a great day.
Loaded Variables Passed To Action Script
I have loaded in a set of numeric values into a movie and want to use them as numeric values for vaiables used within the action script.
How do I pass these values into the script as everything I have tried does not seem to work,
here is the variable from the debugger
Variable _level0.graph.collected.collected = "10"
so I want to use "10" as a variable called number_input
so the set variable I have currently is
number_in = ("_level0.graph.collected.collected");
thanks in advanced.
A.
Passed Variables To Access Object Elements
I want to use a variable passed to a function to access an element of an object. Is the pink colored code correct?
Code:
text="";
textFile = new Object();
textFile.Mission = { dani: "blah", mike: "blah", dale: "blah" };
textFile.Adventure = { bob: "blah", tim: "blah", allen: "blah" };
function getText(section, person){
text=textFile[section][person];
}
Thanks,
John Ziebro
www.liquidgenius.net
Can Variables Be Passed In Flash To Html Page
hello.
just curious here can one pass variables to flash movies within themselves such as loadMovie("thispage.swf?id=whichOne&numPages=3");
i have used this technique with embedded flash in html such as <param name="movie" value="flash/final.swf?page=stainless"> but can the same principle be used within flash?
also loading flash variables sometimes seem to take to long to load tho its only one var. being loaded?
is there another method to do this with out the use of backend?
thanx
Can't Receive Variables From HTML To Flash In AS3 Passed Via URL (not Flashvars)
hey all,
can't seem to get AS3 to recognize variables passed via URL (not Flashvars). i can get vars passed with Flashvars in the javascript but I don't want to use that method. i'm simply extending the .swf call with .swf?var=123 in the embed and on the AS3 side i'm calling loaderInfo.parameters.var
thought this would work but doesn't. what am i doing wrong?
HTML:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="1024" height="768" id="main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="main.swf?var=123" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><embed src="main.swf?var=123" quality="best" bgcolor="#ffffff" width="1024" height="768" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
AS:
t = new TextField();
t.text = String(loaderInfo.parameters.var);
thx in adv.
michael
Can't Receive Variables From HTML To Flash In AS3 Passed Via URL (not Flashvars)
hey all,
can't seem to get AS3 to recognize variables passed via URL (not Flashvars). i can get vars passed with Flashvars in the javascript but I don't want to use that method. i'm simply extending the .swf call with .swf?var=123 in the embed and on the AS3 side i'm calling loaderInfo.parameters.var
thought this would work but doesn't. what am i doing wrong?
HTML:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
Variables In Moviclip Instances Passed To Cgi Script With Rest Of Form
I have a flash form with lots of elements with declared variables on the main timeline. In the same form I have checkboxes that are movieclips which set additional variables depending on what fram the movieclip instance is on. When I submit the form only the variables on the movies main timeline get sent to the cgi script and mailed to me. How do I send the variables set in the individual movieclips as well so they go with the rest of the form?
Variables From Address Bar
How would I set a variable in my flash movie from the address bar if possible. Like say I made a flash that said "Hey " + name and someone would send their friend a linnk that specified mike as the name , then the flash would say "Hey mike" in a dynamic text.
Variables & Address
Attached is the file with the code applied. I'm trying to get each menu item to open a new window with the website listed in sitelist. Can anyone tell me why it keeps opening a blank page that says "about blank" in the title bar and the address bar?
Thanks
ActionScript Code:
Movieclip.prototype.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) { getURL("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('"+url+"','"+winName+"','"+"width="+w+",height="+h+",toolbar="+toolbar+",location="+location+",directories="+directories+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"')}else{myWin.focus();};void(0);");};var menuItems = [ "Wizard of the Coast", "Realms Quest LARP", "Midland LARP", "Adventure Seekers", "Zephn Photography", "Taco Bell"];var siteList = ["http://www.wizards.com", "http://www.realmsquest.org", "http://www.adventuresinmmidland.org", "http://www.adventureseekersofdoom.20m.com", "http://www.zephn.com", "http://www.tacobell.com"];for (i=0; i<menuItems.length; i++) {mc = container.dynamicButton.duplicateMovieClip("button"+i, i);mc.menuLabel.text = menuItems[i];mc._y = i*(mc._height-1);mc.siteToLoad = siteList[i];mc.actualButton.onPress = function() { address = siteToLoad; target_winName = "TRPA"; width = 780; height = 640; toolbar = 1; location = 1; directories = 1; status = 1; menubar = 1; scrollbars = 1; resizable = 1; //sends data back to the function openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);};}
Variables In Loadmovie Address?
Hello peeps,
Is it possible to set a variable to act as the folder name for use in specifying the path for a loadmovie operation?
To make things clearer, here's what I'm doing...
I have collections of images I want to load (01.swf, 02.swf, 03.swf etc) each placed in seperate folders by artist name.
To simplyfy things, I want to load the swfs using a variable that is set at the root level to specify the folder in which they're placed, kinda like this...
(set at root level)
ArtistName = johnsmith
(then load corresponding swfs)
loadMovieNum(ArtistName + "" + "01.swf", 5);
I've tried loads of different permutations but to no avail. Does anyone know if this is possible or not???
Cheers
Loading Variables In The Address Bar
Hi, I want that when I press some button in my flash, its send the variables from the flash on the Address Bar of the html of this same flash. So, my flash can't be reloaded, the page cannot be refreshed.
Can I do this only with JAVASCRIPT???
Thanks.
Hiding Variables In Address Bar
Hello everyone.
I am developing a flash game but have hit a brick wall every since. Once my game completes, I store the user's score in a variable. From there, I use the 'Get' method to pass this variable to an asp page. My problem is that the variable appears in the query string of the address bar of the asp page. I would like to hide it for security reasons. Any idea?
[F8] Variables From Actual Address
Hi everyone, I'm making some flash headers for a site that need to be dynamic. Is there a way I can update dynamic text in my flash files by reading the actual url of the page its embedded in?
the url will take the form of "...header.swf?header=Puzzle" I would need to retrieve the 'Puzzle' bit.
I've read around and lots of answers to this involve editing the html of the page, since the pages themselves are dynamically created this might not be possible so I really could do with a solution that literally just reads the address. Is this possible?
thanks in advance
|