Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

populate textarea with php variable(s)


9:14 pm on Jan 24, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 26, 2008
votes: 0

I have created a simple .swf with a "copy" button on the bottom.
the textarea I am trying to populate with variables from a processed.php file in which the .swf will be placed.

the "processed" php file that has the variables has:
Figure 1.)

<FORM action="non" method="post">
HTML: <input type="text" name="datext" size="40" value="<a href='<?php echo $siteurl; ?>view/<?php echo $id; ?>'><img src='<?php echo $siteurl; ?>image/<?php echo $id; ?>.jpeg'></a>">
<br/>CODE: <input type="text" name="datext" size="40" value="[url=<?php echo $siteurl; ?>view/<?php echo $id; ?>][img]<?php echo $siteurl; ?>image/<?php echo $id; ?>.jpeg[/img][/url]"></FORM>
<br/>URL: <a href='<?php echo $siteurl; ?>view/<?php echo $id; ?>'><?php echo $siteurl; ?>view/<?php echo $id; ?></a>

I am trying to load the generated Code:

[url=<?php echo $siteurl; ?>view/<?php echo $idz; ?>][img]<?php echo $siteurl; ?>image/<?php echo $idz; ?>.jpeg[/img][/url]

into the .swf so it can be copied onto their clipboard easily.

here is the actionscript i am using to try and load the above string into the .swf:

mylv = new LoadVars();
textBox.textBox.text =mylv.variable1;

the textBox.textBox.text = ""; can have text added into it no problem, but I am trying to load a variable since the code changes per picture.

I try to assign a value to the variable1 on the processed.php page(where the .swf will be placed)
print "&variable1=<a href='<?php echo $siteurl; ?>view/<?php echo $id; ?>'><img src='<?php echo $siteurl; ?>image/<?php echo $id; ?>.jpeg'></a>&"

this comes nowhere near close to working.

I need to assign figure 1. (above) or part of figure 1. to textBox.textBox.text = "FIGURE 1.";

any light on this would be greatly appreciated!

TY regards, frogz

9:40 pm on Jan 24, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 26, 2008
votes: 0

say I want to retrieve variable $id from a .php page, so I can make
textBox.textBox.text = $id; in actionscript. How can I get actionscript to get the $id variable from the processed.php page?
5:11 pm on Jan 25, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Frogsz, have you looked at the flashVars approach?

<param name="flashvars" value="id=<?php echo $id; ?>">
flashvars="id=<?php echo $id; ?>"

Anoother is to use an XML file and import the XML into Flash, which gives you more control over nested attributes and associative values, but for a single value, FlashVars will work.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members