Listbox form using Flash and PHP
Hi,
I am trying to create a form that includes listboxes in
Flash. The datas are then sent to an email through PHP.
Thing is: i havent found any actionsript to do that with
Listboxes.
Can anyone help me?
Cheers.
>> Thing is: i havent found any actionsript to do that
with Listboxes.
Do you mean List components? There's no special script - it'd
be the same
for sending any data to PHP. You just need to use the methods
of the
component to first get out the data you want to send.
Can you be more specific as to the problem?
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Similar Messages
-
Highscore list using Flash and PHP
Hi,
I want to make a highscorelist using AS3 and PHP(MySQL).
I cant find a good tutorial on internet how to make something like that but I got this so far:
import fl.controls.TextInput;
import fl.controls.TextArea;
var variables:URLVariables = new URLVariables();
variables.name = "Wil";
variables.final = 2000;
var request:URLRequest = new URLRequest();
////insert in the location of the php script ////////////////
request.url = "http://www.justenter.nl/script.php";
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.load(request); //sends the request
//when the request is done loading, it goes to the completeWriting function
loader.addEventListener(Event.COMPLETE, completeWriting);
function completeWriting(event:Event):void {
var writingCompleted:TextField = new TextField;
writingCompleted.autoSize = "center";
writingCompleted.x =200;
writingCompleted.y= 200;
writingCompleted.text = event.target.data;
addChild(writingCompleted);
He is sending the score and name to the database but he is doing that when i press ctrl-enter. He is sending the data I have given in:
variables.name = "Wil";
variables.final = 2000;
I want a input textfield and a button. And When I fill in my name in the input textfield he send it to the database when I press the button.
Is there someone that can help me out?
Tnximport fl.controls.TextInput;
import fl.controls.TextArea;
var variables:URLVariables = new URLVariables();
//variables.name = "Wil";
//variables.final = 2000;
var request:URLRequest = new URLRequest();
////insert in the location of the php script ////////////////
request.url = "http://www.justenter.nl/script.php";
request.data = variables;
var loader:URLLoader = new URLLoader();
submitBtn.addEventListener(MouseEvent.CLICK,submitF); // where submitBtn is your button
function submitF(e:Event){
variables.name=nameTF.text; // where nameTF is your input texfield
variables.final = score; // where score is the variable you use to tally user score
loader.load(request); //sends the request
//when the request is done loading, it goes to the completeWriting function
loader.addEventListener(Event.COMPLETE, completeWriting);
function completeWriting(event:Event):void {
var writingCompleted:TextField = new TextField;
writingCompleted.autoSize = "center";
writingCompleted.x =200;
writingCompleted.y= 200;
writingCompleted.text = event.target.data;
addChild(writingCompleted); -
I am trying to make an app for my Cab Company and was going to add a reservation form, however idk if you can add html code or how to make one with as3, and I haven't been able to find a decent tutorial anywhere online.
You will need to find a tutorial for sending email via AS3 (normally requires a PHP or other server-side processing file). Search Google using terms like "AS3 send email tutorial" and develop things from there.
-
Remove duplicates using flash and php in a .csv file
Hi all,
I am trying to have a frontend in flash that uploads data
from a csv file to a mysql database. A user selects the file to
upload, the user enters the number of columns in the csv file into
a input textbox in flash so that a databse can then be created
dynamically in the mysql database according to the column size and
then uploads the data. I am sure this is possible but i have tried
and searched in vain. Do you have any knowhow about this?
Much appreciated.No one answered so I did it on my own...will post it on my
server after configuring it for it. I tried it with a file size of
3 MBs and works fine. Considering that there are add-ins for excel
to remove duplicates, i think mine is fine as long as the
duplicates are in the first column...but that can be easily changed
huh...:) -
Contact forms in Flash (AS3/PHP)
Hello,
I have created a form in flash (CS5) using AS3 and Php.
The test run worked absolutely fine but now I have added the form to my (original) flash movie it has a number of errors come up...
Thing is that I've just spent the last 2 hours trying to get this form to work and having no success what so ever.
So does anyone know what the following complier errors mean and how I can solve this issue?
Scene 1
1152: A conflict exists with inherited definition flash.display:DisplayObject.name in namespace public.
ComponentShim (Compiled Clip), Line 1
5000: The class 'fl.controls.TextArea' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
ComponentShim (Compiled Clip), Line 1
5000: The class 'fl.controls.TextInput' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
ComponentShim (Compiled Clip), Line 1
5000: The class 'fl.controls.UIScrollBar' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
ComponentShim (Compiled Clip), Line 1
5000: The class 'fl.controls.Button' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
Yes, I'm obviously a newbie and still getting to grips with flash so any help would be amazing!
Thank you in advance,
Josadd those components to the library of your main (ie, loading) fla.
-
I use a Flexislider for my website [url removed] I want to use flash and make my website attractive. Any suggestions?
Will people be able to login to the FTP server from my website and do everything through their browser?
Users could use web based ftp client or a 3rd party ftp client.
Have look at the sytem the following school uses.
http://www.glenbard.net/Glenbard_DistrictHQ/Media/MOVs/Web-BasedFTPClient.html
Although I have not setup this type of thing up myself googling around shows a few tutorials using PHP or Java based ftp clients.
have a look at this article.. -
High Score Table: Writing a Simple Text File with Flash and PHP
I am having a problem getting Flash to work with PHP as I need Flash to read and write to a text file on a server to store simple name/score data for a games hi score table. I can read from the text file into Flash easily enough but also need to write to the file when a new high score is reached, so I need to use PHP to do that. I can send the data from flash to the php file via POST but so far it is not working. The PHP file is confirmed as working as I added an echo to the file which displayed a message so I could check that the server was running PHP - the files were also uploaded to a remote server so I could test them properly. Flash code is as follows:
//php filewriter
var myLV = new LoadVars();
function sendData() {
//sets up variable 'hsdata' to send to php
myLV.hsdata = myText;
myLV.send("hiscores.php");
I believe this sends the variable 'myText' to the php file as a variable called 'hsdata' which I want the php file to write into a text file. The mytext variable is just a long string that has all the scores and names in the hiscore. OK, XML would be better way of doing this but for speed I just want to get basic functionality working, so storing a simple text sting is adequate for now. The PHP code that reads the Flash 'hsdata' variable and writes it to the text file 'scores.txt' follows:
<?php
//assigns to variable the data POSTed from flash
$flashdata = $_POST["hsdata"];
//file handler opens file and erases all contents with w arg
$fh = fopen("scores.txt","w");
//adds data to file
fwrite ($fh,$flashdata);
//closes file
fclose ($fh);
echo 'php file is working';
?>
Any help with this would be greatly appreciated - once I can get php to write simple text files I should be ok. Thanks.Thanks for your help.
I have got Flash working to a certain extent with PHP using loadVars but have been unable to get flash to receive a variable declared in PHP. Here's my Flash code:
var outLV = new LoadVars();
var inLV = new LoadVars();
function sendData() {
outLV.hsdata = "Hello from Flash";
outLV.sendAndLoad("http://www.mysite.com/hiscores/test23.php",inLV,"post");
inLV.onLoad = function(success) {
if (success) {
//sets dynamic text box to show variable sent from php
statusTxt.text = phpmess;
} else {
statusTxt.text = "No Data Received";
This works ok and the inLV.onLoad function reports that it is receiving data but does not display the variable received from PHP. The PHP file is like this:
<?php
$mytxt =$_POST['hsdata'];
$myfile = "test23.txt";
$fh = fopen($myfile,'w');
//adds data to file
fwrite($fh, $mytxt);
//closes file
fclose ($fh);
$mess = "hello there from php";
echo ("&phpmess=$mess&");
?>
The PHP file is correctly receiving the hsdata from flash and writing it to a text file, but there seems to be a problem with the final part of the code which is intended to send a variable called 'phpmess' back to Flash, this is the string "hello there from php". How do I set up Flash and PHP so that PHP can send a variable back to Flash using echo? Really have tried everything but am totally baffled. Online tutorials have given numerous different syntax configurations for how the PHP file should be written which has really confused me - any help would be greatly appreciated. -
Array data between Flash and PHP
As the title suggests, I'm trying to find a good way of
getting an ActionScript/Flash dynamic array into PHP, so I can
serialize it and store it in a DB, then simply give back that same
array when it's called. Are there any popular techniques? The array
will always be a different size, containing different values -
which is why I'd like to keep the array in tact, to minimise the
amount of parameter transfers. If there's no good solution, I
suppose I could pass in parameters and read them in, create an
array and serialize that... but I'd much rather find a way of
having my flasher serialize his own array and pass me the
byte-code. Is this possible?
PHP doesn't need to read the contents of the array, simply
store it in a DB, so if there's some kind of flash method for
serializing an array into bytecode that it can unserialize and read
back later, that would be awesome.
Thanks. =]
[edit]
I found this:
http://sourceforge.net/projects/serializerclass/
a serializer class. Is this the best method?Sorry, I should have explained, we already use XML for data
transfers (though I personally find JSON much nicer with less
overhead). So, in this project, we use XML for data transfer
between flash and PHP/Database. The reason I wanted this
functionality, is because the flash array, in this one case, will
be completely dynamic and the PHP doesn't need to know the contents
of the array at all. In fact, in this instance, PHP is just the
mechanism used for storing the data. Becuase of the nature of the
data, I wanted to serialize the flash array, store it in the
database as Bytecode, then when the flash needs that information
again, I can pass back the same bytecode, which can then be
unserialized back into the original array.
I think I've found the solution, the one I linked in the
original post. I should know if it's as effective as I want it to
be in the next couple of days when my flasher gives it a try. =]
Thanks for the responses. If anyone has any other ideas,
please throw them in here. -
Hello guys..does anybody know how to install and use adobe master collection with the new lion?
I need to use Flash and illustratore, but apparently those programmes are incompatible with the new operative sistem...
I am a new mac users and I'd like to know if there are other similar programmes I can use with lion!Lab79 wrote:
Are you on Apple's payroll?
well dude I can only let you know that as I work with those programme I don't have to pay for it is my company that pays the programme I whant to use( that's why I was asking if there where other programmes ..that I could use with lion insted that Illustrator and Flash!)..I know Adobe since 2005 and I can say that Adobs products are very good...I think that if it's an Adobe probleme or fault ..they will solve it very soon...but unfortunally I have the impression that after Jobs passed away Appel decided to change politics..and everything started to go very bad! (see FCP X)..
good luck with apple dude..
Where is the Apple problem? I have CS4 and CS5 running perfectly fine on my Macbook Pro. Installed 5 after Lion upgrade. Worth every cent. Adobe did have some catching up to do with Lion but with the CS5.5 update all runs fine. But not yours. So it is a problem with the Lion OS? You say you have been with Adobe since 2005. So you would be aware of all the other issues that Adobe had catching up with past Oss in Mac and Windows then. They get it right, but it is up to them. It is not up to Apple, nor Microsoft for that matter, to run around and check that every software developer in the world is running their business properly.
And what has politics got to do with anything. Some people just have to blame Software for their poor Hardware maintainence of failure of the same.
<The only think I can really do is to go back on my old windows...give back this orrible lap top and ask for my money back!>
Great suggestion. You should go with that one, but good luck getting a refund.
Bye -
How to create a dynamic newsflash using dreamweaver and PHP
Hi there,
I would like to create a dynamic newsflash using dreamweaver and PHP in that the newsflash will be pulling information from a MySQL database. The newsflash should also have a link to view more information about the piece of news a user wants to know more about. Which tools do I need to use in dreamweaver and how's the procedure to go about that. Any advice is highly appreciated. Thanx in advance!I think you´ll need at least a MySQL table with the following columns:
- id (primary key, int, auto_increment etc)
- news_headline (varchar)
- news_teaser (text)
- news_content (text)
What I´d personally add are columns such as:
- news_date (date or datetime)
- news_external_link (varchar), if a "read more..." link is supposed to navigate to an external URL rather than displaying the contens of the "news_contents" column.
Based on such a MySQL table it should be easy to use Dreamweavers standard Server Behaviors to create the usual datalist.php, insert.php, update.php and delete.php documents, and there are numerous tutorials out there which will teach you how to do that.
Am I right when assuming that you´ll also need to know how to automatically pull, say, the 5 most recent news records from the database ? -
I made a fillable form using indesign and then acrobat professional but need to have radio buttons trigger different fields showing in the form below them - is that possible and if so how do I do it??
What version of Reader are they using, exactly? And are you sure they're
using Reader itself and not opening the file inside a browser window, for
example?
On Fri, Feb 6, 2015 at 5:24 PM, jessicao96457206 <[email protected]> -
Flash and PHP contact form.
Hi, I created a simple web site in flash cs4 with a contact form, however, when I press submit, no email is sent even though my site says it was successfully sent. If anyone could give any advice on what I could possibly being doing wrong that would be great.
Thanks, Anthony.
Here is my actionscript and PHP:
function submit(e:MouseEvent):void
var variables:URLVariables = new URLVariables();
variables.fromname = nameText.text;
variables.fromemail = emailText.text;
variables.frommessage = messageText.text;
var req:URLRequest = new URLRequest("contact.php");
req.data = variables;
req.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
statusText.text = "Sending...Please wait.";
function sent(e:Event):void
statusText.text = "Your email has been sent.";
nameText.text = emailText.text = messageText.text = "";
function error(e:IOErrorEvent):void
statusText.text = "Error, please try again.";
sendButton.addEventListener(MouseEvent.CLICK, submit);
PHP:
<?php
$sendTo = "[email protected]( I am aware this needs to be different)";
$subject = "Email from Web site";
$name = $_POST['fromname'];
$from = $_POST['fromemail'];
$message = $_POST['frommessage'];
$message = stripslashes($message);
$content = "Name: " . $name . "\n";
$content .= "Email: " . $from . "\n\n";
$content .= $message;
if (mail($sendto,$subject,$content))
echo 'response=passed';
else
echo 'response=failed';
?>I had the correct case in my code, so that was not the problem. It appears that the there is no communication with the server. Do you have any other ideas as to why the send button would not actually being contacting the server?
Thanks for the help -
Using databases with Flash and PHP
Hi, everyone!
I`m a PHP newbie. I just learned PHP so that I can use
databases with Flash.
I`ve got a .php script that contains html that loads up my
.swf file. The .swf file is the core of my site. What I want to
know is if I can call some PHP functions (that I have wrote in the
.php script) from within the .swf file... This functions would
perform the reading and updating of my database.
The only way I know of to modify a database from Flash is
using the POST and GET methods. But that opens up a new browser
window in which the PHP script is called. And that only handles
writing in the database. So, what if I just want to read from the
database some values and insert them into a TextField in Flash? How
do I do that?
Thanks! Ardy1. Goggle "Flash and mySQL" and you'll get a listing of alot
tutorials
2. I'm also just learning. Here's a great URL to start:
Building with Flash and MySQL
That's right, a Flash-based blog — it sounds a little
loony, but this blog pulls content from a MySQL database and feeds
it into the dynamic Flash frontend ...
www.webmonkey.com/programming/php/tutorials/tutorial2.html -
20k - Cached - -
Using MySql and PHP with Dreamweaver on a Mac
Hello all,
As always if the answers to these questions are obscenely
obvious please humour me.
I use XHTML and CSS in my websites and realise that it is
time that I dabbled with SSI. So I've started using PHP.
However, I have been following the installation directions of
MySql and am running into problems. I am installing the relavent
software and am then unable to find it on my Mac, the startup files
are there but the actual MySql data appears to not be installed
despite my computer telling me it is...... I am using a G3 running
OSX 10.4 is this good enough? I noticed talk of needing a PowerPC
or Intel mac. Is this the case?
Also, would I need MySql installed on my actual computer if
the my servers have it already? And does Dreamweaver 8 have both of
these programs installed as standard?
If you could help out I would be very appreciative as I would
like to learn this stuff and I appear to be struggling at the
outset....
Cheers
M.AM.A.Wilson wrote:
> However, I have been following the installation
directions of MySql and am
> running into problems. I am installing the relavent
software and am then unable
> to find it on my Mac, the startup files are there but
the actual MySql data
> appears to not be installed despite my computer telling
me it is...... I am
> using a G3 running OSX 10.4 is this good enough? I
noticed talk of needing a
> PowerPC or Intel mac. Is this the case?
MySQL is a relational database management system that
comprises a
database server and several utility programs. Although you
install it
like any other program on a Mac, the similarity stops there.
First, the point about PowerPC and Intel Macs is that there
are
different versions of the MySQL installer for each type of
processor.
I'm pretty sure that a G3 is OK, but you must choose the
PowerPC version
of MySQL, not the 64-bit or x86 (Intel Mac) version.
Once you have installed MySQL, you need to drag the
MySQL.PrefPane icon
from the disk image onto your System Preferences. This
installs a
Preference Pane that enables you to start and stop MySQL. The
Preference
Pane has an option to start up MySQL automatically, but in my
experience, it doesn't work on Tiger. You need to open the
Preference
Pane, and click Start MySQL Server each time you start your
computer.
The best way to work with MySQL is to use a graphical
interface, such as
phpMyAdmin. As Osgood has mentioned, I have written a book
about PHP and
Dreamweaver, which goes into all the necessary details. It's
also very
Mac-friendly with separate instructions where necessary for
PC and Mac.
More details here:
http://foundationphp.com/dreamweaver8/
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
Creating a file on server, using Flash AS3 + PHP
I have a very simple PHP script that creates a new file on my server using a random number for the file name (e.g., 412561.txt). When I load the script directly from a browser, it works. But when I load the script from a very simple Flash (AS3) script, it does not work (i.e., doesn't create a file). The Flash script and PHP script are both in the same directory. Permissions on the directory and its content are 755. Temporarily setting those permissions to 777 does not solve the problem (i.e., PHP still doesn't create file when called via Flash).
Here is my phpinfo.
Here is the PHP file.
The contents of the PHP file are:
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$RandomNumber = rand(1,1000000);
$filename = "$RandomNumber" . ".txt";
$filecontent = "This is the content of the file.";
if(file_exists($filename))
{$myTextFileHandler = fopen($filename,"r+"); }
else
{$myTextFileHandler = fopen($filename,"w"); }
if($myTextFileHandler)
{$writeInTxtFile = @fwrite($myTextFileHandler,"$filecontent");}
fclose($myTextFileHandler);
?>
Here is the html container for the Flash script. The Flash script features a single button which calls the PHP script when pressed. In case it helps, here is the raw Flash file itself. The code of the Flash script is as follows:
stop();
var varLoader:URLLoader = new URLLoader;
var varURL:URLRequest = new URLRequest("http://www.jasonfinley.com/research/testing/TestingSaveData.php");
btnSave.addEventListener(MouseEvent.CLICK,fxnSave);
function fxnSave(event:MouseEvent):void{
btnSave.enabled=false;
varLoader.load(varURL);
Directory listing is enabled at the parent directory here, so you can see there when a new text file is created or not. (Um, if this is a security disaster, please let me know!)
Can anyone please help me understand why this isn't working and how I can fix it? Thank you
~jason#1, Yes that is a security risk, please disable directory index viewing.
#2, Always validate. I see no issue with the code you're using but clearly it's not working. The way you find out is your trusty errors.
Make a new document (or paste this into your existing) where a button with the instance name btnSave is on screen:
// import required libs
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.MouseEvent;
import flash.events.SecurityErrorEvent;
import flash.text.TextField;
// assign handler
btnSave.addEventListener(MouseEvent.CLICK, fxnSave);
// make a textfield to display status
var tf:TextField = new TextField();
addChild(tf);
tf.width = stage.stageWidth;
tf.height = 300;
tf.multiline = true;
tf.wordWrap = true;
tf.selectable = false;
tf.text = "Loading...\n";
// just making sure the textfield is below the button
this.swapChildren(tf,btnSave);
function fxnSave(event:MouseEvent):void
// disable button
event.currentTarget.enabled = false;
// new loader
var varLoader:URLLoader = new URLLoader();
// listen for load success
varLoader.addEventListener(Event.COMPLETE, _onCompleteHandler);
// listen for general errors
varLoader.addEventListener(IOErrorEvent.IO_ERROR, _onErrorHandler);
// listen for security / cross-domain errors
varLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _onErrorHandler);
// perform load
varLoader.load(new URLRequest("http://www.jasonfinley.com/research/testing/TestingSaveData.php"));
// complete handler
function _onCompleteHandler(e:Event):void
tf.appendText("Load complete: " + e);
// error handler
function _onErrorHandler(e:Event)
if (e.type == SecurityErrorEvent.SECURITY_ERROR)
tf.appendText("Load failed, Security error: " + e + " type[" + e.type + "]");
else if (e.type == IOErrorEvent.IO_ERROR)
tf.appendText("Load failed, IO error: " + e + " type[" + e.type + "]");
I get a Event.COMPLETE for mine, so the PHP script is definitely firing. Change the URL to something invalid and you'll see the IOErrorEvent fire off right away.
That leaves you to diagnose the PHP script. Check your error_log and see what is going wrong. You're suppressing errors on your file write which doesn't help you locate the issue saving the file. If you want to handle errors yourself you should do the usual try/catch and handle the error yourself (write a debug log file, anything).
Maybe you are looking for
-
DECODE(User Je Category Name,'%REV%',SUBSTR(Jnl Line Description,12,20)) Could you suggest some way of doing this please? Thanks
-
Iphone not recognized in itunes after upgrade to snow leopard
after upgrading to snow leopard, iPhone not recognized in iTunes & does not show up. Account OK in iTunes. Any idea how to resume normal sync ?
-
Compilation issues: Cannot find in import
Hi, I am trying to compile some java code on a specific system, but I get following errors for almost every java file I try to compile: % javac ABC.java ABC.java:3: Class Session not found in import. import Session; ^ ABC.java:4: Package javax.servle
-
Accounts that have not been logged into for more than 90 days
Hi Folks, Good Day. Can anyone help me to update below powershel script? below script find in my domain all the AD users accounts that have not been logged into for more than 90 days and export the report to .csv file. in addition what I want: 1. OU=
-
Save as name not searchable in E72
Hi! just started using my E72. I really like this phone! However: I got one issue that is rather important for me: When I save a contact in outlook I use the "Save As" frequently to organize contacts that are functions, not named people. Eg: "Support