Passing A Variable From PHP To Flash

May 18, 2003

How do I pass a variable from a PHP script that already contains
a Variable - to my flash movie ?

E.g.

$Access = True

Now when the Flash movie opens for the first time I want to read the content of $Access...if its true or false - to give user access to view the movie or not.

ADVERTISEMENT

Passing Variable From Flash To Php & Back From Php To Flash

Jun 5, 2000

I am looking for some help in passing variable from flash to php & back from php to flash.

View 5 Replies View Related

Jquery - Passing Variable To Flash?

Aug 25, 2009

In the html i have this code:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://macromedia.com/cabs/swflash.cab#version=6,0,0,0"
ID=flaMovie WIDTH=554.6 HEIGHT=57.3>
<PARAM NAME=movie VALUE="main_menu.swf">

[code]....

And the flash this:

First keyframe:

stop();
if (lang == "EN") {
gotoAndStop(2);

[code]....

2,3 keyframe only has some graph, and Stop() If lang is EN then i need to go keyframe 2, if not the go to 3.... On IE6 works well..no problem. On FF 3.5 something not ok.. if i hit the refresh button on FF, then sometimes OK, sometimes not OK, sometimes only a part of the graphic shown on keyframe 3...i dont really understand.. Earlier i have no problem with flasvars on FF...something changed with FF 3.x? Any other way to pass variable to flash? (i dont want to use query string..)

View 2 Replies View Related

Passing Session Variables Into Flash

Sep 22, 2001

I'm building a login scheme that uses PHP sessions to pass the key variables (i.e. $login and $password). into a flash movie.

Typically, I can easily pass variables into flash movies by calling the PHP scripts via LoadVarNum and using print to send them back.

However, this situation is a little different since the php session commands are actually part of the url that contains the embedded .swf. I have determined that the needed variables are in fact making it to the top level url but not into the .swf.

Does anyone know of an alternative way to pass the variables into the .swf (besides populating them into header since that would reveal the info in the link)???

I'm thinking that there may be an option in the embed command or something.

View 2 Replies View Related

Hide Xml From Users While Passing It Into Flash

Oct 29, 2009

We have a little in-house LMS with courses built in Flash. Scores are updated and retrieved with POSTs to PHP scripts which query a MySQL database. All the course content and quiz questions are in xml files. Those XML files are easily accessible from a user's Temporary Internet Files (sort of SCORM style, for those familiar with it) and while you'd have to be pretty desperate to cheat at something like a Fire Safety test, it's still a vulnerability we'd like to solve.

I intend to move the quiz data (and eventually, the course content) into a MySQL database, then probably build the XML in PHP and echo that to the Flash course (as we've been doing to update and retrieve assessment scores). I think I could limit how and when the xml is displayed by passing hashes and shared secrets and whatnot between the PHP page and Flash, but this only limits outside access, and anyone viewing the course legitimately will still see the XML passed around (I think..).

Surely I'm not reinventing fire here. Is there a method or a technology in existence that allows the safe, discrete passage of xml into Flash? Ideally, I'd probably want to pass the questions and possible answers from MySQL to Flash, then pass the chosen answer back and do the marking server-side.. but time is money, and I'm looking for an answer that will require as little rebuilding of the flash framework as possible.

View 1 Replies View Related

Flash - Passing Session To Actionscipt?

Mar 29, 2011

I know there is a lot of PHP and Actionscript questions here, but mine is a little differnt. I have a php website that uses sessions and if your not logged in you cannot acces a web page... I want the same for my Flash file, but want flash to see if there is a valid session on the php website and if there is play the flash, if not access denied..!

this if they download the flash file and are not logged into the PHP website they cannot play the file. here is my PHP session I.D I want to use for validation from PHP to Flash..

$member = "{$_SESSION['SESS_MEMBER_ID']}";
here is my PHP authentication that runs on every page
//Start session
session_start();
//Check whether the session variable SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
header("location: access-denied.php");
exit();
}

View 2 Replies View Related

Passing A JSON Encoded Data From My Flash File?

Dec 2, 2010

I'm passing a JSON encoded data from my flash file to php i traced the data output using firebug and i see it's being passed along to php but when i try to return the values back to flash through php i get an empty string can some one expalin why php is behaving like that? here is the code

<?php

$data = urldecode(utf8_decode(stripslashes($_REQUEST['data'])));
$decoded_result = json_decode($data);
print_r($decoded_result);
echo output.'='.$decoded_result;
?>

View 1 Replies View Related

Javascript - Passing Flash Variables In Visual Basic

May 13, 2010

I have a simple standalone application written in Visual Basic that I'm porting to a browser based application using PHP/javascript. The original VB application has some simple embedded flash games with token and point counters. The token and point values are being passed as variables between the application and the game.

I'm trying to achieve the same effect in my PHP port without modifying the actionscript code( using the variables in actionscript that already exist). Below is Visual Basic code that's loading a value from a database and posting that value to flash using FlashVars:

[Code...........]

View 1 Replies View Related

Include Generated XML File Into Flash Vars While ALSO Passing Through Current Functions Into It?

Dec 22, 2010

In webpage.php the flashscript is calling a flash script with a flashvar: the playlist file which is a PHP generated XML file: playlist.php, it does that well so long as there are no extra functions in there. Now, in that XML-format playlistfile there needs to be a special function, besides the usual echo("");, namely the very special echo __(""); function that is already declared in webpage.php which needs to do something with the paragraphs residing within that xml file.

However, currently the retrieved file misses the function echo __();and says "no such function declared in that xml-format [playlist.php] file". The php functions that are currently included at the very top of webpage.php somehow do not pass-through-the necessary functions into the playlist file for it to recognise how to handle it, in order for that playlist to get those necessary functions working.

Apparently these are not passed through automatically/properly when residing in the flashvars?? Cause the echo __(""); works fine when called within webpage.php or via a normal php include(""); if those functions are in a different php file. But not working from the playlist.php file.

[code]....

View 2 Replies View Related

Variable To Flash

Jun 28, 2007

Basically I want it so that a person is on a php, they click on a link (i.e. a thumbnail) and then are taken to a new page which has an swf embedded in it.

This new page should pass a variable (for instance, the thumbnail id). I tried to do this by included the php variable in the 'src' tag whre I embed the swf, as I read that Flash will automatically detect that variable if I do. Code:

View 4 Replies View Related

Send Variable To Flash?

May 2, 2011

I am working on Flash,Php site.Currently the Flash Developer calles my page called createJPG.php and sends me an image data.I recieve this data and create JPG from the Data.

What i want is, when the Flash developer send me data he can show a loader and when create JPG process is complete he can hide the loader.For this i want to pass him variable with value 1 as soon as the CreateJPG process is complete...

How can i pass this varialbe ??

View 2 Replies View Related

Bring A Variable On Flash With AS2?

Jun 1, 2010

Can you show me an example of a very easy implementation in AS2 (action script 2.0) to bring a var from a php file. I have a php script who return a value into the var $result when it is executed, how can i use this var on flash?

View 1 Replies View Related

Variable In Flash Object

May 31, 2007

my question is about flash object code and php.

how do i embed a php varible into a flash <object> coding?

this is my varible : <{$photo.imgsrc_photo}>

this is the flash object code : <param name="FlashVars" value="id=undefinedsrc= < == http://imageURL.jpg == > width=600height=600" >

View 4 Replies View Related

Javascript - Send Xml To Flash As Variable

Jun 27, 2011

I have a flash file where I can pass xml from file :

script type="text/javascript">
var flashvars = {};
flashvars.xmlSource = "XML.xml";
...
/script>

Can I send xml from php in varible to flash example:

$xml = "?xml version="1.0 ...";
script type="text/javascript">
var flashvars = {};[code]....

View 1 Replies View Related

Pass 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.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 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 . im just more familiar with jquery

View 2 Replies View Related

Pass A Variable Into Flash Actionscript?

Sep 19, 2009

Pass a php variable into flash actionscript below so that can play a video depending on the variable that is passed.

PHP Code:$queryvideo = "SELECT * from products where products_id='$products_id'";
$resultvideo = mysql_query($queryvideo) or die(mysql_error());
$rowvideo = mysql_fetch_array( $resultvideo );

[code]...

View 6 Replies View Related

Create An Image From Flash Variable?

Apr 6, 2009

I have this php code that receives variables form flash to create image which works fine.what i want to do is save that image after its been created on my server instead of showing it as is in the code belowhow do i go abut that to save it in this folder -----flashimages/

/**
* Get the width and height of the destination image
* from the POST variables and convert them into
* integer values
*/
[code]..........

View 2 Replies View Related

Sending Db Info To A Flash Swf Via Variable

Nov 26, 2007

I have a client who wants a marquee of their top news story to scroll across the top of the page. the <marquee> tag does not validate - so I thought that flash would be an easy solution.

only problem is I am retrieving my data from a db - and for some reason the loadVariables function is only printing the name of my php variable. Code:

View 1 Replies View Related

Problem With Session Variable And Passing Variable On Insert

Jun 4, 2007

I am trying to set a session variable along with my insert statement but on the next page when I do my query I get no results even though I know there are. Code:

View 5 Replies View Related

Passing Multiple Variable Errors...last Variable Vanishes.

Jul 19, 2007

I have been trying to figure this one out for a few days now and it is starting to drive me mad.  I'm sure this is something simple that I have done wrong but I can't for the life of me figure out what is wrong here. Some background.

I decided I needed to learn PHP, I really enjoy it but keep getting stuck on things like this due to my lack of knowledge.  So I set myself a challenge to write a PHP CMS system using PHP, mySQL, XHTML and CSS.  All was going fine (all be it rather slowly) until I tried to write the page to edit articles in the CMS.

I have the 'ID', 'title', 'venue' and 'article' stored in the database fine.  I can pull entries out and display them fine.  I now want to edit them using a browser.  So I thought I would use the same form I used to add mySQL entries and change ti so that it loads in the article into the form fields depending on the id.  (This is chosen through a link saying 'edit). Code:

View 7 Replies View Related

Importing A Field From MySQL Into A Variable In Flash?

Oct 18, 2003

I have a query that is giving me the field that I require from my database using PHP.
What is the best way to import this variable into flash? Can I echo the number out on the page and have Flash import it that way? Could I use the Load Variable command? code:

View 10 Replies View Related

Loads Variable Data From A Flash Form

Jan 7, 2007

I'm designing an email form processor that loads variable data from a flash form. I'm trying to clean up the php file so it's not to cluttered. I want the mail recipient to receive an visually appealing HTML message, so I've created an html file with the format. I bring this file in as an include(). I was thinking that it would be possible if I could somehow assign a variable to the included file. EG:

Include ("messageHTML.php");
$messageHMTL = include("messageHTML.php");

View 13 Replies View Related

Flash - Pass Variable As FlashVars Via SWFObject?

May 24, 2010

I am trying to take a PHP variable and pass it along to Flash via Flash vars. My end goal is to pass a string formatted as XML to Flash, but because I'm struggling I've stripped everything down to the basics. I'm just trying to pass a simple PHP string variable to Flash via FlashVars with SWFObject but something isn't right. The page won't load when I try to pass the variable inside of php tags, but it will load if I just pass a hard coded string. The basic structure of my page is that I have some PHP declared at the top like so:

[Code]...

View 2 Replies View Related

Passing JavaScript Variable To Session Variable?

Jan 20, 2011

I am trying to update/create session variable when I change the option thru a drop-down box. TThe value is stored in a javascript function. how I can pass this variable to my PHP session variable without using a AJAX request.

View 5 Replies View Related

Passing Variable Into Function - Referencing The Variable?

Mar 22, 2011

I have a class which pulls in Twitter feeds and amalgamates them, they are put into an array ,sorted and combined. I then need to convert the 'published' time from unix to human . Within my class construct I have:

function __construct($inputs) {
$this->inputs = $inputs;
$this->mergeposts();

[code]....

Part of this I believe is due to my lack of understanding of PHP terminology, which is making it hard to find anything in the manual . Am I trying to reference the 'published' array? What I need is the correct version of :

$this->sorted['published']

View 2 Replies View Related

Passing Variable And Building A Db Ejection Or Put The Variable?

Jul 20, 2009

The variables below are passed into itemdetails2.php

PHP Code:

<a href="itemdetails2.php?id=". $content['id'] ."&platename=".$content['platename'].""> 

In itemdetails2.php I pull the variables from the url making available through out the whole script in itemdetails2.php by:

PHP Code:

<?php $shoename =  $_GET['platename'];$id = (int)$_GET['id'];if( $id === 0){    exit('ID can only be an integer');}?>

After I make it available through out the whole script in itemdetails2.php I want to build a sql injection that takes the value of the variable $shoename and put it inside the OutputRating method parameter below

PHP Code:

<?php      $ratingData = Rating::OutputRating('paul');            if (Error::HasErrors())      {        echo Error::ShowErrorMessages();  Error::ClearErrors();      }      else      {        echo $ratingData;      }    ?>

Notice in the parameter it says paul instead of paul I want it to contain the shoename variable value in the url.

[php]

PHP Code:

<?php $shoename =  $_GET['platename'];$id = (int)$_GET['id'];if( $id === 0){    exit('ID can only be an integer');}?><?php      $ratingData = Rating::OutputRating('$shoename');            if (Error::HasErrors())      {        echo Error::ShowErrorMessages();        Error::ClearErrors();      }      else      {        echo $ratingData;      }    ?>

is that correct to put $shoename variable in there just like I did in the last embed script?

View 1 Replies View Related

Send A Simple Variable Like A Result From A Query To Flash?

May 29, 2001

How to send a simple variable like a result from a query to Flash?

View 1 Replies View Related

Image Upload - Using A Variable Passed From A Flash Page

May 31, 2005

i'd like to pass a variable using post into the following form (that is from php.net)
using a variable passed from a flash page (i'm competent in flash but a novice in php)how do integrate:

$folder = $_POST['folder']."/";

into the form so that when submit occurs the folder path is passed to upload.php :

<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="upload.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

View 4 Replies View Related

Adding Advanced Flash Code & JavaScript To A Variable

Jul 13, 2007

I have a PHP variable named flash, and within it I have the <object> element which creates the flash output. So whenever i call the variable i get the flash.

Now the problem is that I am getting the "click to activate and use this control" box which I want to get rid of. So to do this I want to add the AC_RunActiveContent.js script to this variable. Is this possible? If so how do I write the code? This is the code I have already: Code:

View 9 Replies View Related

Flash AS2 - Saving Variable Imported From MySQL Into SharedObject?

Feb 14, 2010

I am creating a game which uses the sharedObject to save each players progress locally. It also connects to a central database to create an online scoreboard. When a user inserts a score for the first time a unique ID is sent out of the database to the swf and saved as part of the sharedObject data.

Absolutely everything works and the ID is saved to the sharedObject, however when the swf is restarted the ID does not load (even though the other variables saved in the sharedObject do load). I think it may be to do with the way it is formatted, perhaps to do with the XML but I'm not sure.

[Code.......]

View 2 Replies View Related

Jquery - Can't Access $_SESSION Variable In Called From Flash?

Jan 15, 2010

I'm having difficulty accessing a $_SESSION variable.I have session_start() at the beginning of the file.I'm using jQuery uploadify and it calls a php backend file, which can't access $_SESSION variables, although other files outside could.

Could it have something to do with the way that flash (jquery uploadify) is calling the php? Does anyone know how to circumvent this?

UPDATE: included session_id in the url but it didnt work.

$('#image_upload').uploadify({
'uploader': '../../frontend/jquery/plugins/uploadify/swf/uploadify.swf',
'script': "controllers/image_upload.php?SID='.session_id()'",[code]....

EDIT: i think i know what the problem is.in the header information with livehtmlheader in FF it shows an error message:

HTTP/1.x 404 Not Found

while the other regular page requests shows

HTTP/1.x 200 OK

EDIT: sorry i've had wrong. it was not cause by 404, that was a request to another file. there is NO request when posting with uploadify! no html header is sent. i think it uses another approach to get the php file with flash (uploadify.swf). so there is no way of sending that sessid to my php file now i guess:( have to find some other way around

View 3 Replies View Related

Set Dynamic Variable Names, As These Variables Will Be Returned To My Flash Movie.

Oct 18, 2005

I'm currently using php to connect to a mysql server. Having done so, I was wondering if it was possible to set dynamic variable names, as these variables will be returned to my flash movie.

For example, I'd like the name point_<1,2,...,20>

So would it be possible to do

for($i = 1 ; $i <= 20 ; $i++) {
print ""point_"+$i = $row($i)";
}

View 5 Replies View Related

Color Code Passed To Flash Variable In Twitter Badge

Mar 12, 2009

I'm trying to create a simple interface to automate the creation of a flash twitter badge for a WordPress theme. My question is this, on the twitter page which has a simple color customizer, the standard hex color codes are getting translated to something to be passed to the flash as a variable.

Can anyone shed any light on what that color code system is? And possibly how I might write a PHP function to translate a six-digit hex code into that system?

View 1 Replies View Related

SQL Injection Prevention - Variable $action Is Also Coming From Flash (but Is Not Inputted By A User)

Oct 22, 2010

I have the following Working php script (receives the variables from Flash)

//LOGIN!
if ($action == "login")
{
//retreive data from flash
$username=mysql_real_escape_string($_POST['Username']);
$password=mysql_real_escape_string($_POST['txtPassword']);
$result = mysql_query("SELECT name, activated from buyers WHERE email = '$username' AND password = md5('$password')");
[Code]...

As you can see I have used mysql_real_escape_string for the variables $username and $password that are coming from Flash. For example: Does $action == "login" need also mysql_real_escape_string ?? That variable $action is also coming from flash (but is not inputted by a user)

View 1 Replies View Related

Security - Rijndael Encode FLASH Decode - Pass Encrypted Data To A Flash

Jun 24, 2011

I am trying to pass some encrypted data to a flash , but I got stuck somewhere in the middle. Im using RIJNDAEL algorithm to encode the data in PHP :

function encrypt($text){
$key = "53cded30ff7ba54d65b939fd594e3d63";
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); //get vector size on CBC mode
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); //Creating the vector
$cryptedtext = mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_CBC, $iv); //Encrypting using
[Code].....

And im using the AS3CRYPT library to decrypt the value in flash. The problem is that if I try to decode the value in flash or even in the demo of AS3CRYPT, it doesnt work. I also tried to return the data from PHP encoded with base64_encode but still not working. The output from PHP is something like : ....

View 1 Replies View Related

Save Image From Flash And Return URL String To Flash

May 20, 2011

I use this code to convert an image to a BitmapData and store a JPG in a ByteArray.

import com.adobe.images.JPGEncoder;
var jpgSource:BitmapData = new BitmapData (img_mc.width, img_mc.height);
jpgSource.draw(img_mc);
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
// here we need some code to send the bytearray but I lack enough knowledge to do it by myself

Now, I want to do the following: 1. send the ByteArray to PHP; 2. PHP must store a physical image_id.jpg on server; 3. then PHP must return the URL of the image to Flash; Is this possible? How? The first lines of PHP could be:

if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
// but I don't know how to save the image on disk and how to return the URL of the //image
}

View 1 Replies View Related

Use Sockets With Flash To Create A Multiplayer Flash Game?

Mar 18, 2010

i was wondering is it possible to use php sockets with flash to create a multiplayer flash game? i've seen some servers free and paid for flash over the google but i would like to use something made by me and since i don't know java or c++. can anyone offer me some alternatives.

View 2 Replies View Related

Not Passing My Variable

Jun 5, 2003

I have a session variable that looks like this.

View 5 Replies View Related

Passing Of Variable

Jun 21, 2002

I declared my variable as global and used it to hold a query result but the variable is not passing its value to another php page where I need it again for another query something like this:

1st php page:
global $comp

$result = "Select Company from dbtable where Name = ABC";
$comp = $mysql_query($result);

2nd php page:
$query = "Select Branch from dbtable2 where Company = '$comp'";

View 1 Replies View Related

Passing Variable To Url.....

Jun 29, 2000

Let say i am to pass avariable with its value to an url using php,like

www.mycom.com.my?id=<?php echo "$id"; ?>

then, the url will display the address with www.mycom.com.my?id=1234 right? So, is it a way to hide the variable and value?

View 1 Replies View Related

Variable Passing Through URL?

Sep 8, 2007

This part of my scripts doesn't work: PHP Code:

View 3 Replies View Related

Passing URL Variable Into DB

Jul 16, 2003

I am using php with mysql. I am trying to develop a website that will pass a URL into a database. I recieve the variable in the url as id=1727719 and want it to be inserted into the id field of my database.

View 2 Replies View Related

Passing Variable's

Mar 30, 2006

I have a drop down menu as follows

Status <select name="status"><option value =><option value ="Prospect">Prospect<option value="Purchased">Purchased<option value ="Closed">Closed<option value ="Future Prospect">Future Prospect<option value ="cancelled">Cancelled</select></p>

the values are sent to a page for processing. I then have a query to select from the db the row based on the selected value.

$sql = ("select $name from cust where regdate between '$startdate' and '$edate' and status = '$status'");
$result =mysql_query($sql) or die;

The problem I'm having is that if the field is left blank I need the sql query to get all the records. Right now if is blank I don't get anything.

View 1 Replies View Related

Passing A Variable

Mar 23, 2004

i use a language file, where all my variables are declared ( english.php ).

on my index.php page i use $_GET to select the language.. so that is
index.php?lng=english

my question is how can i transmit my variable $lng to my other pages.. i know that it might seem a very dumn question to you.. but.. i'm just learning.

View 1 Replies View Related

Passing In URL Variable

Jun 22, 2005

How do you pass in a variable via URL without a pre-built static array? I know this has to be possible somehow because it's used in all sorts of scripts, especially forums, like with topic IDs and what not. The script I'm working on right now passes the name of a script in to a download.php file, then it uses that to find the right row in a MySQL database marked with the same name, to add one to the download count and fetch the filename to download.

View 2 Replies View Related

ADVERTISEMENT