Flash CS5: AS3: Weird XML errors?
I was working with one of the pre made templates in CS5, the "advanced slideshow presentation" one, all of the sudden I went to get a publish preview and it spit out a whole bunch of xml errors, which I am unfamiliar with.
SlidesMovieClip_2, Line 14 1104: invalid xml name
SlidesMovieClip_2, Line 253 1084: Syntax error: expecting xmltagendend before end of program.
SlidesMovieClip_2, Line 253 1100: Syntax error: XML does not have matching begin and end tags.
SlidesMovieClip_2, Line 253 1100: Syntax error: XML does not have matching begin and end tags.
SlidesMovieClip_2, Line 253 1100: Syntax error: XML does not have matching begin and end tags.
SlidesMovieClip_2, Line 253 1084: Syntax error: expecting rightparen before end of program.
SlidesMovieClip_2, Line 253 1084: Syntax error: expecting rightbrace before end of program.
SlidesMovieClip_2, Line 253 1073: Syntax error: expecting a catch or a finally clause.
As far as I know, a "SlideshowMovieClip_2" doesn't even exist? I'm not sure what is going on but I will leave the code and hopefully you guys can figure something!
code:
import fl.transitions.*;
// USER CONFIG SETTINGS
var buttonsOn:Boolean = true; // true, false
var pageNumberOn:Boolean = true; // true, false
var transitionOn:Boolean = true; // true, false
var transitionType:String = "Fade"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random
// END USER CONFIG SETTINGS
// EVENTS
stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_changeSlideKeyboard);
prev_btn.addEventListener(MouseEvent.CLICK, fl_prevSlideButton);
next_btn.addEventListener(MouseEvent.CLICK, fl_nextSlideButton);
function fl_changeSlideKeyboard(evt:KeyboardEvent):void
{
if(evt.keyCode == 37) // LEFT
{
fl_prevSlide();
}
else if (evt.keyCode == 39 || evt.keyCode == 32) // RIGHT OR SPACE
{
fl_nextSlide();
}
}
function fl_prevSlideButton(evt:MouseEvent):void
{
fl_prevSlide();
}
function fl_nextSlideButton(evt:MouseEvent):void
{
fl_nextSlide();
}
// END EVENTS
// FUNCTIONS AND LOGIC
function fl_prevSlide():void
{
if(slides_mc.currentFrame > 1)
{
slides_mc.gotoAndStop(slides_mc.currentFrame-1);
if(transitionOn == true)
{
fl_doTransition();
}
if(pageNumberOn == false)
{
slideNumber_txt.text = "";
} else {
slideNumber_txt.text = String(slides_mc.currentFrame + "/" + slides_mc.totalFrames);
}
}
}
function fl_nextSlide():void
{
if(slides_mc.currentFrame < slides_mc.totalFrames)
{
slides_mc.gotoAndStop(slides_mc.currentFrame+1);
if(transitionOn == true)
{
fl_doTransition();
}
if(pageNumberOn == false)
{
slideNumber_txt.text = "";
} else {
slideNumber_txt.text = String(slides_mc.currentFrame + "/" + slides_mc.totalFrames);
}
}
}
function fl_doTransition():void
{
if(transitionType == "Blinds")
{
TransitionManager.start(slides_mc, {type:Blinds, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fade")
{
TransitionManager.start(slides_mc, {type:Fade, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Fly")
{
TransitionManager.start(slides_mc, {type:Fly, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Iris")
{
TransitionManager.start(slides_mc, {type:Iris, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Photo")
{
TransitionManager.start(slides_mc, {type:Photo, direction:Transition.IN, duration:0.25});
} else if (transitionType == "PixelDissolve")
{
TransitionManager.start(slides_mc, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Rotate")
{
TransitionManager.start(slides_mc, {type:Rotate, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Squeeze")
{
TransitionManager.start(slides_mc, {type:Squeeze, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Wipe")
{
TransitionManager.start(slides_mc, {type:Wipe, direction:Transition.IN, duration:0.25});
} else if (transitionType == "Zoom")
{
TransitionManager.start(slides_mc, {type:Zoom, direction:Transition.IN, duration:0.25});
} else if (开发者_JAVA百科transitionType == "Random")
{
var randomNumber:Number = Math.round(Math.random()*9) + 1;
switch (randomNumber) {
case 1:
TransitionManager.start(slides_mc, {type:Blinds, direction:Transition.IN, duration:0.25});
break;
case 2:
TransitionManager.start(slides_mc, {type:Fade, direction:Transition.IN, duration:0.25});
break;
case 3:
TransitionManager.start(slides_mc, {type:Fly, direction:Transition.IN, duration:0.25});
break;
case 4:
TransitionManager.start(slides_mc, {type:Iris, direction:Transition.IN, duration:0.25});
break;
case 5:
TransitionManager.start(slides_mc, {type:Photo, direction:Transition.IN, duration:0.25});
break;
case 6:
TransitionManager.start(slides_mc, {type:PixelDissolve, direction:Transition.IN, duration:0.25});
break;
case 7:
TransitionManager.start(slides_mc, {type:Rotate, direction:Transition.IN, duration:0.25});
break;
case 8:
TransitionManager.start(slides_mc, {type:Squeeze, direction:Transition.IN, duration:0.25});
break;
case 9:
TransitionManager.start(slides_mc, {type:Wipe, direction:Transition.IN, duration:0.25});
break;
case 10:
TransitionManager.start(slides_mc, {type:Zoom, direction:Transition.IN, duration:0.25});
break;
}
} else
{
trace("error - transitionType not recognized");
}
}
if(buttonsOn == false)
{
prev_btn.visible = false;
next_btn.visible = false;
}
slides_mc.gotoAndStop(1);
stage.scaleMode = StageScaleMode.SHOW_ALL;
// END FUNCTIONS AND LOGIC
stop();
Sorry, but there is missing information here. The code you posted does not look like it relates to your errors.
I see an 'invalid xml name' error - did you rename any xml variables, move files, or otherwise alter an xml file? If so, retrace your steps and undo whatever you did.
As for the second set if errors, it looks like you erased a bracket by mistake. You're going to have to dig in and find whatever code is driving 'slidesMovieClip_2' and find the missing brace.
hope that steers you in the right direction ---
精彩评论