Help i posted this today but forgot how attach the adress i want to learn how to make a picture slider similary to this on the lefthand site on this site anybody knows if there are any tutorial to do this.... Thanks and have a good weekend
yo dude kafkat, i dont know any tutorial but i will make one for you:
prerequisites needed to understand this tutorial:
as3/as2 basics, (for loop, array, events);
xml;
class;
Timer;
loading external images to flash;
arranging movieclips;
tweener;
step 1: prepare your workfiles:
-create a folder mySlideshow
-create a new .fla file, name it main.fla, save it to the folder mySlideshow
-create a new .as file, name it theSlideShow.as, save it to the folder mySlideshow
-create a new .xml file, name it photosXml.xml save it to the folder mySlideshow
-create a new folder, name it photos save it to the folder mySlideshow
-download the tweener file, search from google (you will need the folder "caurina"): this is for transition effects
now you have all the files needed, so we start!
step 2: prepare photos and xml
-add the desired photos to the photos folder
-open the xml file and add the photos filename in it:
for example:
<photos>
<img location="img1.jpg" \>
<img location="img2.jpg" \>
<img location="img3.jpg" \>
</photos>
step 3:
-open main.fla
-open actions panel in layer 1 frame 1
-copy and paste this:
Actionscript Code:
var slideShow:MovieClip = new photoSlideshow(); addChild(slideShow);
step 4:
-open photoSlideshow.as
- copy and paste this
publicclass photoSlideshow extendsMovieClip{ var delay:Timer = new Timer(2000,1); var smallButtonIcon:MovieClip; var previousImage:Object; var myXML:XML; var imgList:XMLList; var buttonsContainer:MovieClip; var picturesContainer:MovieClip; var pictureWidth:Number = 300; var pictureHeight:Number = 300; var currentImage:Number = 0;
var urlRequest:URLRequest = new URLRequest("photosXml.xml"); var loader:URLLoader = new URLLoader(urlRequest); loader.addEventListener(Event.COMPLETE, xmlLoaded); loader.load(urlRequest); } privatefunction xmlLoaded(e:Event):void{ picturesContainer = newMovieClip(); addChild(picturesContainer);
I know the array of loops and so many thanks for the tutorial i have done it the way you told but it do not seem to work when i test main.fla it does only show a white empty box???