xml with title and description

Discussions about the Slideshow component.

xml with title and description

Postby itgranny on Tue Oct 06, 2009 2:04 am

I was hoping that example 3 was xml driven. (the one with the title and description). Is this possible? will the component bring in the xml for the text?
itgranny
 
Posts: 2
Joined: Tue Oct 06, 2009 2:00 am

Re: xml with title and description

Postby David on Tue Oct 06, 2009 7:15 am

Yes, it's possible.

Just use this XML:

Code: Select all
<images>
   <image source="images/image1.jpg" title="Image 1" description="This is the 1st image."/>
   <image source="images/image2.jpg" title="Image 2" description="This is the 2nd image."/>
   <image source="images/image3.jpg" title="Image 3" description="This is the 3rd image."/>
   <image source="images/image4.jpg" title="Image 4" description="This is the 4th image."/>
   <image source="images/image5.jpg" title="Image 5" description="This is the 5th image."/>
   <image source="images/image6.jpg" title="Image 6" description="This is the 6th image."/>
   <image source="images/image7.jpg" title="Image 7" description="This is the 7th image."/>
   <image source="images/image8.jpg" title="Image 8" description="This is the 8th image."/>
   <image source="images/image9.jpg" title="Image 9" description="This is the 9th image."/>
   <image source="images/image10.jpg" title="Image 10" description="This is the 10th image."/>
</images>


and then use this code to display the title and description:

Code: Select all
mySlideshow.addEventListener(SlideshowEvent.ITEM_COMPLETE, itemCompleteHandler);

function itemCompleteHandler(event:SlideshowEvent):void
{
   title.text = event.data.title;
   description.text = event.data.description;
}


You can also take a look at dataSlideshow.fla which takes the title and description from the images_data.xml file.
David
Site Admin
 
Posts: 350
Joined: Tue Nov 04, 2008 4:38 pm

Re: xml with title and description

Postby itgranny on Tue Oct 06, 2009 12:12 pm

I'm sorry. I shoudl have looked everything over more carefully. Thank you. this works beautifully.
itgranny
 
Posts: 2
Joined: Tue Oct 06, 2009 2:00 am

Re: xml with title and description

Postby David on Tue Oct 06, 2009 1:55 pm

No problem. Let me know whenever you have a question.
David
Site Admin
 
Posts: 350
Joined: Tue Nov 04, 2008 4:38 pm

Re: xml with title and description

Postby ew_holmes on Mon Nov 01, 2010 5:22 pm

I am having similar problems with bringing in a title and description.

This is the error I have getting. I used example 4, and selected all the code given by you, David.

1119: Access of possibly undefined property data through a reference with static type com.flashotaku.slideshow.events:SlideshowEvent.
ew_holmes
 
Posts: 1
Joined: Mon Nov 01, 2010 5:05 pm

Re: xml with title and description

Postby David on Mon Nov 01, 2010 6:02 pm

You can email me the files (contact [at] flashotaku [dot] com) and I'll take a look.
David
Site Admin
 
Posts: 350
Joined: Tue Nov 04, 2008 4:38 pm


Return to Slideshow

Who is online

Users browsing this forum: No registered users and 0 guests

cron