Helpful Information
 
 
Category: Flash
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&

Try using tis in your fla:



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:



&arrayVar=1.jpg||2.jpg||3.jpg||4.jpg&


Should pull everything out just nice like :D

Doesn't work.

You put the "&" sign on both sides of the array?

Like this

&arrayVar=1.jpg||2.jpg||3.jpg||4.jpg&

or this:

&arrayVar&=1.jpg||2.jpg||3.jpg||4.jpg&

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?










privacy (GDPR)