Solved

Can't insert variable using SWFObject

Posted on 2006-11-14
5
244 Views
Last Modified: 2006-11-20
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
Comment
Question by:COwebmaster
  • 3
  • 2
5 Comments
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 17948844
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
 

Author Comment

by:COwebmaster
ID: 17948974
Hi Aneesh, tried that but didn't work.
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17948988
ok,

how you are trying to retreive this variable inside flash
0
 

Author Comment

by:COwebmaster
ID: 17949091
Through a textfield
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 17952398
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Inserting a pop up image to a scanned PDF 5 459
How to display a webpage in a flash 10 366
Video sharing with user login 3 209
Add 'birds singing' to homepage 5 115
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question