| populate textarea with php variable(s) actionscript |
frogz

msg:3833955 | 9:14 pm on Jan 24, 2009 (gmt 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: figure2.)
[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(); mylv.onLoad=function(){ textBox.textBox.text =mylv.variable1; } mylv.load("processed.php");
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) <?PHP 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
|
frogz

msg:3833962 | 9:40 pm on Jan 24, 2009 (gmt 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?
|
rocknbil

msg:3834267 | 5:11 pm on Jan 25, 2009 (gmt 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.
|
|
|