A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Setting the Movie to read Action Script from another file

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    6

    Exclamation

    Is there a way that I can have an exported movie in the .swf format and make it refer to another instructions.txt which lies with it? I tried #include though then found out that it embeds the info of the file into it at build.
    If you know how to do this, please reply

    Thanx

  2. #2
    caithness massiv
    Join Date
    May 2000
    Location
    denver
    Posts
    1,672
    this is what i do:

    #include "C:\WINDOWS\Desktop\WEBSITE\00 NEW\as\button1.as"


    but it only embeds the scripting on publish (versus 'reading' the file whenever it's called on)

    each time i change the script, i have to republish... but it's a nice feature, 'cause the scripting can be done in a better text editor

  3. #3
    Member
    Join Date
    Apr 2001
    Location
    AU
    Posts
    42

    Lightbulb

    im not sure if this works, but u might be able to use
    //blah.txt text file
    action1=trace("w00t w00t")&action2=trace("h4x0r")

    //actionscript
    loadVariables (blah.txt , 0);
    then
    eval(action1);
    eval(action2);

    you might want to test this as im not sure whether the contents of the text file will be read by the loadvariables command peoperly cos of formating.

  4. #4
    Member
    Join Date
    Apr 2001
    Location
    AU
    Posts
    42
    sorry i was quite confused about the eval statement
    i withdraw my contribution and hang my head in shame.

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