Building a slideshow gallery with xml, but alas I am stuck…
With this code and a UILoader component, I keep getting these screwy errors:
TypeError: Error #1034: Type Coercion failed: cannot convert true to flash.display.MovieClip.
at MyTicketShow_fla::MainTimeline/onComplete()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Error #2044: Unhandled ioError:. text=Error #2035: URL Not Found. URL: file:///data/MTO%5FMy%5FTicket%5FOffice/Online%20Ticket/flash/
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import gs.*;
var slidesX:XML;
var picList:XMLList;
var currentPic:Number = 0;
var loader:URLLoader = new URLLoader();
var timeline:TimelineLite = new TimelineLite();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("slideshow.xml"));
function onComplete(e:Event):void {
slidesX = new XML(loader.data);
picList = slidesX.img;
updatePic(currentPic);
txtBox_mc.getTix = true;
txtBox_mc.next_btn = true;
txtBox_mc.prev_btn = true;
txtBox_mc.next_btn.addEventListener(MouseEvent.CLICK, nextPic);
txtBox_mc.prev_btn.addEventListener(MouseEvent.CLICK, prevPic);
}
function nextPic(e:MouseEvent):void {
if (currentPic < picList.length() - 1) {
currentPic++;
} else {
currentPic = 0;
}
updatePic(currentPic);
}
function prevPic(e:MouseEvent):void {
if (currentPic == 0) {
currentPic = picList.length() - 1;
} else {
currentPic--;
}
updatePic(currentPic);
}
function updatePic(index:Number):void {
picLoader.source = picList[index].img;
txtBox_mc.Shower.htmlText = picList[index].shower;
txtBox_mc.Dater.htmlText = picList[index].dater;
txtBox_mc.Placer.htmlText = picList[index].placer;
}
txtBox_mc.x = 0;
txtBox_mc.y = 290;
timeline.insert(new TweenLite(txtBox_mc, .5, {y:190, ease:Back.easeOut}), 0);
frustration is setting in…
Thanks for all the help!