{mx}how do i have an input text box write to html

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

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:

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 :slight_smile:

Thanks. I’ll look into that now :slight_smile:

Ilyas…do you mean this?..

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

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?

Never heard about it :-\

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

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. ■■■■ it… I wish that there were not 5 different major markup/programing languages. :slight_smile:

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.

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. :slight_smile:

Dan told me “ask” is a PHP master.

h88 probably knows something too.

*Originally posted by lostinbeta *
Ilyas…do you mean this?..
I don’t know what I meant exactly :stuck_out_tongue: 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

That sounds cool :slight_smile:

yea i want to expirement with Flash and PHP in writing HTML etc =) That’ll be fuN!

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

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. :slight_smile:

yours,
h88

I just tested it, its working fine. :slight_smile:

yeah that’s what I’m talking about. :slight_smile:

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:)

You can install easyPHP. Very easy, as it says.

And Coldfusion is coldfusion, not PHP.

pom :cowboy: