A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 41

Thread: External TXT file ONLY on specific dates

  1. #21
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    Im not sure why it would think that?..do you have the font embeded?..what font are you using?..are you using any MASKS over the text? is there a scrollBar on the textField?

    under what circumstances does it NOT load?..can you repeate the bug? is there a specific case where it ALWAYS works?

  2. #22
    hello again!

    I have embedded one of the fonts yes, called interstate, for the dynamic text....

    There are no masks in the file though.

    It usually doesn't load for me when i do a ctrl+f5 refresh of the page, where everything is forced to load again, my boss it doesn't load the text file when his cache is cleared... it loads it up again if you hit refresh usually... but its weird, because it still is obviously finding the text file, just not reading whats inside it or thinking its empty, because if it thought it wasn't there at all then it would revert to the alternate frame...

    Thanks again and again againginging for all your help whispers

  3. #23
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    hmm.. LOL..kind of s stumper since there really isnt anythingconsistant with reproducing the problem.

    have you tried adding a "cach killer" line of code on the text file? so it wont try to load from the cache..and will get get the text file?

    not 100% as all it does is add a random number to the text file.

    I dont remember your code exactly....

    but basically change the textFile name part o be similar to this:
    Code:
    this.loadVariables("text.txt?" add random(9999));

  4. #24
    will that make the name of the text file itself random?

    Haven't tried anything like that, has it come up blank at all on your computer? The servers we have at work at totally rubbish!

    I'll give it a go...

    We might be going down the database route if we can't get it working :/ i know nothing about databases either!! hehe.

    Just seems like such a random problem i dont know what could possibly be causing it...

  5. #25
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    you can give me alink...and I can try to look for myself.

    I havent tested the code I gave you...just "looked" like it would work..LOL..

    that code I just gave you, will make you NOT be able to load the text file locally to test it needs to be LIVE if you are going to use the random function for the cache.

  6. #26
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    where is the text supposed to be?..I see he main page?.."looks" like everythign is there... can you be more specific about where the text is? wher the flash sections are?

  7. #27
    cool, well it is currently live at, which is a test version of www.eadt.co.uk
    http://www.eadt.co.uk/content/eadt/d...efault_pp.aspx
    ill upload the fla file to:
    http://www.3launch.com/EADT3.fla
    However, on a local computer, it works perfectly and has never gone wrong....
    the only thing i think it could be is a problem with the servers running the site...

    Thanks again

  8. #28
    sorry, the text is in the blue flash box saying "In Your EADT" on the right hand side of the page... text should read today is wednesday, or just read the default message which is something like goto the news area of the website to see the latest news.

  9. #29
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I cant even open the file... everytime I click on it to open..it crashes FLASH MX corrupt? (damn I lost my project..should have SAVED before helping)

  10. #30
    Damn i sorry man, dunno why that is, could it be because you using flash mx and i'm using flash 8 pro?

  11. #31
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    ahh.. yes..but usually just says wrong format doesnt CRASH flash.

    try putting a dynamic text field OFF the stage area..and type a few leters in it to help with the embeding..that way it has all outlines..maybe thas the problem>,,

  12. #32
    Junior Member
    Join Date
    Mar 2009
    Posts
    6

    external txt file for dates

    hello
    can you help
    used your code in my project but i cannot get it to work
    i would like flash to import text file based on the current date to display in a dynamic text box
    using flash cs3 - can it import omitting the year in the text file just using date 3-31.txt
    thanks
    PHP Code:
    function CityLoader() {
        
    ClearCity();
        
    Today();
        
    myDate = new Date();
        
    date myDate.getDate();
        
    month = ["1""2""3""4""5""6""7""8""9""10""11""12"];
        
    year myDate.getFullYear();
        
    file month[mydate.getMonth()]+"-"+date+"-"+year+".txt";
        
    trace(file);
        
    loadcity = new LoadVars();
        
    loadCity.onLoad = function() {
            
    latitude.text this.latitude*1;
            
    longitude.text this.longitude*1;
            
    altitude.text this.altitude*1;
            
    mycity.text this.city;
            
    latitude1.text this.latitude*1;
            
    longitude1.text this.longitude*1;
            
    altitude1.text this.altitude*1;
            
    Hours24i.text this.Time_24Hours;
            
    mycity1.text this.city;
            
    AutoTZi.text this.Automatic;
            
    DSi.text this.Daylight_S;
            
    TZonei.text this.Time_Zone;
            
    Alarmi.text this.Alarm;
            
    FSAlarmi.text this.Full_Screen_Alarm;
            
    FScreeni.text this.Full_Screen;
            
    myvoli.text this.Volume;
            
    MDi.text this.MagneticDectination*1
            MagD
    .text this.MagneticDectination*1
    Last edited by whispers; 03-31-2009 at 10:10 AM.

  13. #33

  14. #34
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    maybe something like this:

    PHP Code:
    function CityLoader() {
        
    ClearCity();
        
    Today();
        
    myDate = new Date();
        
    date myDate.getDate();
        
    month = ["1""2""3""4""5""6""7""8""9""10""11""12"];
        
    year myDate.getFullYear();
        
    //file = month[myDate.getMonth()] + "-" + date + "-" + year + ".txt";
        
    file month[myDate.getMonth()] + "-" date +".txt";
        
    trace("Target File: "+file);
        
    loadcity = new LoadVars();
        
    loadCity.onLoad = function() {
            
    latitude.text this.latitude 1;
            
    longitude.text this.longitude 1;
            
    altitude.text this.altitude 1;
            
            
    mycity.text this.city;
            
    latitude1.text this.latitude 1;
            
    longitude1.text this.longitude 1;
            
    altitude1.text this.altitude 1;
            
            
    Hours24i.text this.Time_24Hours;
            
    mycity1.text this.city;
            
    AutoTZi.text this.Automatic;
            
    DSi.text this.Daylight_S;
            
    TZonei.text this.Time_Zone;
            
    Alarmi.text this.Alarm;
            
    FSAlarmi.text this.Full_Screen_Alarm;
            
    FScreeni.text this.Full_Screen;
            
    myvoli.text this.Volume;
            
    MDi.text this.MagneticDectination 1;
            
    MagD.text this.MagneticDectination 1;
        };
    }
    CityLoader(); 

  15. #35
    Junior Member
    Join Date
    Mar 2009
    Posts
    6
    hello
    thanks
    for the help
    im getting level errors in the dynamic textbox
    can you guide me

  16. #36
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    what? were you getting _level errors before?

    I used YOUR code..

    added the closing brackets and took our the year portion..that was it..

    you ARE using AS2 right?

    save your file to Flash 8 format (not, CS3).. .zip it up..and post it..

    did you use instance names for the text fields?...or did you use variable names?????

    sounds like the later?

  17. #37
    Junior Member
    Join Date
    Mar 2009
    Posts
    6
    thanks got it to work
    but now when the date changes it does not auto load that days file unless you reload the movie

    Thanks for your help

  18. #38
    Junior Member
    Join Date
    Mar 2009
    Posts
    6
    sorry
    it uses the instance name

  19. #39
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    huh?

    I dont even see the:
    loadCity.load(); method in there..dd you add it?

    also.. this will only load/fire/execute ONE TIME.. as soon as the application loads.. it will check to see what day/date it is..and load the matching .txt file..

    if you want to have it auto load... you will need to call that function whenever it is you want to check for a new text file/date...

  20. #40
    Junior Member
    Join Date
    Mar 2009
    Posts
    6
    hello
    This is the code i used
    sorry im new to this
    I have to setup this for my class
    I would like to display the info for the class daily
    but when the day changes it must load a new txt file for that day automatically in the dynamic text boxes
    this movie will be a standalone using the projector format

    thanks for your help


    function DateLoader() {
    myData = new Date();
    datr = myData.getDate();
    month = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; year = myData.getFullYear();
    file = month[mydata.getMonth()]+"-"+datr+".txt";
    trace("Target File:"+File);
    loadcity = new LoadVars();
    loadCity.load(file);
    loadCity.onLoad = function() {
    latitude.text = this.latitude*1;
    longitude.text = this.longitude*1;
    altitude.text = this.altitude*1;
    mycity.text = this.city;
    latitude1.text = this.latitude*1;
    longitude1.text = this.longitude*1;
    altitude1.text = this.altitude*1;
    mycity1.text = this.city;
    DawnTAi.text = this.Dawn_Twilight_Angle;
    DuskTAi.text = this.Dusk_Twilight_Angle;
    Hours24i.text = this.Time_24Hours;
    AutoTZi.text = this.Automatic;
    DSi.text = this.Daylight_S;
    TZonei.text = this.Time_Zone;

    };
    }
    DateLoader();

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center