Actionscript+XML Picture Fading Slideshow Help

  • clicky
  • Student
  • Student
  • clicky
  • Posts: 74
  • Loc: USA

Post 3+ Months Ago

I would like to create a xml based slideshow where only two movieclips exist, an array of the total number of pictures is obtained from an xml file, and each picture alpha fades to the next. I have seen this done a few times and looked over the code so I know the general idea but need help, so I will describe in in pseudocode. I have made it here(http://www.jerble.com/Other/home.swf) in flash, but would now like to integrate xml and do it in actionscript.

Code:

Code: [ Select ]
rootNode = new XML();
rootNode.ignoreWhite = true;
rootNode.load("pictures.xml");

rootNode.onLoad = function(success) {
if (success) {
var ef = rootNode.firstChild.childNodes;
_global.ef=ef;

}
}

//PSEUDOCODE BEGINS
variable one=new movieclip;
variable two=new movieclip;

for(i=0;i<ef.length();i++)
{

one=box.load()=ef[i].firstChild.nodeValue; (where the value is the url of the image)

for(j=0;j<100();j++)
{

if (j==50) then: two=text=ef[i+1].firstChild.nodeValue; (so that only one image will be loaded initially to minimize load time)
if (j==80) then: one=one.alpha[(100-j)*5] (thus the original alpha is 100, and it decreases by values of 5 for each "j")

}

}
  1. rootNode = new XML();
  2. rootNode.ignoreWhite = true;
  3. rootNode.load("pictures.xml");
  4. rootNode.onLoad = function(success) {
  5. if (success) {
  6. var ef = rootNode.firstChild.childNodes;
  7. _global.ef=ef;
  8. }
  9. }
  10. //PSEUDOCODE BEGINS
  11. variable one=new movieclip;
  12. variable two=new movieclip;
  13. for(i=0;i<ef.length();i++)
  14. {
  15. one=box.load()=ef[i].firstChild.nodeValue; (where the value is the url of the image)
  16. for(j=0;j<100();j++)
  17. {
  18. if (j==50) then: two=text=ef[i+1].firstChild.nodeValue; (so that only one image will be loaded initially to minimize load time)
  19. if (j==80) then: one=one.alpha[(100-j)*5] (thus the original alpha is 100, and it decreases by values of 5 for each "j")
  20. }
  21. }





Thanks for any help, and please keep in mind that I am not familiar with the syntax for the part I wrote in the pseudocode section, so any corrections are appreciated. Note: this would crash after it reaches the end because at i=last and j=80, i +1 would not exist, but I did not deal with the error for simplicity.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.