Showing posts with label Flash tutorial. Show all posts
Showing posts with label Flash tutorial. Show all posts




Slideshow is really kinda rare at the internet , I tried to look at some ready Slideshow that need just some modification and here we are ready , but it seems that I can't find what I want, that why I want to write this tutorial to help some people like me that are interested in a slide show .

This slide show is made with Flash 8 and ActionScript 2, and Will use the XML File .

The XML File "filelist.xml" would look like something like this :


<?xml version="1.0" encoding="utf-8"?>
<imagelist> <pix>img1.jpg</pix>
<pix>img2.jpg</pix>
<pix>img3.jpg</pix>
</imagelist>

At the First Frame Paste This Code



var counter:Number = 0;


var XMLValue:XML = new XML();
XMLValue.ignoreWhite = true;
XMLValue.load("filelist.xml");
XMLValue.onLoad = function(success) {

if (success) {
ChangeClip(XMLValue);
intervalId = setInterval(ChangeClip, 10000, XMLValue );
}

};



function ChangeClip(XMLValue) {
element = XMLValue.firstChild;

if(element.childNodes[counter].firstChild.nodeValue==undefined){
counter = 0;
}




this.createEmptyMovieClip("ourMovieClip",this.getNextHighestDepth());
ourMovieClip._alpha = 0;


loadMovie(element.childNodes[counter].firstChild.nodeValue, "ourMovieClip");

easeType = mx.transitions.easing.Regular.easeOut;
var begin = 20;
var end = 100;
var time = .5;
var mc = ourMovieClip;

ballTween = new mx.transitions.Tween(mc, "_alpha", easeType, begin, end, time, true);

counter++;


}

Now let's Analyse the code a little bit for more understanding to this slideshow.

var XMLValue:XML = new XML();
XMLValue.ignoreWhite = true;
XMLValue.load("filelist.xml");
XMLValue.onLoad = function(success) {

if (success) {
ChangeClip(XMLValue);
intervalId = setInterval(ChangeClip, 10000, XMLValue );
}

};
This Snippet of Code will load the xml file , and will launch the function ChangeClip() with an interval of 10 seconds , which means that the function will be repeated each 10 seconds and will change the picture.

function ChangeClip(XMLValue) {
element = XMLValue.firstChild;

if(element.childNodes[counter].firstChild.nodeValue==undefined){
counter = 0;
}




this.createEmptyMovieClip("ourMovieClip",this.getNextHighestDepth());
ourMovieClip._alpha = 0;


loadMovie(element.childNodes[counter].firstChild.nodeValue, "ourMovieClip");

easeType = mx.transitions.easing.Regular.easeOut;
var begin = 20;
var end = 100;
var time = .5;
var mc = ourMovieClip;

ballTween = new mx.transitions.Tween(mc, "_alpha", easeType, begin, end, time, true);

counter++;


}

This Snippet of code is a function that will load the image or the Movie Clip in the Stage and will increase the value of the counter

the Transition that was used here is a type of transition that wasn't documented in the flash class documentation , there is a lot different method for doing this kind of transition , so you can have a different type of transition.

Download the FLA Image SlideShow

Posted in Libellés : , 0 commentaires Publié par y. elhafyani à l'adresse 10:12 AM  

Adobe kuler with Flash CS

(Friday, October 26, 2007)

Ben Pritchard pixelfumes.com Recently create a   kuler web-hosted application that displays the latest and highest adobe kuler schema.


the application uses adobe Kuler API for displaying the results, and he wanted to share this experience with you for editing a tutorial about this application The Tutorial is intended for Flash developers who have an intermediate understanding of ActionScript, ActionScript classes, and JSFL.


for viewing the tutorial click here


Posted in Libellés : 0 commentaires Publié par y. elhafyani à l'adresse 4:20 AM  

There is a several ways to build a flash preloader for a flash movie but I guess the easiest one that wouldn't really much actionscript lines, is the one that use ProgressBar and Loader components that exist in the components library.

Of course i am not going to talk onlu about this kind of preloader , but i will try to show you the most used components that could be used in a flash movie.

1 - Component preLoader

first step we create a new flash document (Ctrl+N) and go to the Components section (Ctrl+F7) or windows > Components, we drag the loader component to the stage and resize it till i fits the size of your movie or image that you want to download, keep selecting the component in the stage and give it an instance name ex:"ploader" in the properties or parameter section.

second step , we go back to the components section and we drag the Progressbar component and we give it too and instance name ex:"proBar"







3rd step : select the Frame 1 and we go to the action panel and we add this script:




ploader.contentPath = "your_file";
proBar.source = ploader;



in th first line change the value of "your file" to the location of JPG or SWF.

Additional command that can be used in need.
ploader.autoLoad = false;
if we set autoloader property to false it means our loader won't start loading till we invoke the method
ploader.load();




2 - prLoader using actionscript







Our second flash preloader would be based on actionscript , We create a New Flash document Ctrl + N , and we create a MovieClip .

Within the MovieClip , We create the animation that we want our preloader to show while loading , Create the animation from frame 1 to frame 100, you can do any kind of animation between the frame 1 and 100 , well , in my case i used a progressbar , but in your case you could use any kind of flash preloaders(Note : Progressbar became so classic in its use and better to use an animation ) .
We add a dynamic text and we give it a var name in the var section , name it "text".







We go back to the root Movie and We Select the MovieClip we created , open the action panel and we add this script



onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
this.gotoAndStop(percent);

if (loaded == total) {
gotoAndPlay(2)
}
}




select the first frame and go to the action section , add this script


stop();
go and build the rest of your movie , starting from frame 2 or whatever you like , unless you change the start in the actionscript in the action panel ,

and it's done .

here is some various companies that builds some nice preloaders:

* www.gothikamovie.com
* www.onceuponatimeinmexico.com
* www.wimbledonmovie.com/
* www.sony.com/walkman


Posted in Libellés : 0 commentaires Publié par y. elhafyani à l'adresse 4:17 PM  

In our tutorial here we are going to build a flash image gallery using the photos stored in the flash library , our result would be something similar to this like this




1- firstly we create the rectangle and the color name and we convert it to a MovieClip and we repeat the same task till we finish all the color and have similar result in figure one.



2- import all the images to the library by choosing file menu , and place or use the shortcut ctrl+R , and import all the images of the cars with different colors.




4-at the step we would give the images in the library a unique identifier and export them to AS , for that they would be accessible from actionscript, right click on the images in the library and we check the checkbox of export for actionscript ,and we give a unique identifier for each image in the library.



5- we create an empty movie clip and we call it " displayer" , this is movie clip is where our cars would be shown , whenever we rollover colors.

6-now we click on the color movie clip and we go to the action section , we add the event onRollover

on(release){
import flash.display.BitmapData;
var linkageId:String = "car1";
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
this._parent.displayer.attachBitmap(myBitmapData, this.getNextHighestDepth());

}
in the linkageid we give the unique identifier of the car that is in the library that would be shown, after we create a bitmapData and we load it to our movie clip displayer.
here is the sample movie












Posted in Libellés : , 1 commentaires Publié par y. elhafyani à l'adresse 4:23 AM  

 
Copyright 2005-2008 Flash RIA .