[JS][CS3] Loading text into memory

Hi.
Am am trying to access an external txt file which holds data for my script.  I have looked at the famous "FindChangeByList" and tried to work from there.  However, I am not going to need input from the user for the txt file location, it will always be the same:
myFilePath="/Mailer Support/savers.txt";//always going to be there
myFile = File(myFilePath);
myData = myFile.open("r", undefined,undefined);
myLine = myFile.readln(); //I know I need loops for this, but there is text on the first line of the TXT file
myText = myFile.read();
alert (myLine);//Blank!!
myText = myFile.read();
alert (myText);//Blank also
Can someone help with this please.
I know I had a PDF file that detailed the way to call and work with files, but I cannot find it.  Does someone know the name of it?
Cheers
Roy

Your code works just fine for me. I'd suggest adding
myStatus = myFile.open("r", undefined,undefined);
if (myStatus == false) { alert ("Unable to open that file"); exit(0); }
to check if it actually exists (open returns a state flag, rather than 'data'). A quick experiment shows that JS doesn't care if a non-existant file is opened for reading (other than just about any other programming language I could care to name!), and indeed "reads" blank lines if it doesn't exist.
By the way, you used this line twice:
myText = myFile.read();
-- overwriting "myText" the second time. Since the first "read" already read up to the end of the file, the second time around the variable is emptied.

Similar Messages

  • Installing Flash CS5.5 corrupted my CS5 Fla - Could not load scene into memory. Your document may be

    I have a FLA that worked fine in CS5, I have copies of the file going back 6 months.  Every file I open gives me this error: Could not load scene into memory. Your document may be damaged.
    How could every fla I've backed up give the same error? They all worked fine in CS5.  Does anyone know of a fix?  Or do I have to go back to CS5?
    Thanks!

    I reinstalled Flash Pro CS5 and it opens up all my FLA's (of the same project) perfectly.  But Flash Pro CS5.5 gives me this error: Could not load scene into memory. Your document may be damaged.
    So is CS5.5 unusable?
    cheeres.

  • Missing/empty symbols, "Could not load scene into memory. Your document may be damaged." CS6

    Hey folks,
    we've been getting this problem a lot. We had it in Flash CS5.5 and still have it CS6.
    We're animating a series in Flash and this problem keeps cropping up way to often, but seems totally random.
    Basically I'll be working on a .fla saving regular versions through out the day, no problems. I'll close the file down. Then I (or someone else on a different computer) will open it up and I'll get the error msg "Could not load scene into memory. Your document may be damaged." Everything will be fine except for a few missing graphic symbols. Sometimes just the one, sometimes a whole bunch. So where the symbol should be on the stage, instead you get a small white square, but it still contains the animation information. So it will still move about the stage. If I bring in the same symbol from an old scene I can swap them out and the problem is fixed, (until it does it again on a totally different graphic symbol).
    If i select the symbol in the library the preview is white/blank and i can't go into it to edit. When I select the symbol on the stage, the "instance of:" gives me a blank "_ _ _" in the properties tab. How ever if i right click show in library it does show me the correct (although broken as in blank) symbol in the library.
    I havent been able to reproduce this problem on purpose but I'd say it happens in roughly one scene out of 10. Its seems to happen at random, I know there must be something in common but i havent figured out what. Its going on in heavy scenes (large library multipule characters), lite scenes (just the one character). Its not like it happens to the same symbol, different ones each time. Everything is local to the scene, all elements are created in flash. We are working across a network but as everything is local to the scene i don't see how that would be a problem. Also we don't have duplicate named symbols. It also won't necessarily affect something that has been changed since the last version. could be a background element thats been there, untouched since the first version of the scene.
    One point on how we set up our scenes which may be relevant. Start with empty scene, copy and paste symbols from other scenes to populate. Save.
    The problem could appear on say version 4 or version 36. Older versions are usually fine.
    So to sum up. Flash file is fine when we save it, open it up again later and a symbol will have disappeared. It's happening far too often.
    I know how to fix the problem, thats not what I'm asking. I need to know WHY its doing it so we can stop this from happening in the first place.
    Phew! Thanks for reading this far. Any help would be highly appreciated.
    Sander/

    Can you elaborate on how you use the network? Are you working from FLA/XFLs stored on a machine across a network (and saving them across the network)? I had plenty of those issues and Adobe has always warned not to work across a network. I just fell into the habit of copying over what I need to work on locally, then updating the file servers at the end of the day. Nothing was corrupt after that.
    Also lately in CS5.5 (not CS6 yet) I had noticed that I could change some graphics assets, close the document in OS X and open in Windows only to find freshly updated graphics reverted back. What's even more odd is if the OS X machine that made the changes opens it the changes are still made. This happens vice versa as well. My only solution on that was not to work cross-platform with other machines on a network unless absolutely necessary.

  • Loading images into memory

    I have an applet that I need to load images into memory. For instance, lets say I am in the first section of the applet. While that section is being showed, I want to load the background image of the second section into memory.
    To load the initial image into momory, I am just using a Mediatracker. No problem there. But I don't want to load all 20 backgrounds into memory at the same time as they take a lot of time. My understanding is that if I create a new MediaTracker while the first chapter is running, it will potentially cause some chaos, as that will stop my thread from running while I have an image loading.
    Somebody told me perhaps I could create a new thread and have that thread load the backgroudn into momory? Perhaps something like this?
    public class TestClass extends JApplet {
         private TestClass thisClass;
         public void init() {
              thisClass = this;
              Runnable r = new Runnable() {
                   public void run() {
                        MediaTracker tracker = new MediaTracker(thisClass);
                        Image nextImage = getImage( getDocumentBase(), getImagePath() +"img1.jpg");
                        tracker.addImage(nextImage,0);
                        try {
                             tracker.waitForID(0);
                        } catch (InterruptedException ie) {
                             System.out.println(ie.toString());
              Thread t = new Thread(r);
              t.setDaemon(false);
              t.start();
              while(t.isAlive()) {
                   int i = 1;     
              t.stop();
              t.destroy();
    }No idea if I am on the right track or not? Another friend told me something about swing helpers but couldn't tell me much more?
    Thanks in advance!

    I use media tracker when I need information about how percent the image is loaded. you can use JLabel to load the images since it has own image observer in it.
    hope you just want to deal with it. easiest way I can offer :)

  • "Could not load scene into memory. Your document may be damaged." Lost whole timeline.

    Please help me - I have been working on a Flash CS6 file for a while now, and just got the message "Could not load scene into memory. Your document may be damaged." The file is not big, all it contains is 3 layers - one embedded video FLV file and 2 layers on top that only contain brushstrokes. The file is on my external hard-drive and now I get the message when I open it on either of my computers. I read feedback that I should re-link or re-import my assets, so I re-made the FLV file and imported it to replace the old one that it said couldn't be found. The problem is the timeline is completely empty. Even once I import the new video, the timline only has one "layer 1" with only one blank keyframe. Where is the rest of my work? I am good with backing up but was just away for a week and got a lot of work done so I couldn't back it up until I was back home... and obviously that isn't happening now.
    Please help if you have any idea where my work has disappeared to.

    Hi GregirArt,
    Can you please check your PublishSettings.xml file whether is there any duplicate profile entries?
    You can check the same by renaming your .fla to .zip and extract the zip file to open the PublishSettings.xml
    If you find multiple duplicate profile entries then please remove all the duplicate entries from the file and rename the file back to .fla and see if that helps.
    Thanks!
    Mohan

  • Flash Pro CC saved fla project - "Could not load scene into memory. Your document may be damaged."

    Hi all, I've been working on a project in Flash Professional CC in windows 7 that was started in a previous version of Flash Pro and occasionally after I've saved the project and tried to open it the next day I get the "Could not load scene into memory. Your document may be damaged." message and only a blank Scene 2 in the project. I've previously been reverting back to the old saved project file and starting over. Its wasted a lot of time so far.
    I can still open the same exact project in CS6 on another older computer but not in CC. I can also save the fla in CS6, transfer it to the other computer and then it will work again (for now). This isn't going to be an option in the future as CS6 was a trial version that is on its last use today.
    I've tried to create a new flash pro cc project and just copied and pasted the library and scene layout from the old project into the new project. This worked for a couple of saves/ opens but the error has happened again.  I'm scared that now that I've reached the point in the project were my work in the animation/ visual side will start to be more intensive that I will continuosly have to worry about losing all of my work. I'm using a document class so the AS3 code hasn't been an issue thankfully. Any help would be appreciated.

    Thanks for the reply Amy, that is essentially what I am doing already only I'm not using version control software I'm just managing it on my own since its a solo project, though I have been considerring using git anyway. It still doesn't explain why I can open and save the supposedly damaged project (according to CC) in CS6 and only then will it work again in CC. Also I'm not gettting a chance to save as a new version over and over for long. Its only a couple of days max, usually just over one day, and I've primarily been working on the code in Flash Builder with little functional change in the actual fla project. Its primarily changing movieclips instance names, which in this project is tedious and time consuming. Having to revert back to the older working version is exaclty what I'm trying to avoid. I shouldn't have to commit the project to a repository every little change that I make to the fla file.

  • Flash CS5 Could not load scene into memory. Your document may be damaged.

    Hello everyone!
    Just bought the new CS5 Flash and was eager to begin my first document. I opened a new document Saved As to begin and then setup my basic page with only one imported graphic. Hit Save and received an error message: Could not load scene into memory. Your document may be damaged. When I closed and reopened the document this same error appears twice in my Output Menu.
    I have noticed other people with several of simular issues and am not sure where to start to find an answer. Any help is greatly appreciated.
    Thanks in Advance,
    Biddler1

    Thought I'd add to this since I have a file with a similar problem. I'm carrying the files home to work on in the evening. I've noticed at work that when I update an image in the library flash shows me a path going all the way out to the root of the network share and then back to the file. The file is just one folder away. Maybe Flash has recorded an absolute path instead of a relative path to the asset.
    At home, Flash can't find the asset at all since it's recorded a non-portable path.
    The question is, if the asset has been imported to the project file, why is flash checking the original in the first place?

  • Damaged Flash CC files ("Could not load scene into memory.")

    I just installed Creative Cloud the other day, and had the following problem immediately.
    I create a brand new .FLA and import a few assets from another person's Illustrator CC file, then write some ActionScript for basic interactivity. I can work for hours with that file. But when I save, quit and reopen the file (either 2 seconds later or the next day), I get a warning that says "Could not load scene into memory. Your file may be damaged." The library is empty, no instances of symbols on the stage, nothing. I can't open the file with Flash CS6 or anything: it's shot. I repeated the process several times with brand new Flash files, but always get the same results. I even deleted everything and reinstalled and still got the same results.
    I switched to using Flash CS6, but when I imported artwork from Illustrator CC, I was getting corrupted artwork and periodically I'd get an error that said something to the effect of "You can't import artwork from a newer version of Illustrator into Flash CS 5.5. (WTF? I'm in Flash CS6.)
    Any ideas? I'm on a Mac, OS X 10.8.4. Thanks very much.

    Hi Gregir ,
    Is it possible for you to share the file or the illustrator assets with us? We can take a look and get back on it.
    Can you check the size of the PublishSettings.xml file which would be present after unzipping the zip created from the fla renaming it as .zip.
    Thanks and Regards,
    Sudeshna Sarkar
    Adobe Flash Professional Team

  • How to find out memory consumption for table in HANA without load it into memory

    Hi,
    To determine the memory consumption for a table in HANA, you can query table M_CS_TABLES, however, it requires load table into memory first, I just wonder if there has another table store memory consumption information for all HANA tables regardless it load into memory or not. Below is screenshot for one of table in my system, since that table is partially loaded into memory, "Total Memory Consumption (KB):" tell me the memory consumption of the portion load into memory, what I am looking for is something like "Estimated Maximun Memory Consumption (KB)" which provides me total memory consumption for that table including portion doesn't load into memory, of course I can use this Esitmated information, but consider I have close to thousand tables in my HANA system already, it's not pratical to check tables one by one.
    Thanks,
    Xiaogang.

    Hi Xiaogang,
    Estimated Memory Size that you see in the Table Run time Information - same is available in M_CS_TABLES also
    If you don't get the size of any Table in M_CS_TABLES View, then the same will also not be available in Runtime information of the Table
    Even if tables are not loaded into memory, you can get the Estimated Size, just try running the query with filter LOADED = 'NO'
    Regards,
    Vivek

  • How load text into dynamic text boxes from external file?

    hi all,
    my animation is very simple - a background image and 2 text boxes.  one of the textboxes shows a large word, which crossfades to another word, with a total of about 12 words (showing one at a time in different text boxes fading in & out in the same spot).
    i need a way to have the text be imported dynamically via xml or json (xml preferred).  this article is a good start, but i noticed he's putting all of the text into one box - i need separate strings put into separate boxes from the xml.
    Chris Gannon - Loading XML via AJAX into Adobe Edge
    he uses
    var outputField = $(this.lookupSelector(“xmlOutput”));
    for his text box.  what would be the best way to revise this code to include all my individual strings to be loaded into my individual text boxes?  thinking an array might work, but my js skills are limited.
    any other suggestions or tutorials you could point me to would be appreciated.
    thanks!!

    thanks joel_pau !
    this is helpful in seeing how the array is created, but after giving it a go I became a little confused.
    i wound up trying it again based on the example i linked out to previously, but it's not adding the text from my xml file when previewing.
    here's the code i'm using in edge animate on my stage.  something must be wrong somewhere.  let me know if you have any suggestions on this.
    // insert code to be run when the composition is fully loaded here
    // here i'm assigning a variable to each one of my textboxes at they're named in my edge animate comp
    var outputField1 = $(this.lookupSelector("helps2"));
    var outputField2 = $(this.lookupSelector("communicate"));
    var outputField3 = $(this.lookupSelector("experience"));
    var outputField4 = $(this.lookupSelector("interact"));
    var outputField5 = $(this.lookupSelector("understand"));
    var outputField6 = $(this.lookupSelector("overcome"));
    var outputField7 = $(this.lookupSelector("flourish"));
    var outputField8 = $(this.lookupSelector("collab"));
    var outputField9 = $(this.lookupSelector("trust"));
    var outputField10 = $(this.lookupSelector("grow"));
    var outputField11 = $(this.lookupSelector("engage"));
    var outputField12 = $(this.lookupSelector("survive"));
    var outputField13 = $(this.lookupSelector("thrive"));
    var outputField14 = $(this.lookupSelector("evolve"));
    var outputField15 = $(this.lookupSelector("connect"));
    var outputField16 = $(this.lookupSelector("achieve"));
    $.ajax({   
        type: "GET",
        url: "myxmlfile.xml",
        dataType: "xml",
        success: function(xml) {
    //here i'm trying to load the the text in my xml file into my textboxes in edge animate.  'txt1, txt2, txt3' are the tags in my xml file
            outputField1 = $(xml).find('txt1').text();
            outputField2 = $(xml).find('txt2').text();
            outputField3 = $(xml).find('txt3').text();
            outputField4 = $(xml).find('txt4').text();
            outputField5 = $(xml).find('txt5').text();
            outputField6 = $(xml).find('txt6').text();
            outputField7 = $(xml).find('txt7').text();
            outputField8 = $(xml).find('txt8').text();
            outputField9 = $(xml).find('txt9').text();
            outputField10 = $(xml).find('txt10').text();
            outputField11 = $(xml).find('txt11').text();
            outputField12 = $(xml).find('txt12').text();
            outputField13 = $(xml).find('txt13').text();
            outputField14 = $(xml).find('txt14').text();
            outputField15 = $(xml).find('txt15').text();
            outputField16 = $(xml).find('txt16').text();
    but nothing happens on preview.  my textboxes still contain the original text that lives in my comp.

  • Read a file without loading it into memory

    I have a VERY large file filled with words. I want to determine if a String in my program matches one of them. Loading the entire file into memory would take a long time and would use way too much memory. Is there some way to load just the part I need each time or make the comparison directly from the file on the hard disk?

    The file is static, so your plan seems to have merit.
    I've only used sequential files before, but I'm
    assuming this would require a random access file since
    you have to begin reading at a specified offset. Am I
    correct?Yes.
    In addition, if this file is fixed-length "records" so that you could programmatically determine the word offsets without having to keep a map of indexes in memory, you could just employ a search algorithm (I forget what this one is called) - you could start by defining 2 endpoints, initially at offset 0 and the offset of the last word.
    Iteratively read the word halfway between the 2 endpoints, adjusting the endpoints until a match is found or the endpoints converge.

  • To load text into clob,long.

    I am able to load data into clob,long.but it is not taking more than 4000 bytes.but i want to insert 10MB or more data.HOW?
    It is giving error ORA-01704:
    string literal too long
    Cause: A quoted string specified as a constant was too long.
    Action: Quoted strings may not contain more than 2000 characters.
    what it means? and tell me How can I insert more text ie upto 1GB.
    thanking you.......
    reddy.
    null

    does that
      trace("Image Name=" +e.currentTarget.title)
    trace what you want to display?  if yes, add a textfield and assign its text property to e.currentTarget.title in your overScrollerItem listener function.

  • Loading time into memory for a large datastore ?

    Is there some analysis/statistics about what would be the loading time for a timesten data store according to the size of the data store.
    We have a problem with one of our clients where loading of datastore into memory takes a long time. but only certain instances it takes this long.. maximum size for data store is set to be 8GB (64bit AIX with 45GB physical memory), is it something to do with transactions which are not committed?
    Also is it advisable to have multiple smaller datastores or one single large datastore...

    When a TimesTen datastore is loaded into memory it has to go through the following steps. If the datastore was shut down (unloaded from memory) cleanly, then the recovery steps essentially are no-ops; if not then they may take a considerable time:
    1. Allocate appropriately sized shared memory segment from the O/S (on some O/S this can take a significant time if the segment is large)
    2. Read the most recent checkpoint file into the shared memory segment from disk. The time for this step depends on the size of the checkpoint file and the sustained read performance of the storage subsystem; a large datastore, slow disks or a lot of I/O contention on the disks can all slow down this step.
    3. Replay all outstanding transaction log files from the point corresposnding to the checkpoint until the end of the log stream is reached. Then rollback any still open transactions. If there is a very large amount of log data to replay then this can take quite some time. This step is skipped if the datastore was shut down cleanly.
    4. Any indices that would have been modified during the log replay are dropped and rebuilt. If there are many indices, on large tables, that need to be rebuilt then this step can also take some time. This phase can be done in parallel (see the RecoveryThreads DSN attribute).
    Once these 4 steps have been done the datastore is usable, but if recovery had to be done then we will immediately take a checkpoint which will happen in the background.
    As you can see from the above there are several variables and so it is hard to give general metrics. For a clean restart (no recovery) then the time should be very close to size of datastore divided by disk sustained read rate.
    The best ways to minimise restart times are to (a) ensure that checkpoints are occurring frequently enough and (b) ensure that the datastore(s) are always shutdown cleanly before e.g. stopping the TimesTen main daemon or rebooting the machine.
    As to whether it is better to have multiple smaller stores or one large one - that depends on several factors.
    - A single large datastore may be more convenient for the application (since all the data is in one place). If the data is split across multiple datastores then transactions cannot span the datastores and if cross-datastorestore queries/joins are needed they must be coded in the application.
    - Smaller datastores can be loaded/unloaded/recovered faster than larger datastores but the increased number of datastores could make system management more complex and/or error prone.
    - For very intensive workloads (especially write workloads) on large SMP machines overall better throughput and scalability will be seen from multiple small datastores compared to a single large datastore.
    I hope that helps.
    Chris

  • Loading RPD into memory

    Hey !
    I finished creating a repository using Oracle BI administration tool .
    How to load this into BI server so that it is available in the subject area of the Dash board answers ?????

    The OBE for [Creating a Repository Using the Oracle Business Intelligence Administration Tool|http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/bi_admin/biadmin.html#t4] contains this:
    - Run a Consistency Check
    - Enable Query Logging
    - Modify NQSConfig.ini
    - Start Oracle BI Services
    - Use Oracle BI Answers to Execute Queries
    - Use Query Log to Verify Queries
    Check the links for the details.
    Cheers,
    C.

  • Loading Text into SWF

    Hello Everyone,
    I wonder if anyone could help?
    I have a SWF with multiple dynamic text fields. I want to
    load in the contents of ONE text file into the five or so fields at
    the touch of a button. Can anyone advise on how to set up a XML or
    TXT file and the Action Script to allow this to happen?
    Any advice or pointers in the right direction would be
    greatly appreciated.
    Darren.

    Couple of quick questions... For the Textfields:
    a)Do you have the textfields already on stage (in other words
    your "5 or so" comment in your first post is fixed to the number of
    textfields you put on stage). If so, what the names of the
    textfields and in what scope (e.g. main timeline or inside a clip
    called "textHolder" etc.
    b)Or do you want them created dynamically by code? If they
    are to be created dynamically by code, are they to be placed in
    fixed (scattered) locations or is there a pattern - e.g. are evenly
    spaced? If the positions are fixed and do not fall into pattern...
    then what are they (in sequence) or if they are in a layout pattern
    please describe it.

Maybe you are looking for