Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //box control
- boxx = _root.box._x
- boxy = _root.box._y
- boxh = _root.box._height
- boxw = _root.box._width
- boxp = 10
- var curSlide = 0;
- var tour:Array = new Array();
- mcLoader = new MovieClipLoader();
- mcLoader.addListener(this);
- //load the XML file
- var xmlFile:XML = new XML();
- xmlFile.ignoreWhite = true;
- xmlFile.onLoad = function(success) {
- if (success) {
- xml = xmlFile.firstChild.childNodes;
- trace(xml.length);
- w = ( (boxw - boxp*(xml.length+1)) / xml.length)
- for (var i = 0; i<=xml.length-1; i++) {
- tour[i] = Array(xml[i].attributes.image, xml[i].attributes.text);
- trace(tour[i][1]);
- _root.box.duplicateMovieClip("box" + i,i+5000,{_x:boxx+(w*i)+boxp*(i+1),_width:w});
- _root["box" + i].box_btn.num = i;
- _root["box" + i].box_btn.onRelease = function() {
- selectSlide(this.num);
- }
- }
- } else {
- trace("LEEEEROOOYYY JEEEEENKIIIINS!!!! XML not found. Your flash asplode.");
- }
- selectSlide(0);
- };
- // Load the XML
- xmlFile.load("tour.xml");
- function selectSlide(num) {
- if (num<0 || num>_root.tour.length-1) {
- trace("selectSlide was called with an out of bounds number. :"+num);
- return;
- }
- trace("selecting slide #"+num);
- _root["box" + curSlide].gotoAndStop(1);
- curSlide = num;
- _root["box" + curSlide].gotoAndStop(2);
- mcLoader.loadClip(_root.tour[num][0], _root.holder1_mc.image_mc);
- with (_root.holder1_mc) {
- para_txt.htmlText = _root.tour[num][1];
- }
- }
- _root.prev_btn.onRelease = function() {
- selectSlide(_root.curSlide-1);
- };
- _root.next_btn.onRelease = function() {
- selectSlide(_root.curSlide+1);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement