actionscript path level? sos

  • karolinio
  • Born
  • Born
  • karolinio
  • Posts: 3
  • Loc: GREECE

Post 3+ Months Ago

hello!
i seem to have my paths a little bit crossed in a site im making.
am trying to make a slideshow in my swf that is told by my xml file which jpgs to use etc.
i found one and it works fine alone. however when i try to tie it in with the rest of my site something goes wrong.

here is my code for the slideshow:

Code: [ Select ]
import mx.transitions.Tween;
import mx.transitions.easing.*;
import mx.xpath.XPathAPI;
var delay:Number;
var animationDuration:Number;
var current_num:Number = 0;
var first_num:Number = 0;
var image_holder:MovieClip = this.createEmptyMovieClip("image_holder", this.getNextHighestDepth());
var mcl_lis:Object = new Object();
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(mcl_lis);
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function( isLoaded:Boolean )
{
if( isLoaded )
{
data_arr = XPathAPI.selectNodeList(this.firstChild,"Slideshow/images/image");
delay = parseInt(XPathAPI.selectSingleNode(this.firstChild ,"Slideshow/settings/delay").firstChild);
animationDuration = parseInt(XPathAPI.selectSingleNode(this.firstChild ,"/animationDuration").firstChild);
//optional code to check delay and animationDuration values
//(delay == undefined || delay == null) ? delay = 5000: delay<1000? delay =1000:true;
//(animationDuration == undefined || animationDuration == null) ? animationDuration = .8: animationDuration<.3? animationDuration =.8:true;
load_image();
}else
{
trace("XML Load error");
}
}
xml.load("xml/data.xml")

function load_image()
{
mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
(current_num>=data_arr.length-1) ? current_num = first_num:current_num++;
}

mcl_lis.onLoadInit = function(target_mc:MovieClip) {
var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 0, 100, .5, true);
setTimeout(function(){
var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 100, 0, .5, true);
obj.onMotionFinished = function() {load_image();};
},5000);
};
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. import mx.xpath.XPathAPI;
  4. var delay:Number;
  5. var animationDuration:Number;
  6. var current_num:Number = 0;
  7. var first_num:Number = 0;
  8. var image_holder:MovieClip = this.createEmptyMovieClip("image_holder", this.getNextHighestDepth());
  9. var mcl_lis:Object = new Object();
  10. var mcl:MovieClipLoader = new MovieClipLoader();
  11. mcl.addListener(mcl_lis);
  12. var xml:XML = new XML();
  13. xml.ignoreWhite = true;
  14. xml.onLoad = function( isLoaded:Boolean )
  15. {
  16. if( isLoaded )
  17. {
  18. data_arr = XPathAPI.selectNodeList(this.firstChild,"Slideshow/images/image");
  19. delay = parseInt(XPathAPI.selectSingleNode(this.firstChild ,"Slideshow/settings/delay").firstChild);
  20. animationDuration = parseInt(XPathAPI.selectSingleNode(this.firstChild ,"/animationDuration").firstChild);
  21. //optional code to check delay and animationDuration values
  22. //(delay == undefined || delay == null) ? delay = 5000: delay<1000? delay =1000:true;
  23. //(animationDuration == undefined || animationDuration == null) ? animationDuration = .8: animationDuration<.3? animationDuration =.8:true;
  24. load_image();
  25. }else
  26. {
  27. trace("XML Load error");
  28. }
  29. }
  30. xml.load("xml/data.xml")
  31. function load_image()
  32. {
  33. mcl.loadClip(data_arr[current_num].attributes.url, image_holder);
  34. (current_num>=data_arr.length-1) ? current_num = first_num:current_num++;
  35. }
  36. mcl_lis.onLoadInit = function(target_mc:MovieClip) {
  37. var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 0, 100, .5, true);
  38. setTimeout(function(){
  39. var obj:Tween = new Tween(target_mc, "_alpha", Normal.easeIn, 100, 0, .5, true);
  40. obj.onMotionFinished = function() {load_image();};
  41. },5000);
  42. };





is there someplace i can add or change my path.

i have a file named preloader.swf with a main menu with 4 options. when you choose one it goes to an mc called news.(still however preloader.swf). there in my news comes an xml based list and from that list one should click on a lits item and get the relevant slideshow.


thank you
Moderator Remark: added [code] tags

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 3 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.