dcsimg
A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 45 of 45

Thread: Embedding large text file

  1. #41
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I knew this idea had been done before, I just couldn't remember when. Finally found a very related thread:
    http://board.flashkit.com/board/showthread.php?t=770749

  2. #42
    Senior Member
    Join Date
    Jan 2008
    Location
    UK
    Posts
    269
    V5000 - What the heck? You just did what I spend a week failing to do!! That is the whole word list embedded into a single AS file .... and it compiles! I tried that - putting it into a single string, and it broke my compiler when I did it. The only difference that I can see, unless you've done something that's not obvious, is that you imported your code as a class, whereas I used the 'include' technique. Bizarre.

    But anyway - thank you! It looks like problem solved.

    And thanks a heap to 5Tons too, I'm sure others will use the png encryption, as will I in the future, so time well spent in my opinion. I will take a look at that other thread just out of curiosity - but I'm going to stop banging my head against a brick wall now trying to figure out why it won't decompress, as I've got the other method now.

    Cheers,

    Ric.

  3. #43
    Senior Member
    Join Date
    Jan 2008
    Location
    UK
    Posts
    269
    Ok - so you also split the string up into 24 smaller strings, I just realised. Still, you've somehow found an acceptable balance between string length and number of lines which doesn't break the compiler. Out of curiousity, what did you use to convert the list to csv? I was using a free 30 day trial of something called 'EditPlus3' which seemed to handle that kind of thing pretty well, and quickly. I tried quite a few other search and replace tools (including the one in Flash Develop) which either completely broke with a word list this long, or were very sluggish. Microsoft Word wouldn't even touch it!

  4. #44
    Senior Member
    Join Date
    May 2004
    Posts
    226
    I tried find/replace in Dreamweaver newline char for "," but it was so god awful slow I tried it in Word, which seemed only slightly faster. It could probably be done lickitysplit in Excell but I wasn't sure how and I was going to bed so I just let Word crank. Then today in Dreamweaver I used regular expressions to select the letter groups, for example .[^\bB]* to select the "a" words then cut and pasted the selection into the .as file, then .[^\bC]* for the "b" words then cut and pasted into the .as file, ad nauseum.

    Dividing the list into 26 letter groups from the raw data perspective is arbitrary, though could be useful in implementation. It was very possible one letter group (I was worried about "s" words) would be too long but they all were small enough to not exceed the statement length maximum, what ever that might be. If you can figure out the maximum length of a statement then you could divide the word list accordingly.

  5. #45
    Senior Member
    Join Date
    Jan 2008
    Location
    UK
    Posts
    269
    I tried exel too - didn't work. In fact I think it crashed as soon as I loaded the word list. Thanks again for your help - worked out a treat!

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