Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-10-2003, 02:26 PM   #1
tracer_bullet
Registered User
 
Join Date: Jul 2002
Posts: 18
Default refreshing MC variables from php

hi there,
i've got a problem (otherwise i wouldn't be there, would i ?).

i've got two files : the .swf and the .php.
1/ the php determinates at random some variables.
2/ flash display them
3/when refreshed, the php generates new values for the variables
4/flash doesn't refresh the variables in the mc. that's the problem

so here is my question : how could i make flash refresh the variables ?

i've used this :

onClipEvent (enterFrame)
{
loadVariablesNum ("../../../variables.txt", 0);
}

but it works for the fisrt loading.
when php changes the content of variables.txt, flash variables stay still...

Any idea ?
ps : the variables are well loaded. the files are at the right place.
the variables aare not erased, just modified.
thank you
tracer_bullet is offline   Reply With Quote
Old 06-12-2003, 07:10 PM   #2
holtzy
Are we there yet...
 
holtzy's Avatar
 
Join Date: Jan 2003
Location: USA
Posts: 201
Talking

How are you refreshing the php script? Is it on an event handler? If so which one?
__________________
God is Good.
holtzy is offline   Reply With Quote
Old 06-13-2003, 01:01 PM   #3
tracer_bullet
Registered User
 
Join Date: Jul 2002
Posts: 18
Default

-the php page (labo.php) call the flash. In the flash there is a button that send the variables to labo.php.

-labo.php writes the variables in a file (with w+ mode, so it erase the old content of the file on every time).

-flash reads the variables in the file.

It works fine the first time but if new texte is written in the flash, the php write it well in the variable file, but flash keeps on displaying the old one. Is this a problem of files held in memory?

i hope this is a bit clearer...
tracer_bullet is offline   Reply With Quote
Old 06-18-2003, 08:50 PM   #4
holtzy
Are we there yet...
 
holtzy's Avatar
 
Join Date: Jan 2003
Location: USA
Posts: 201
Talking

I would blow away the movieclip, then recreate it & load the text file in it.
__________________
God is Good.
holtzy is offline   Reply With Quote
Old 06-18-2003, 08:56 PM   #5
Sualdam
Registered User
 
Join Date: May 2003
Posts: 848
Default

Funnily enough, I'm sitting here working on a file that does more or less the same thing. Here's one way to stop the text file caching:
ActionScript Code:
myText.load(txtInput+"?noCache=" + random(99999)+random(99999),0);
Basically, as long as you put a unique number at the end Flash will be forced to load a new copy and not use the cached file. You can generate the random numbers any way you want, but this one works well.

(I just realised that code is a paste from my own file - it's a normal loadVars object).

As long as this is executed (from your clip event - or based on a returned variable 'trigger') it will load the updated variables.
Sualdam is offline   Reply With Quote
Old 06-18-2003, 09:04 PM   #6
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Another one...

As long as this line does not get executed multiple times real fast, it should be safe to use it and easier to type...
ActionScript Code:
myText.load(txtInput+"?uniqueID=" + getTimer());
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:46 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.