PDA

View Full Version : {mx}how do i have an input text box write to html



Marc
November 24th, 2002, 11:13 PM
Hi all,


I'm trying to work out how to get an input text box, on the click of a btn, to send any text in it to a html page. I can do this in flash by having an input write to a dynamic text box but I'm not having much luck working out how to do this with a html page.

I kind of understand the document.write JavaScript and I'm getting my head round that now but I can't seem to find anything on the JS I need to do the above. Could someone point me in the right direction before my brain goes into over drive.

Thanks for any help with this

pom
November 25th, 2002, 07:49 AM
I guess you'll have to use FSCommands. I don't know how to use them, but I was advised this technote: http://www.macromedia.com/support/flash/ts/documents/tn4160.html

pom :cowboy:

pom
November 25th, 2002, 08:56 AM
Actually, a simple js function call might work. I don't know the first thing about js, but maybe something like that would work:
getURL("javascript:self.write(\"someStuff\")");You better wait for Lost on that one :)

Marc
November 25th, 2002, 08:30 PM
Thanks. I'll look into that now :)

lostinbeta
November 27th, 2002, 12:51 AM
Ilyas...do you mean this?...


on (release) {
myText = "javascript:document.write('<B>HELLO</B> <I>MY FRIEND</I>!!!')";
getURL(myText);
}

upuaut
November 27th, 2002, 01:26 AM
Question: I thought that there was a way to have flash actually create a new html page dynamicaly.. is that php and/or can someone point me in the direction of a good tutorial based upon that principal?

lostinbeta
November 27th, 2002, 01:28 AM
Never heard about it :-\

You could do it in Javascript, but that would take a lot of lines...LOL.

upuaut
November 27th, 2002, 01:30 AM
Well the data can be sent to the PHP script using loadVariables, and I know that PHP scripts can create html pages for the user to see.. or maybe that's PERL. damn it.. I wish that there were not 5 different major markup/programing languages. :)

lostinbeta
November 27th, 2002, 01:31 AM
No its PHP.

PHP is the newage (and easier and better) PERL.

I have no clue how to do that though, since I have very little knowledge of PHP.

upuaut
November 27th, 2002, 01:55 AM
Well I know that there are a couple of php masta's around here somewhere. They've been in and out. Hopefuly one will see this thread. :)

lostinbeta
November 27th, 2002, 01:56 AM
Dan told me "ask" is a PHP master.

h88 probably knows something too.

pom
November 27th, 2002, 11:09 AM
Originally posted by lostinbeta
Ilyas...do you mean this?...I don't know what I meant exactly :P Probably, yeah...

And about that page creating thing, I'm sure you can do it with PHP. Anybody saw that wiki thing work? (they have one at flashcoders and one on a French flash board) It's a real beauty. You type a link in your existing page. The page is created automatically. As simple as that. :o

lostinbeta
November 27th, 2002, 01:02 PM
That sounds cool :)

Raydred
November 27th, 2002, 04:10 PM
yea i want to expirement with Flash and PHP in writing HTML etc =) That'll be fuN!

Marc
November 27th, 2002, 07:46 PM
Hey, this PHP stuff has really interested me. I've been reading about it and have found out that I need a server to have php server capability and for me to test locally I need software to test .php files with htm files. Very new to this but very interested and am considering going head first into it.

What's the best program to install to test locally?

I use Dreamweaver MX and I've noticed in the Site Definition that I can set up this local testing. I've heard of Cold Fusion. Is that what I need to test my php projects?

Basically, I really need to know what to go out and buy without making any mistakes.

Thanks

h88
November 27th, 2002, 10:37 PM
Okay, here is what i've got:

======== Flash ========


dataHandler = new LoadVars();
dataHandler.bgcolor = "#AA6633";
dataHandler.textColor1 = "#000000";
dataHandler.bodyText = "this is some text";
dataHandler.send("Generator.php", "_blank", "POST");

======== PHP ========


<html>
<head>
</head>
<?
$bgcolor = $_POST['bgcolor'];
$textColor = $_POST['textColor'];
$bodyText = $_POST['bodyText'];

print "<body bgcolor=$bgcolor text=$textColor>";
print $bodyText;
?>
</body>
</html>

I think you all got the idea of the php script, tell me now what's yours. :)

yours,
h88

h88
November 27th, 2002, 10:40 PM
I just tested it, its working fine. :)

upuaut
November 27th, 2002, 10:42 PM
yeah that's what I'm talking about. :)

Marc
November 28th, 2002, 07:18 AM
With your script h88 I assume that I'd give the exetension .php to the php script above and save it with notepad and create a .swf with the above AS in the same folder for convenience. Then it genreates a html file?

Could someone be kind enough to tell me what software I should install to test php on my computer? Is Cold Fusion what I need?

Sorry if this is daja vu, it's that I just t-type away and end up saying something that could be said a lot more simpler:)

pom
November 28th, 2002, 07:28 AM
You can install easyPHP. Very easy, as it says.

And Coldfusion is coldfusion, not PHP.

pom :cowboy:

h88
November 28th, 2002, 11:27 AM
PHPTraid installs phpMyAdmin, MySQL, Apache, and PHP, all in one setup. Oh and btw, how about saving an HTML Page now. :P

Coming Soon

Marc
November 28th, 2002, 11:51 AM
You lot kickarse here at kirupa!

I'm downloading PHPtriad now from:

http://www.softwarelight.com/index.php?kategorija=Programiranje&sifra=PHPTriad

I still would like to know how to have AS write to html. My first goal was to use these input text boxes in flash where the users' text is sent to a printable dynamic box in flash at another frame. Then I decided it would be much better being able to have a html, using JavaScript, 'document.write' it somehow. Still reading about this.

I'm real new to this web-development game, I heard about php but now I know so much more. Thanks for inspiring me everyone. From reading so much of the threads at kirupa I get first hand experince of other peoples learning curves. Beats books and tutorials in a way. So thanks again and a big up to those who give so much help. You know who you are. :beam: