Results 1 to 6 of 6

Thread: Pictures in External txt file

  1. #1
    Join Date
    Mar 2006
    Location
    Nashville, TN
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default Pictures in External txt file

    I am using this in my flash movie:

    loadVariables("file.txt",_root);

    but in my text file how do I put in images?
    I have tried: Home_logo=bulldog.jpg&

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Try using tis in your fla:

    Code:
    var currentSlide = 0;
    
    var myLV = new LoadVars();
    
    myLV.load("data.txt");
    
    myLV.onLoad = function(success) {
    
        if (success) {
    
            img_arr = this.arrayVar.split("||");
    
            _root.attachMovie("slideshow", "show", 1, {_x:0, _y:0, _visible:false, fps:18, nFrames:24, alphaIncr:10, slides_arr:img_arr, slideDepth:1, repeat:true, slideTracker:"currentSlide"});
    
            show.addListener(_root);
    
            _root.onAllSlidesLoaded = function() {
    
                show._visible = true;
    
                show.beginTransitions();
    
            };
    
        } else {
    
            // the vars couldn't be loaded.
    
        }
    
    };
    and this in your .txt:

    Code:
    &arrayVar=1.jpg||2.jpg||3.jpg||4.jpg&
    Should pull everything out just nice like
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Mar 2006
    Location
    Nashville, TN
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You put the "&" sign on both sides of the array?
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Mar 2006
    Location
    Nashville, TN
    Posts
    600
    Thanks
    5
    Thanked 4 Times in 4 Posts

    Default

    Like this
    Code:
    &arrayVar=1.jpg||2.jpg||3.jpg||4.jpg&
    or this:
    Code:
    &arrayVar&=1.jpg||2.jpg||3.jpg||4.jpg&

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    It is like the first one, at the very beginning of the array line and at the very end.

    Have you thought about using XML instead of plain text?
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •