Solved

Can't insert variable using SWFObject

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft WSUS 4 97
Youtube video error 30 771
Trying to contour a nose in a face portrait in After Effects 5 101
Include Adobe AIR libraries in Flash Builder 4 121
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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.

776 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