all groups > flash data integration > september 2005 >
You're in the

flash data integration

group:

Dynamic Text



Dynamic Text Dr. DOT
9/29/2005 1:42:40 PM
flash data integration: I have a simple Dynamic Text movie. My text file sits on the server and is
named ticker.txt.

I have MSIE 6.x open, Forefox 1.0.7 open and Netscape 7.2 open to the Web page
with my Dynamic Text movie.

The moment I upload a change to the sample.txt file and observe the move on
the page in each of the browsers, here is what happens:

MSIE automatically renders the changed text without me doing a page refresh

Netscape and Firefox, on the other hand, do not render the changed text even
if I refresh/reload the page. In order for me to see the new text I must close
the Netscape and Firefox browsers and open them back to the page. Then I can
see the new text.

Does anyone have any explanation or solution to get NN/FF to work like MSIE?

Thanks
Re: Dynamic Text SimonTheSwift
9/29/2005 2:40:39 PM
Hello Dr. Dot,

the problem might be with how the browsers cache data from external sources.
In your .fla you will probably have some kind of reference to that external
source, right? I will give an example. Let's say I am communicating with a PHP
script using the LoadVars class. The ActionScript is something like this:

var myConnection:LoadVars = new LoadVars();
var answer:LoadVars = new LoadVars();
...
myConnection.sendAndLoad("http://someURL/myPHPFile/myFile.php?ck=" + new
Date().getTime(), answer);

The code that comes after the URL is a cache killer (ck). It's purpose is to
make each transaction unique. The time stamp is suitable for that. This way,
the two browser should not look into old (cashed) data, but really refresh. The
answer parametr is another instance of the LoadVars() class that receives
response from the script.

This is a trick I learned from an excellent book by David Powers called
Foundation PHP 5 for Flash. I recommend it to anyone who wants to start with
ActionScript, PHP and MySQL, running on Apache.


I hope this helped,

Simon.
Re: Dynamic Text SimonTheSwift
9/29/2005 2:42:49 PM
Hello Dr. Dot,

the problem might be with how the browsers cache data from external sources.
In your .fla you will probably have some kind of reference to that external
source, right? I will give an example. Let's say I am communicating with a PHP
script using the LoadVars class. The ActionScript is something like this:

var myConnection:LoadVars = new LoadVars();
var answer:LoadVars = new LoadVars();
...
myConnection.sendAndLoad("http://www.somewhere.com/PHPFile/myFile.php?ck=" +
new Date().getTime(), answer);

The code that comes after the URL (?ck=" + new Date().getTime()) is a cache
killer (ck). It's purpose is to make each transaction unique. The time stamp is
suitable for that. This way, the two browser should not look into old (cashed)
data, but really refresh. The answer parametr is another instance of the
LoadVars() class that receives response from the script.

This is a trick I learned from an excellent book by David Powers called
Foundation PHP 5 for Flash. I recommend it to anyone who wants to start with
ActionScript, PHP and MySQL, running on Apache.


I hope this helped,

Simon.
Re: Dynamic Text SimonTheSwift
9/29/2005 2:44:30 PM
I am sorry for posting two messages. The URL did not come out properly - I wanted to put the additional code in bold, but it just didn't take it.

Re: Dynamic Text Dr. DOT
9/29/2005 3:07:34 PM
OK Simon. I wil cut and paste

var myConnection:LoadVars = new LoadVars();
var answer:LoadVars = new LoadVars();
...
myConnection.sendAndLoad("http://www.somewhere.com/PHPFile/myFile.php?ck=" +
new Date().getTime(), answer);

into my ActionScript and see if I can get it to work.
Re: Dynamic Text Dr. DOT
9/29/2005 3:13:11 PM
No, didn;t work.

Here is what I did:

var myConnection:LoadVars = new LoadVars();
var answer:LoadVars = new LoadVars();

loadVariables("http://teamsonline.net/flash/ticker.txt","/");

myConnection.sendAndLoad("http://www.somewhere.com/PHPFile/myFile.php?ck=" +
new Date().getTime(), answer);

Re: Dynamic Text Dr. DOT
9/30/2005 12:44:35 PM
Found the answer:

In your ActionScript you need the following simple command in Frame 1:

loadVariables(_root.textfile,"");

where "textfile" is the name on the PARAM element:

<param name="loadVars" value="textfile=A sample message">

That's it -- easy once you see it :)
Re: Dynamic Text MutleyUK
10/6/2005 11:21:30 AM
Hi,
I am having the same problem that you seem to have solved above.
Could you elaborate a bit more or assist me in using your solution with my application?

AddThis Social Bookmark Button