I am trying to follow a Jumpeye tutorial, but am having trouble with the XML part
The code is:
import com.jumpeye.Events.TXEFFEvents;
// The Timer object is used to put a delay of 1 second between the
// show and hide transitions.
var timerObject:Timer = new Timer(1000, 1);
// The transition type which will change from “show” to “hide” and
// “hide” to “show” after each transition has endded.
var transitionType:String = “show”;
// The index of the current line from the xml file (the <text> nodes).
var textIndex:int = 0;
// The XML object that will hold the data read from the xml file.
var xmlData:XML = new XML();
var loaderObject:URLLoader = new URLLoader(new URLRequest(“slideimages.xml”));
loaderObject.addEventListener(Event.COMPLETE, loaderHandler);
timerObject.addEventListener(TimerEvent.TIMER, timerHandler);
textEffect.addEventListener(TXEFFEvents.TRANSITION_END, transitionHandler);
// After the xml file has loaded, the first line of text is set into
// the text field and then the TxEff component instance is set up and
// starts the “show” transition.
function loaderHandler(eventObj:Event):void {
xmlData = XML(loaderObject.data);
//example_txt.text = xmlData.text[textIndex];
example_txt.text = xmlData.slide[0].promotion.text()
textEffect._targetInstanceName = “example_txt”;
textEffect.transitionEffect(transitionType);
}
// This timer handler is called whenever the timer object has reached
// the delay of 1 second. Then the timer is stopped and a new show or
// hide transition starts.
function timerHandler(eventObj:TimerEvent):void {
timerObject.stop();
if (transitionType == “show”) transitionType = “hide”;
else transitionType = “show”;
textEffect.transitionEffect(transitionType);
}
// This functin is called whenever a show or hide transition ends.
function transitionHandler(evtObj:TXEFFEvents):void {
if (transitionType == “show”) {
// When a show transition has endded, the timer starts, so it
// will introduce a delay of one second until the hide
// transition starts.
timerObject.start();
}
else {
// When a hide transition has endded, the text from the next
// <text> node is written into the text field. Then, the
// transition type is set to “show” and a new show transition
// starts. When the last line of text has been displayed, the
// index is set back to 0, so the text will be displayed all
// over again.
textIndex++;
if (textIndex == xmlData.text.length()) textIndex = 0;
example_txt.text = xmlData.text[textIndex];
transitionType = “show”;
textEffect.transitionEffect(transitionType);
}
}
and the XML structure is:
<slideshow>
<slide>
<image>Main_banner.swf</image>
<line1>SIGN UP AND PLAY WITH LIZ LIEU</line1>
<line2>DEPOSIT BONUSE 100% UP TO $600</line2>
<line3>PROFESSIONAL PLAYER</line3>
<promotion>Fast & Free Download </promotion>
<promotion>Live Support 24/7 </promotion>
<promotion>Secure Deposits, Fast Cashouts </promotion>
<promotion>4</promotion>
<promotion>5</promotion>
<promotion>6</promotion>
<promotion>7</promotion>
<playfree>PLAY</playfree>
<playfree1>FOR</playfree1>
<playfree2>FREE</playfree2>
<professional>Professional Player</professional>
</slide>
<slide>
<image>Promo1.swf</image>
<line1>CASH CHALLENGE</line1>
<line2>$7,000</line2>
<line3>TO WIN</line3>
</slide>
<slide>
<image>Promo2.swf</image>
<line1>$4.5 MILLION GUARANTEED</line1>
</slide>
<slide>
<image>Promo3.swf</image>
<line1>EXCLUSIVE!</line1>
<line2>GET YOUR CHILIPOKER</line2>
<line3>MASTERCARD</line3>
<currency> $ </currency>
</slide>
</slideshow>
Error is:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at Main_banner_fla::MainTimeline/transitionHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at TXEFF/dispatchEvent()
at MethodInfo-1437()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.transitions::Tween/set time()
at fl.transitions::Tween/nextFrame()
at fl.transitions::Tween/onEnterFrame()