A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: load a .txt / .as file each time a .swf is played?

  1. #1
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601

    load a .txt / .as file each time a .swf is played?

    well, i just want to know if it's possible, for an offline (and also online) purpose. let's say a function like #include, but that works everytime the .swf is launched...

    my current beta version of super crossover fighter is available as a download, and i don't want that people re-download it each time i change a piece of code, so i want to have the maximum of code loaded dynamically... it may help ^^

  2. #2
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    Easiest way would be to just create one or more new .swf files that only contain the code in question, then in your main .swf load those code .swfs into Handler movie clips.

    So the main timeline would have one or more essentially empty movie cilps named "cHandler" or something like that. Then on the first frame of the main timeline you just load all of your handlers up...
    code:
    loadMovie("charCode.swf", "cHandler");
    loadMovie("aiCode.swf", "aiHandler");
    ...



    then once loaded, you just call the functions as you normally would (i.e. _root.cHandler.moveLeft(2);)

    Should work pretty good, you'll just have to make sure that the .swf files are loaded before you go and start trying to use the functions, but thats a pretty easy proposition
    Last edited by TiefighT; 07-16-2003 at 02:41 PM.

  3. #3
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    interesting idea

    i can do it that way also, and the idea is the same: the main .swf is the actionscript handler, and at the same time the file where all the external movies are loaded...

    thanks

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