Solved

Can't insert variable using SWFObject

Posted on 2006-11-14
5
223 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now