Php :: Passing Variable FROM Flash To HTML?
Mar 7, 2011
I have a rather simple flash application users can make a quick username when connected, and the username is created inside the flash swf.
Now, I have a cron job deleting inactive usernames every ten minutes (on my mysql database where these usernames are all stored and accessed by the other people online) which is fine. But it can still get cluttered up if a bunch of people sign off at once, there is still that 10 minute window before the cron job clears them.
The users have an option to click log out in the flash application which is fine and works great. But of course many choose not to click log off they just click the browser x.
I've looked into onbeforeunload and jquery's .unload but I still need a way to get the username variable that's IN flash INTO the HTML, then use a php script to run the delete username mysql query.
If not, any insight on how I might pass the username variable to the html to hold onto it after the user makes their username so it can be involved with the .unload function running the php script?
EDIT::::: Maybe is there a way to create a UNIQUE string of numbers with php then pass that var to flash to include with the mysql row then since i already have that var since it was created on the html side, just along with the unload, have it delete the row that has that unique id?
If anyone things this idea would be the best approach, and if i used something like md5(uniqid(microtime()) . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']) to make a random iD how could i go about storing the result in a var i could place in the flash vars param then again in the jquery unload or javascript onbeforeunload if that would be better .
View 2 Replies
Similar Posts:
Jun 6, 2011
I know this is pretty simple but all that I have read doesn't make much sense to me. I have one swf calling another swf that I have embedded into an htnl. In other words just calling another html page in a seperate window. In one.swf (runing in broswer) I use the below to call another html page passing the variable NewLessonArray. This contains an array of completed chapters.
[Code]...
All that is returned that I can see is object Object. But since I am passing on a address line into another swf embedded in a html page I am unable to determine that correct syntac for retrieving the information.
View 6 Replies
Oct 16, 2009
An AIR application that load an html page which contain some forms. I want to pass values from flash to html and then submit data. Don't suggest other possible variants, i have experience using URLLoader, amfphp, blazeds e.t.c. Idea it's to pass that from flash to html form, and then submit that information to server using html page. How can be do that? Or maybe in an web application (not desktop)?
View 2 Replies
Dec 5, 2010
i'm having a problem when php send variable to flash for example ("notlogged") , it's being send like that :
[Code]....
i know i need to convert it to htmlText but i can't find a way to do that
View 3 Replies
Mar 18, 2004
I've been trying - with absolutely no success - to pass a variable from an SWF on an index page to an SWF on the next page (in this case home.asp). I am using the following method:
In the index page when a menu button is clicked I pass the value in the string
[AS]getURL("home.asp?jumpTo=aboutus", "_top", "GET");[/AS]
Then on home.asp I drop the value into the SWF link (both the object and embed tags):
myswf.swf?jumpTo=<%=request.querystring("jumpTo")% >
In the SWF I then attempt to use the value of "jumpTo" like this:
(this is on the first frame of the SWF)
[AS]if(jumpTo==aboutus) {
_root.button4.gotoAndStop(10);
_root.header.attachMovie("aboutID", "attachedAbout", 1);
getURL ("aboutus.html", "site");
}
There are 11 possible values for "jumpTo" and I have a similar "if" statement written for each one. i know the value is being passed from the original SWF to home.asp because when I request the querystring it gives me the correct value. it's obvious that the SWF embedded in home.asp is not receiving the value. Do I need to declare the variable first? Should I use a global variable? is it possible to set up a dynamic variable in the flash movie?
View 3 Replies
Jan 23, 2010
I use an swf file to play short flv files on a web page. I write the embed/object tags into a dynamic web page using php and understand how to pass the relevent parameters to the swf file. As a complete flash scripting dummy, I don't know how to get the variable into the flash script or how to use it once it is there. At the moment I create a new swf file for each movie I want to display and write the file name into the script as below. how to get the file name into the script below using FlashVars or a query string in the html.
// Create a NetConnection object
var netConn:NetConnection = new NetConnection();
// Create a local streaming connection
[code].....
View 3 Replies
Sep 14, 2009
I have a main swf movie.....in which i want to load another swf by passing variable from html page
.
.
.
.
.
in flash 8 in as2
my code is that....
var topnavigation = _root.topnavigation; // Will load top navigation.swf
drop.loadMovie(topnavigation);
View 4 Replies
Mar 18, 2004
i've been trying - with absolutely no success - to pass a variable from an SWF on an index page to an SWF on the next page (in this case home.asp). i am using the following method: in the index page when a menu button is clicked i pass the value in the string
[Code]....
View 3 Replies
Sep 3, 2009
i have a flash file created in AS3, let's call it file1.swf it contains a variable.. we will call this testVariable file1.swf is embedded inside file1.html file1.swf reaches a point where it needs to load a new swf file that we will call file2.swf file2.swf is done in AS2. file1.swf simply calls file2.swf by calling a new HTML file that embeds file2.swf
So file1.swf calls
var targetURL:URLRequest = new URLRequest("file2.html");
navigateToURL(targetURL, "_self");
I need file2.swf to have access to testVariable.
View 4 Replies
Oct 9, 2009
I m passing variable/ file name in html/ php like this
[Code]...
View 2 Replies
Dec 3, 2003
I have a html/flash site now, [URL]. i access email from my site itself by giving the userid and pwd text box which i copied from the actual website hosting my email access. i copied the entire <form...></form> tag to my page and thus was able to put the name and pwd in my home page only and access the email in a separate window. now i have redesigned my webpage using only flash. i would like to know how i can implement the same using flash. as i have not much experience using action scripting i am a bit stuck about how you pass the hidden form variables. the below is the the exact form syntax:
[Code]...
View 1 Replies
Sep 15, 2009
var loader:Loader = new Loader();
loader.load(new URLRequest("panghat spa.swf"));
addChild(loader);
want to load panghat spa.swf as a variable by pasing variable from html page in to flash
View 1 Replies
Aug 26, 2011
I'm trying to pass the file name of an image upload PHP script into Flash's UILoader component. So when a user uploads their image, the file name of the file is passed to flash so that the image displays within the Flash UILoader application. Here's the PHP variable I'm trying to pass: $filename= ''; And here's where Flash's UILoader gets it's source (ActionScript 3.0): uiLoader.source = "freshly uploaded file.jpg ($filename)?";
View 1 Replies
Jun 15, 2010
I have a Flash movie (shell.swf) that loads in an external movie ("home.swf"). Within home.swf, one of two different swfs can load and I'd like to use a query string to determine which one loads.
View 7 Replies
Feb 11, 2009
this is probably quite a newbie problem but its driving me insane!I'm simply trying to make a flash file with a button that automatically copies text to the clipboard...
ActionScript Code:
//imports the necessary as events
import flash.events.Event
[code]......
View 1 Replies
Feb 15, 2007
I have a flash banner and embedded the flash swf the usual way. The flash banner has an xml file that loads in images.when published it views and works fine. But when I incorporate into my site it doesnt load the xml file. I believe it is because on the site i have friendly URLS. so when you are on the home page it looks for the file in home/images.xml.when you are in about page, it looks for the file at about/images.xml.I believe that i have to pass a param giving the absolute path to the flash file so that it loads.
View 6 Replies
Sep 11, 2007
[Code]...
these are basically input fields, but for some reason they are passing all the html tag assigned to the flash textfields. (used to style the flash components) is there a quick way to kill that with either php or flash??
View 5 Replies
Sep 4, 2009
Here are what I'm having:
<?PHP
$testVal = "This is a test";
$test = urlencode($testVal);
[code].....
View 7 Replies
Aug 4, 2009
I need to have something like this in a html file
CODE:
And so on....
Then i must get values from "item1" and get them into a variable and sent it to flash. i probably will be using an array to store the values of "item1" but what can i use to create multiple param with the same name and have multiple values?
I don't really want to have any arrays like item1 = x,y,z because x,y and z are going to be html encoded, and the code of line would become enormusly confusing to read and edit.
View 1 Replies
Sep 20, 2009
How doe I pass a variable to Flash? For example, I have a link, [URL] How do I grab this variable, "about" in Flash?
View 1 Replies
May 7, 2010
How can i pass user input Varibles from Flash to Php?
View 6 Replies
Apr 5, 2011
I have a flash map I have created years ago and I've recently done an update to the file and published it. Everything works perfectly locally and online except for when I pass variables into the movie online none of the variables are recognised. Locally the file works fine and the dummy variables are passed in. But even online the dummy fall back variables don't work.There are two files the main map movie and the preloader. The preloader determines the variables that are passed into the main movie from the html embed code.HTML EMBED CODE
Code:
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/media/flash/preloader-R10.swf?ShopLevel=<%= Request("ShopLevel")
[code].....
View 0 Replies
Nov 19, 2011
I have written the code for passing the variable from a php file to flash.Below is my php code:
<?php
$comment = "abcd";
echo "values=$comment";
>
Actually I can successfully pass the variable from php to my flash file. However, when I change the value "abcd" t
View 2 Replies
Nov 21, 2011
I am writing the codes that can pass the value from the table of database when I click on a button. When I click on the button in the first time, I send the the number of click: clickNum = 1 to the php file and I want to select the first row from the table. When I click on the button in the second time, I send the clickNum = 2 to the php file and I want to select the second row from the table, and so on. I can successfully send the clickNum in that numerical order. However, I can't pass the corresponding row of result back to the flash. For example, when I send clickNum = 1, it pass the value of the second row of table back to flash, but not the first row. And the row that it pass back to flash is different everytime, seems it is random and I can't find a pattern. The second question is that I still can't read the chinese character from the table of database even I have included the header("Content-Type:text/html; charset=utf-8"); in the php file.[code]
View 8 Replies
Mar 10, 2005
I am trying to pass a variable in Flash(MX2004) but struggling with it [code]where 'main' is a movie clip which conatins a variable called 'texts' to show the text entered in the html.
View 3 Replies
Nov 6, 2005
I have been reading all the post on this topic, but i just do not seem to get it! I am trying to send the variable "folder" to a flash file and get the flash file to recognize it. i am using the loadVariables() command to get the variable, but i am not sure how to process it to where i can use the variable later in the actionscript. can someone post an example script to show how to process a variable sent from php to flash?
View 1 Replies
May 19, 2009
what i'm trying to do is to pass a value to a flash from html page....(from html to_nameSWFVariable)following is my code :in html :
PHP Code:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab
[code].....
View 2 Replies
Jul 29, 2009
Need to get a flash banner to carry through PHP session download. The PHP code is below;
<a href="http://download.site.com/viperML/site/download.asp?file_name=site.exe&ul=<?php echo $_SESSION['language']; ?>&lang=<?php echo $_SESSION['language']; ?>&banner_tag=<?php echo $_SESSION['btag']; ?>">
The above carries through the affiliate ID together with Site Language which user has come to. The above works fine, what I need to now do is have my flash button call the same function...
View 3 Replies
Nov 23, 2011
I am trying to place a SWF on a page and pass a variable to it. The variable would depend on which link that the user clicked on. I am toggling the visibility of the div containing the SWF (code at the bottom). What I need to do is, when I toggle the div 'on' I need to pass a variable to the SWF so that it knows which file to load. Would I use SWFObject for this?Here is the HTML code on the page.
Code:
<a class="popUpLink" href="#" onclick="showHidePUP();">Trojan Horse</a>
<div id="boxPup" class="box" style="left:225px;top:75px;"><!--style="left:400px;top:150px;--
[code].....
View 1 Replies
Oct 20, 2009
I am using Flash CS4, as2.0
flash code:
code:
lv = new LoadVars();
lv.load ("miphp.php");
[Code]....
The output should be "anything" but instead of that, the output is ".$nombre."
View 2 Replies