Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    Problem:
    I've created a page that constanly looks at a file oil.txt. If the file is updated (a set variable changes value) then the FLASH dispalys the new value.

    The thing is, it works sometimes and not others?

    I've got Win98 and my friend has WinXP. It appears to work intermitantly on both. To me that counts out browser settings i.e. if it was a setting it sould either always work or always not work.

    When it is not working if I kill all browsers and then run up the browser again then the FLASH page refreshes - hitting Refresh does nothing .

    When it does work, I just FTP the data file up to the site and the page automatically displays the new value - great when it does work.

    DOES ANYONE KNOW WHEN IT DOES NOT ALWAYS WORK?

    Turan
    IP

  2. #2
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    Problem:
    I've created a page that constanly looks at a file oil.txt. If the file is updated (a set variable changes value) then the FLASH dispalys the new value.

    The thing is, it works sometimes and not others?

    I've got Win98 and my friend has WinXP. It appears to work intermitantly on both. To me that counts out browser settings i.e. if it was a setting it sould either always work or always not work.

    When it is not working if I kill all browsers and then run up the browser again then the FLASH page refreshes - hitting Refresh does nothing .

    When it does work, I just FTP the data file up to the site and the page automatically displays the new value - great when it does work.

    DOES ANYONE KNOW WHEN IT DOES NOT ALWAYS WORK?

    Turan
    IP

  3. #3
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,919

    Default

    Without viewing the source action script I can't really help a lot.
    I think that your main problem would be that the .txt file is loading from your computers cache, rather than renewing it from the server. One way of avoiding this is to set a random number at the end of the load variables call, so the browser thinks it's a new text file it's calling up each time.
    A second reason might be that Flash executes the call and then continues on it's merry way. If there's a delay in the server issuing the file and you have no check value set up in Flash to check the files loaded, then you won't see the text file updated. A way around this is to set up an END OF FILE variable as the last variable in the text file such as &EOF=1 or &loaded=loaded, then run a loop in Flash which it will only break out of once EOF=1 or loaded=loaded, thus ensuring the file is completely downloaded before Flash executes any further commands.

    I emailed you a .swf file about a week ago regarding this and also writing to cgi scripts. Didn't you receive it?
    Egg
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

  4. #4
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    As stated in my post "If the file is updated (a set variable changes value) then " this is your EOF suggestion i.e. my variable is called &end and I then check
    if (last_end != end ) {
    'update the screen';
    last_end = end;
    }

    Could you expand on the random variable idea, I not clear on what you mean.

    As for the mail you sent to me a week ago, are you sure it was me? I had a cgi post back in April, but you did not post to it and I do not recall you e-mailing me something - maybe your thinking of someone else .

    Turan
    IP

  5. #5
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,919

    Default

    The random variable is appended to the end of the call to LoadVariables. This causes the browser to think it's calling a new .txt file, not the one held in cache. So in the code below random is set for 1 to 999, and it is refreshed from the server each time, not cache.

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR> loadVariablesNum("http://www.YourDomain.co.uk/TextFile.txt?Ran="+random(999), 0);
    <HR></BLOCKQUOTE>

    I don't pretend to know how all this works, I learned a lot at the excellent actionscripts.org

    A good tut is at the link below

    Tut1

    I sent you a couple of emails and rcvd 2 automated replies saying

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Thanks for your e-mail. This is just a quick line to say I got your message and that I will reply in more detail shortly.

    Thanks for visiting Art Effects @ www.ArtEffectsNI.co.uk

    Turan <HR></BLOCKQUOTE>

    Is this the correct address (I don't want to post the email address here.

    Egg
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

  6. #6
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    Sorry, that random thing did not work! One comment I would make is it seems to work better (more reliablly on XP than 98se).

    The prog that writes to the txt file is always appending to the last variable, so I can't make it a constant and check for it, but I did add a loop that checks to see if it is null and loop back to the loadvariables if it is. As a debug I displayed the loop count and it is somethings greater than 0. This proves it is looping, but it means that when it comes out of the loop the last variable should be NOT null. But when it gets to the frame that displays the data in it it is displaying the old data!

    The addition of the random filename stopped the XP machine that was updating.

    My gut is that it is a cache problem, but the random thing did not do it! Will look at it again on Monday.

    Turan
    IP

  7. #7
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,919

    Default

    I'm not sure what your trying to achieve here.

    Are you updating the text file via a cgi script or just loading a static text file which you manually update occasionally then FTP the text file to your server?

    Hitting Refresh on your browser only refreshes the HTML file that contains the .swf file, the browser will update the HTML file but still loads the .swf file from cache. The only way to avoid this (in IE) is to go to Tools / Internet options / General / Temporary Internet Files / Delete Files. This will empty your cache.

    Egg
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

  8. #8
    Join Date
    Sep 2003
    Location
    Moselle.MS,USA
    Posts
    1

    Default

    Turan, delete the old text file and then upload the new one instead of just letting it overwrite.Question? are you using Anim-FX
    IP

  9. #9
    Join Date
    Apr 2001
    Location
    Northern Ireland
    Posts
    788

    Default

    The process is, I have a program that appends data to the end of a file and FTP's up that data file automatically, when something happens locally at my PC.

    I'll try emboli's idea of delteting the file then uploading it. At the moment I just overwrite the file.

    Turan
    IP

  10. #10
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,919

    Default

    I can't comment on the prog you're using, but it may be this thats causing the problem. (You can always check by entering the url of the text file into IE or navigator and ensuring it's being updated as expected)
    I use a metthod I found HERE.

    This method works fine for me and there's no need for additional programs, just access to a cgi on the server.

    Egg
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •