Solved

Can't insert variable using SWFObject

Posted on 2006-11-14
5
212 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
Comment Utility
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
Comment Utility
Hi Aneesh, tried that but didn't work.
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
Comment Utility
ok,

how you are trying to retreive this variable inside flash
0
 

Author Comment

by:COwebmaster
Comment Utility
Through a textfield
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

743 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

11 Experts available now in Live!

Get 1:1 Help Now