1) Passing a control itself as parameter into a function 2) Passing an id ( managed manually) of the control as a parameter into a function . Say for an array of controls I have ctrl_Array = [ my_btn, my_mc, my_dtg ] and corresponding id_Array[0,1,2] PS: If my question is difficult to understand, i just wanna know, if it is a good programming practice to pass control references among the classes as function parameters ?
when it comes to using php to pass xml items to flash. Could someone point me in the right direction?i have this xml setup that works fine when pulling in images:
Creating a flash project where users can visit the site, and turn off/on objects in a house (ie. lights, tv, computer, etc.) The next user who will visit the house in the website, will see what lights or house appliances were left on. Flash variables are passed to PHP, and those variables are saved in an XML file. (For testing to see what is being saved to the XML file, on each click --vars.xml opens.) In the vars.xml file, I see that the house objects that were last turned on--are saved in the XML file- But in the SWF file, only one of the objects that are listed in the XML are turned ON. Only the last object that was clicked on would show ON--not all the objects in the XML file.)
package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.events.Event; import flash.text.*; import flash.net.*; public class House extends MovieClip { [Code] .....
Can I pass values from fla to AS3. Example I have fla file where the xml faile loaded. Now I want to make button "Button 1" and "Button 2" now if I press the button it sent to AS3 values/variables. private var xmlURL:String = "xml/Button1.xml"; After buttone 2 is pressed is private var xmlURL:String = "xml/Button2.xml";
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)?";
Is there a way that I can pass the value of app: or appstorage: to a javascript file which has been included via URLRequest? I have a web application with an HTML5 video player, and I've been asked to get it to work as an AIR app. So far so good, except that there is a bug in jPlayer that requires you to use absolute file paths for media if you're using flash fallback. I need to get the file path of the app: or appstorage: directory on a users machine, and pass that to javascript so that the player can find my videos.
I have to pass some variables to the flash movie (movie.swf?var1=aaa&var2=bbb). never had a problem with using them before.I've read around a lot an tried different coding, but when I export the swf I got the error, that root is unknown...doesn't matter, if I use one of this
var flashvars:Object = root.loaderInfo.parameters; var flashvars:Object = stage.loaderInfo.parameters; // stage is unknown here.. var flashvars:Object = MovieClip(root).loaderInfo.parameters; var flashvars:Object = MovieClip(root.loaderInfo).parameters;
So, I read the tutorial about passing variables by changing the url of the .swf with the following code:
Code: if (movie==1 or movie=="") { trace("default"); }
[Code]....
My question is, is there anything special if I want it to respond to the url of a .php page? So, if I have a page that ends in "?page_id=2" could I do the same thing or does it have to be an .swf?
Code: if (page_id==1 or page_id=="") { trace("default"); }
i have 1 PHP page in which i have a Flash animation. this flash swf file, display 2 fields and 1 button.
this php page is called "test.php".
i'm able to send data from Flash to a PHP page, but i would like to send the content of those 2 fields to the "test.php" and display them. however, i do not know how to do it.
i see that it works but i'm not able to display or refresh the PHp page to display the result.
as walkaround i was thinking to collect the webpage address where is executed the flash and to send it to another PHP page. and this 2nd PHP page, will reload the test.php with parameters...
how to get under flash, the address of the actual executed php page ?
I have a problem using a very simple URLVariables script with php.The thing is this sample do works on some servers and doesn't on other:Instead of having the correct values with trace, I get the php code itself.That means I get the following string in trace():[code]I know it comes from the php configuration on my server because I tested it on another server and it works, but I can't find what I must change in my php.ini file to get the good results in trace();
I want to pass flasvars to my app usng php. I can get the php var from the url string fine and write it but i cant pass it through flash vars for some reason.The code im having issues with is in red.
Overview of Issue: A person will enter up to 8 words. Each word is then stored in a dynamically generated text box (responseTextArray[i]) within a dynamically generated movie clip (responseBubbleArray[i]). From here they will drag the bubbles into positions on the stage. Finally all of this information is to be stored in a database. To identify each entry, I put them into arrays. How can I pass all these arrays to a PHP script,so that I can store them in a MySQL database? Or, is there a better way to accomplish what I have described? The plan is to have each user entry and its attributes (response time, response text, x position of bubble, y position of bubble) stored as a row in the database.
What I want to do is to pass parameters from the browser to flash. I searched and seems like the best way is FlashVars. However, I have tried different codes and can't get Flash to detect the parameters. I decided to follow the example here and just copy and paste the whole thing (just changing the "main.swf" to my swf name): [URL]. The flash loads, but it only shows "param:" without anything else. I gathered that it probably is a more fundamental problem. (e.g. the way I am debugging, or some settings, etc.) I am using CS4 trial version AS3.
I am using AS2 and passing some values from flash to php, flash files is on page file1.php values are passing fine, it pass values when user click button. When button is pressed { var myVal:LoadVars = new LoadVars(); myVal.flieName = "fileid1"; myVal.send("file1.php", "_parent", "POST"); }
When it pass the values, it refresh the page and Flash File is also refreshed and Flash file start from frame 1 and all the values on flash becomes default in other words when user click "file1.php" is submitted, so the page is refreshed What is the solution, that after passing values the page remains or flash remains as it is (not refresh the contents).
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?
I was wondering is it possible to pass an array through the localConnection in flash? My local connects connect my flash application with the javascript and passes variables between them.
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:
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 .
I have an image uploader that runs on a separate PHP script, and then updates the Preview Url after the file has been uploaded. But what I'd like to do is have a Flash SWF embedded in the same HTML that's running the PHP Uploader to get that Preview URL and display it in the Flash Application.
i have a problem passing ByteArray from flash (as3) to amfphp to save an image.With old version of amfphp, all worked in the past... now, with new version i have many problem.I'm using version 2.0.1 and the first problem is that i have to do this, for access to my info:
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.
I normally send vars to php and build my query there, but this time I need to pass a complete query from Flash to PHP, but I'm having a little trouble:
I am using AS2 and passing some values from flash to php,flash files is on page file1.php values are passing fine , it pass values when user click button
when button is pressed { var myVal:LoadVars = new LoadVars(); myVal.flieName = "fileid1 "; myVal.send("file1.php", "_parent", "POST"); }
Problem : when it pass the values , it refresh the page and Flash File is also refreshed and Flash file start from frame 1 and all the values on flash becomes default in other words when user click "file1.php" is sumbitted , so the page is refreshedWhat is the solution , that after passing values the page remains or flash reamins as it is ( not refresh the contents )
I have a php file that loads 2 variables to a new php page that has flash embedded. This works fine, I can see the variables in a dynamic text box I created, the problem is that I need to take the 2 variables and put them together, then load it in a gotoAndPlay.It then should play at that time-line but it just plays from the beginning frame.[code]