Instantiate Slideshow Video using only code
Updated: Jul 9, 2010
Views: 218
Description: Learn how to instantiate and work with the Slideshow Video component using only Actionscript code.
1. Drag an instance of the Slideshow component in the Library.
2. Instantiate the component and add it to the stage.
import com.afcomponents.slideshow.Slideshow;
var mySlideshow:Slideshow = new Slideshow();
addChild(mySlideshow);
var mySlideshow:Slideshow = new Slideshow();
addChild(mySlideshow);
3. Create an XML file, as explained in this tutorial, and pass it to the xmlPath property.
mySlideshow.xmlPath = "images.xml";
4. Set a few properties
mySlideshow.setSize(400, 250);
mySlideshow.move(20, 10);
mySlideshow.autoSlideshow = true;
mySlideshow.border = true;
mySlideshow.preloaderType = "pie";
mySlideshow.move(20, 10);
mySlideshow.autoSlideshow = true;
mySlideshow.border = true;
mySlideshow.preloaderType = "pie";
Here's the complete code:
//import the Slideshow class
import com.afcomponents.slideshow.Slideshow;
import com.afcomponents.events.SlideshowEvent;
// create an instance of the Slideshow
var mySlideshow:Slideshow = Slideshow();
// add the instance to the display list
addChild(mySlideshow);
// set the source
mySlideshow.xmlPath = "images.xml";
// set the dimension and position
mySlideshow.setSize(500, 300);
mySlideshow.move(20, 10);
// set some properties
mySlideshow.autoSlideshow = true;
mySlideshow.border = true;
mySlideshow.preloaderType = "pie";
import com.afcomponents.slideshow.Slideshow;
import com.afcomponents.events.SlideshowEvent;
// create an instance of the Slideshow
var mySlideshow:Slideshow = Slideshow();
// add the instance to the display list
addChild(mySlideshow);
// set the source
mySlideshow.xmlPath = "images.xml";
// set the dimension and position
mySlideshow.setSize(500, 300);
mySlideshow.move(20, 10);
// set some properties
mySlideshow.autoSlideshow = true;
mySlideshow.border = true;
mySlideshow.preloaderType = "pie";
Other Tutorials
