Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Can't insert variable using SWFObject

I'm trying to 1) read a txt file, then 2) insert a string from a txt file into a flash textfield using SWFObject.  The string though has double quotes around each element (see below).  Here's my SWFObject script but the flash movie doesn't even show up in the page:

<CFFILE ACTION="Read"
    FILE="path\whatsnew.txt"
    VARIABLE="getthisText">
      

<cfoutput>
<script type="text/javascript">

            // <![CDATA[
            var flashFile ="whatsnew.swf?noCache="+(new Date().getTime());
            var so = new SWFObject("whatsnew.swf", "whatsnew", "766", "700", "7.0.0.0", "##000000");
            so.addParam("wmode", "transparent");
            so.addParam("menu", "false");
            so.addVariable("gettext", "#getthisText#");
            so.write("flashcontent");
            // ]]>
</script>
</cfoutput>

Here's the txt file:

<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="_sans" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">test</FONT></P></TEXTFORMAT>


Any ideas?
0
COwebmaster
Asked:
COwebmaster
  • 3
  • 2
1 Solution
 
Aneesh ChopraCommented:
try changing following line :
---------
so.addVariable("gettext", "#getthisText#");
-------

change it as shown below:
--------
so.addVariable("gettext", '#getthisText#');
--------------


only change i suggest it use single quote instead of double code, as your variable value already using double quotes
it should work

--Aneesh
0
 
COwebmasterAuthor Commented:
Hi Aneesh, tried that but didn't work.
0
 
Aneesh ChopraCommented:
ok,

how you are trying to retreive this variable inside flash
0
 
COwebmasterAuthor Commented:
Through a textfield
0
 
Aneesh ChopraCommented:
I mean to say,
please show me code which you are using to use value of passed variable...

plz copy/paste here,
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now