A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: importing txt file and using as variable

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    485

    importing txt file and using as variable

    Hello,

    I am trying to import a text file, I want the content of the text file to be used as part of a dynamically loaded sound file.

    I think the problem is my syntax....

    my AC

    loadVariablesNum("sound.txt", 0);
    var my_sound_name = soundname;

    var my_sound:Sound = new Sound();
    my_sound.loadSound("soundname", isStreaming)
    my_sound.loadSound("soundname", true);

    My text file is called sound.txt and this is its contents

    &soundname=1a.MP3

    What am i missing here?

    Justin

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    485
    well,

    this is weird, i can get the name of the mp3 to display in a dynamic textbox by using "soundname" as the var, but i cant get it t work with my creating a sound object

  3. #3
    Senior Member
    Join Date
    May 2001
    Posts
    485
    this is my code now

    var soundname;

    loadVariablesNum("sound.txt", 0);
    //var my_sound_name = soundname;



    var my_sound:Sound = new Sound();
    my_sound.loadSound(soundname, isStreaming)
    my_sound.loadSound(soundname, true);
    trace(soundname);

    my trace come sup as undefined, yet the dynamic text box is displying it properly

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