How to load multiple SWFs through XML


hello friends,
dear, making slideshow in want add multiple swf files (10 files) through xml. poor in scripting that's why need yours help.

actually used following code;

---------------------------------------------------------------------------------------

var banner:xml = new xml();
banner.ignorewhite = true;
banner.load("banner.xml");

banner.onload = function(success) {
var videos:array = this.firstchild.childnodes;
var aq = videos.length;
for (var i:number = aq; > 0; i--) {
loadmovie(videos .attributes.url, target_mc);
}
};
------------------------------------------------------------------------------------------ ---

, in xml used format;

----------------------------------------------------------------------------------------- ----
<?xml version="1.0" encoding="iso-8859-1"?>

<videos>
<video url="a.swf" />
<video url="b.swf" />
</videos>
------------------------------------------------------------------------------------------

in case load 1 swf movie , stopped. not play other movie. please me solve issue, how can load multiple sfw files.
it's urgent dear, if guide me i'll thankful you. lot!

ahsanaas,

these few lines here problem:

for (var i:number = aq; > 0; i--) {
loadmovie(videos .attributes.url, target_mc);
}

consider you're asking swf do: for() loop runs
instructions in quick succession. xml indicates 2 additional swfs,
might 5 (or ten, or dozens) -- doesn't matter. in cases,
you're loading every additional swf file same target (they load
target_mc). new swf requested, replaces whatever
in target_mc already.

if want swfs show @ once, you'll have create target
each of them. beforehand, defeat
purpose of using xml in first place (xml supposed give
flexibility in determining external content without recompiling main
swf; it's more useful when number of external swfs can
determined xml). if want each external swf loaded
own target, use movieclip.createemptymovieclip() method
produce these targets @ runtime. in same way used variable
in for() loop (videos
) use again ensure unique
instance names , depths targets:

for (var i:number = aq; > 0; i--) {
var target_mc = this.createemptymovieclip("container" + i, i);
loadmovie(videos .attributes.url, target_mc);
}

in fact, use reposition these new targets via
movieclip._x property (or _y):

for (var i:number = aq; > 0; i--) {
var target_mc = this.createemptymovieclip("container" + i, i);
mc._x = * 100;
loadmovie(videos
.attributes.url, target_mc);
}

... , on. didn't if need loaded swfs present @
once. maybe need them loaded sequentially?


david stiller
co-author, foundation flash cs3 designers
http://tinyurl.com/2k29mj
"luck residue of design."




More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support