Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-01-2012, 12:36 AM   #1
hootiehoo
Registered User
 
Join Date: Sep 2011
Posts: 4
Default loading multiple xmls of images into multiple movieclips

hello!

i've been trying to get this code to work for several days now and am on the edge of lunacy! perhaps I'm just not searching under the correct thing, but I've had not luck finding exactly what I need. The following code is working for individual mcs, however the issue is I need to get this code to work for multiple mcs (8 total) that are on the stage and playing simultaneously, each loading it's own xml of images.

hope that made some sense - i'm desperate for some input/help!!

import mx.transitions.Tween;
import mx.transitions.easing.*;

var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("images_1.xml");

myShowXML.onLoad = function() {
_root.myWidth = myShowXML.firstChild.attributes.width;
_root.myHeight = myShowXML.firstChild.attributes.height;
_root.mySpeed = myShowXML.firstChild.attributes.speed;

_root.myImages = myShowXML.firstChild.childNodes;
_root.myImagesNo = myImages.length;

createContainer();
callImages();

};


function createContainer() {
_root.createEmptyMovieClip("myContainer_mc",1);

myContainer_mc.lineTo(_root.myWidth,0);
myContainer_mc.lineTo(_root.myWidth,_root.myHeight );
myContainer_mc.lineTo(0,_root.myHeight);
myContainer_mc.lineTo(0,0);

myContainer_mc._x = (Stage.width-myContainer_mc._width)/2;
myContainer_mc._y = (Stage.height-myContainer_mc._height)/2;

}

function callImages() {

_root.myMCL = new MovieClipLoader();
_root.myPreloader = new Object();
_root.myMCL.addListener(_root.myPreloader);

_root.myClips_array = [];


_root.myPreloader.onLoadComplete = function(target) {

_root.myClips_array.push(target);
target._alpha = 0;

if (_root.myClips_array.length == _root.myImagesNo) {

_root.myText_txt._y = myContainer_mc._y + myContainer_mc._height;
_root.target_mc = -1;
moveSlide();
myShowInt = setInterval(moveSlide, (_root.mySpeed*1000)+1000);


}

};

for (i=0; i<_root.myImagesNo; i++) {

temp_url = _root.myImages[i].attributes.url;
temp_mc = myContainer_mc.createEmptyMovieClip(i, myContainer_mc.getNextHighestDepth());

_root.myMCL.loadClip(temp_url,temp_mc);
}

}


function moveSlide() {

current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);

_root.target_mc++;

if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
}


next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);

}
hootiehoo is offline   Reply With Quote
Old 05-01-2012, 01:27 AM   #2
tacos
Grrrrrrrrreat!
 
tacos's Avatar
 
Join Date: Apr 2007
Location: Montréal, Québec
Posts: 5,473
Default

http://www.actionscript.org/resource...ers/Page1.html
__________________
WHO I WAS...
BANDS OF THE 80's
tacos is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:47 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.