Forms in Flash withos PHP or database
I would like to male an easy mail-form in a Flash-movie. Just
one line where you can put in you mail-address and then a
Send-button. Do I have to database/PHP for this? Im not that
familiar with database-coding.
No, you don't need a database. You can use something like so:
var email = theEmail.text;
getURL("mailto:[email protected]?subject=New web
email&body="+email,
"_blank");
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Similar Messages
-
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.
-
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/ -
I need to create a desktop app for windows. Im using Flash cs5.5 and I wanted to know of an easy to way to create a simple contact form that would work once installed on a desktop/
Thanks guys for any input!If you want a contact form you can either use StageWebView or HTMLLoader to show an HTML page in your web server with a contact form.
Or you can create the form with Flash textfields and then send the whole thing with a POST request to a PHP script in the server, for example. -
Formating numbers in a form after retrieving from an SQL database
Hello everyone,
I am using php to populate a form using numbers taken from an sql database. I am having a hard time showing decimal places in those numbers. The code I am using in the value section of the form is:
value="<?php if (isset($_POST['unit_price_1'])) {
echo htmlentities( $_POST['unit_price_1'], ENT_COMPAT, 'UTF-8');
} else {
echo htmlentities($row_getInvoice['unit_price_1'], ENT_COMPAT, 'UTF-8');
} ?>" />
This code rounds all numbers up and eliminates decimal places. I am trying to show dollars and cents.
How do I alter the code to accomplish what I want.
JeffNot sure what might come in your way here, so I just made the following simple test by using a static value rather than one which gets derived from a recordset (the source shouldn´t matter), and this works well for me without seeing the value altered in any way:
<?php
$value = "10.22";
?>
<input type="text" name="whatever" value="<?php echo htmlentities($value, ENT_COMPAT, 'UTF-8'); ?>" />
However,. for displaying numeric values you really don´t need to use htmlentities/ENT_COMPAT etc etc -- that´s something you´d rather use for displaying textual contents containg special characters like umlauts and such.
If all you need is to add some degree of protection by escaping special HTML characters (<, >, &, etc.), the function htmlspecialchars() will only be escaping just these characters and leave the rest "as is", whereas htmlentities() is notably more rigi, because this function will convert all applicable characters to HTML entities -- but again: at this point you´re just *displaying* some numeric value, that is, such security measures are pretty much pointless in this scenario, because there´s nothing to protect from ;-)
Please test what happens when doing away with the htmlentities - thing.
Cheers,
Günter -
How do I create a web form in flash that calculates both
sub-totals and total cost? (Or an 'add to basket'' page?)
Is it better to create HTML web form outside of flash?You need some kind of shopping cart product. This is the
easiest way. I don't know of many for Flash but there are several
for Dreamweaver (I've used Cartweaver for a few project and it's
worked fine)
The only other way is create your own which would involves
ActionScript and database of prices and products, etc. -
Setting Parameters flash from php
Hi my name is guy.
I would like to set these parameters in flash using a
php/mysql database :
button1.maxQuantity
button1.name
button1.option1Name
button1.option1Value
button1.price ;
How would I go about doing that?
Thank You
Guy
Text1. The link seems to show what looks like a DataGrid
component. In any case you have a multi dimensional set of data you
need to attach to the send_lv. When the user selects an action to
send the data to the server, you need to assemble it from the
places you have it saved and attach to the send_lv.
2. I am confused about button1. I do not think Flash
Component Button component allow you to add variables. Plus the
name does not seem to mean anything so I cannot correlate it to the
screen. Is it the submission button? Are these the add to cart
buttons?
I think your problem is not so much sending data to PHP it is
more being able to have the data you need to send to PHP available
when the user takes that action. So perhaps you need to work on
displaying what you want to send in the Flash output window and
then worry about getting it to PHP. The LoadVars part is fairly
straight forward.
In general looking at the screen, you have items added to a
list display which represents a shopping cart. At some point the
user will interact to send the data to the server. The data needs
accessed in a way you can attach to the send_lv. Perhaps you can
simply loop through the display list. Or you could keep an internal
array of objects where each object defines the items and this array
is updated when add, edit and delete actions are taken by the user.
For example in the array of object scenario looping a list of
items we will be able to code like this:
send_lv.totalItems = cart.length;
for (var i:Number; i <= cart.length;i++)
send_lv["productId" +i]. = cart[1].productId;
send_lv["price" +i]. = cart[1].price;
send_lv["quantity" +i]. = cart[1].quantity;
On the PHP side you would have in $_POST or $_REQUEST
something like this
totalItems
productId1
price1
quantity1
productId2
price2
quantity2
productId3
price3
quantity3
But if the data is in a nice display component, looping
through the display component will save the overhead of an
additional storage place.
So are we seeing a List component or a DataGrid for the
shopping cart? That will help determine the code to pass the data
to send_lv. -
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. -
This is the issue...I'm creating an Email form in Flash 8 and
using 'sendAndLoad' to send variables to a PHP script. All
variables are sent correctly except for the 'message' part of the
email. The message is set up as a Multiline text input with word
wrap, but once the user filling the form presses "enter" to start a
new line, only the first line is sent. For example:
::: User Types:::
To Whom it may concern,
Asalskl alslfas ljs jsldjlasj sldfj
asldfj lsdjla aljd a lj;asdj
asldfjlj;lsdf l jl kj lkj.
Sincerly,
So and So
::: I Recieve :::
"To Whom it may concern,"
My actionscript is set up to loadVars as ' toPhp.message =
Message_txt.text; '
And my php is set up as ' $msg = $_POST["message"]; '
This could just be a bug in Flash, but I've seen other forums
with the same issue, but with no results. If anyone has gone
through this and has a fix or suggestion, I've tried
everything...please help!I don't think there's any bug. I just did a little test and
send the
contents of a multiline field to a php script and just echo
it out.
Everything is sent fine and enters are sent as %0D.
Dave -
Adobe Community Expert
www.blurredistinction.com
www.macromedia.com/support/forums/team_macromedia/ -
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 refreshed What is the solution , that after passing values the page remains or flash reamins as it is ( not refresh the contents )use:
var receiveLV:LoadVars=new LoadVars();
receiveLV.onData=function(src){
var myVal:LoadVars = new LoadVars(); myVal.flieName = "fileid1 "; myVal.sendAndLoad("file1.php", receiveLV,"POST"); } -
LoadVars-using send to pass a variable from flash to php
For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers'
books, googled 'flash to php', LoadVars, etc. and tried
sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS but I keep getting this same error. any advice
please?
I have a Unix server running Apache/PHP 4 - LoadVars worked
to load name-value pairs into an array -see thread)
My goal with this simple app is to prototype being able to
pass a variable from flash to a variable in php.
Parse error: syntax error, unexpected T_VARIABLE in
flash_to_SQL.php on line 5
Actionscript 2.0 code:
var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("
http://127.0.0.1/flash_to_SQL.php","_self","POST");
php code: (I also tried $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS)
<?php
//mysql 4.1.2, php 4 , NO mysqli
ecbo $_REQUEST ['testing'];
/?>var formData:LoadVars = new LoadVars();
formData.fname = "Name";
formData.send("
http://www.website.com/flash_php.php",
formData, "POST");
<?php
$name = $_POST['fname'];
echo $name;
?> -
What is the best form to control a open of database?
Hi,
what is the best form to open a database?
I´m understood that Environment is unique for all aplication, and I think that it is good to put on Singleton Pattern, but I don´t know the best form to do it with the databases.
I think two forms, the first is create a singleton open database, with this form I don´t will close the database and all application will use it. So, the second form is open a data base at the moment that I will use it, for example, into a DAO when I will do inserts, deletes, etc, and at the final of the operation I close the database.
So, I don´t know what form is the best, and if those forms are corrects, if exist another form to do it I would like to know.Hugo,
An application can choose to use one or more Environment and Database instances in a single process. In other words, it is the application's choice whether it wants to instantiate a single Environment or Database and share it among multiple threads, or whether it wants to instantiate multiple instances.
Choosing one pattern or another is a function of your application's design, and performance considerations. As you say, you could instantiate a single Database instance and pass it around, or you could open and close the Database every time you get a data record. A third choice is to open a Database instance per thread, and reuse that for the life of the application.
The second choice of opening and closing the Database per data record access is pretty heavyweight from a performance point of view. There is a fair bit of overhead to the initial open of a database, and to the final close. Follow-on opens are not as heavyweight, but do have some cost. For example:
// expensive
thread 1 calls Environment.openDatabase() or new EntityStore()
// less expensive, database is already open, thread 2 is really just getting a handle
// onto the database, but still more expensive than a read or write of a data record
thread 2 calls Environment.openDatabase() or new EntityStore()
The first choice of using a single Database instance in your process will perform much better. If your application has a high level of concurrency, there can be some contention on the Database instance, described in this FAQ - http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#32 and you may prefer to try the third option of using a Database instance per thread.
Regards,
Linda -
Can you create a form not using a php script?
I need to create a contact us form on my website using DW and have researched how and understand the easiest way is using a php script. Unfortuntately, my webhost server does not support this and will charge me an arm and a leg in order to to do it. Is there another way to have a functioning contact form not using a php script?
Yes and no.
You could use a mailto link for your form action instead of a PHP script.
There are several problems with this method though. First, when you do that, you are at the mercy of the viewer's computer set-up. Mailto links use whatever email client is installed on the machine in order to send the message. Public computers (libraries, colleges, etc) almost never have an email client installed, so when a viewer on one of those machines clicks the link, nothing happens. Secondly, your email address is open for spam harvesters, so you may end up with enlargement and nigerian scam emails flooding your inbox.
Since your provider doesn't give you a way to do it the right way on your server, you may want to look into email form services online and see if they are less expensive than your current alternative. -
How to create a comment form in Flash CS3
I am trying to create an add comment form in Flash cs3. I
have the background design and the text input areas and sub mit
buttons. But how do I get the submit button to add the comment to a
different area in the same flash file? My inputs and buttons are on
the left side of the stage and my display comments is on the right
side of the stage. How do I connect the two?The user types something into a text input space and when the
user then uses the submit button, you want that same, user entered,
text to display in another, different, text area? If that's the
case then make that second text area a dynamic textfield and set
its text property to the text property of the input text
space. -
How to send a number count to the PHP MySQL database everytime a details page is opened from the results page?
Assuming your DB table named 'stats' has fields for article_id, hits and the article id is passed to the detail page through the URL parameter article_id then your query would look like this:
mysql_select_db($database_XXXXXX, $XXXXXX);
if (isset($_GET['article_id'])) {
$article_id = $_GET['article_id'];
$query_hits = sprintf("UPDATE stats
SET hits = hits+1
WHERE article_id = %s", GetSQLValueString($article_id, "int"));
$hits = mysql_query($query_hits, $XXXXXX) or die(mysql_error());
Maybe you are looking for
-
ST-PI update need functional retest
Hi, The EWA report, shows the need to update the ST-A/PI "Service Tools for Applications Plug-In" and the Add-On ST-PI (Solution Tools Plug-In). In the first case, the note is clear about this question, but in the other case it the note 539977 doesn
-
Why wont my adobe creative cloud desktop install?
This is my first time using adobe creative cloud and I am having problems installing the desktop app. I am not reinstalling the app because I never had it downloaded it before so any solutions close to that will not help me. I am on windows 8.1.
-
There is a small dot that ripples in the center of the screen. I have an Early 2011 macbook pro 13 inch and it should not have any problems with it. Does anyone have suggestions?
-
Using CloneZilla I backuped up my MacBook Pro Retina with 512GB SSD with latest OS and bootcamp with Windows 7. During the backup I did get some error but it continued and verification at the end succeeded. However, I am still concerned and therefore
-
Hi, I am using Flex Grid in my project where i am successfully able to populate xml data dynamically. what i am doing here, I am dynamically generating the xml using httpservice. This HttpService is returning an XmlList that i am using to bind the gr