A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11337 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5828 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.


Random Links | Add your own Flash Related Links
Flash Tutorials 1280 Tutorials 7 New Tutorials Added!
What's New | Top100

» Make a Flash Slide Show Screen Saver
» Simple flash making tutorial for thanksgiving
» Create flash banner for website
» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Special_Effects

Categories Sliding Title Scripted
Author: Bali Khan

 
Page 1
1

Hi everyone.
This is my first tutorial to flash kit and the reason it is here is because of a person who asked me to do it. The tutorial is for the file that I published to Flash kit <"Sliding Title (Scripted)">. Since I didn’t add comments to the file ... I guess some did not understand the code completely. I hope this tutorial will help them a lot. OK... lots of talking lets get to work.

Create a new Flash document and follow the steps below.

- Create some static text.
- Break it apart (ctrl+b) 2 times so that you convert it into free form artwork.
- With your mouse pointer, break the text into 5 parts... horizontal parts and convert each of the part into a separate movie clip.
- Create a dynamic text field and name it in the variable field (i.e. num)
- Create a button that will trigger the movement when the user clicks it after he has typed in the value of the clips' _x property.

Now Here is all the info of the movie

num_x // the variable that holds the _x value of the movie clip.
num // the variable assigned to the text field (this value will later be transferred to the num_x variable which will later change the position.
mover // the name of the function that makes the thing happen.

**************************************
Create a new layer and assign these actions to the first frame.
num_x = 100;
function mover(name,no) {
 this_x = getProperty(name,_x);
 new_x = _root.num_x;
 movement = new_x-this_x;
 setProperty(name, _x, this_x+(movement/no));
}
*************************************************
Now let me explain this script to you.

-The first equation assigns the default value of 100 to the movie clip
-The second line invokes a function named “mover” that has the parameters name and no (variables that will be used in the function to substitute values.
-This is the place where the confusing part starts. Let me explain in detail.

************************************************
First of all we crank out the current value of the clip’s _x property.

The we get the value of the _x property that the user supplies.

Then we create a new variable that is equal to the difference between the two values or simply the distance between the two points.

In the last statement we set the _x properties of the movie clips in a special way. We add the difference in the points (divided by some number) to the current _x position of the movie clip. This allows us to create an easing effect.

Here’s how it goes.

Imagine the user entered a value of 90 (current position of clip is 0). Now according to function, the difference is equal to 90. Now in the next step, we add this value (divided by a number e.g. 3) to the current x position of the clip (0+30=30). This moves the clip 30 pixels. When the function is executed again, it reads the current value of the clip as 30 and calculates the difference to 60 and when divided by 3, returns 20 and the movie clip is moved another 20 pixels. When it is executed again, it reads the clips current x position to (30+20=50) and calculates the difference to 40 and when divided by 3, gives a value of 13.3 and the movie clip again moves. When the process happens again and again, the value gets smaller and smaller and the clip moves slower and slower until the value get 0 or number that cannot be completely divided.

This creates an amazing easing effect.

**************************************************
I guess that should do it.

Now assign these actions to the button. This script simply transfers the value supplied by the user to the variable used in the function.

Now on each of the movie clips, call the function within the event handler of the movie clip:
onClipEvent (enterFrame) {
 _root.mover(this,5);
}
The EnterFrame event handler makes sure the code is executed repeatedly. When the function is called, The parameters are passes for name & no(number). The name identifies the object and the no identifies the number by which the difference in the function would be divided (NOTE: the greater the number, the slower the clip moves). To achieve the desired affect pass smaller numbers to the movie clips in the middle and larger numbers to the ones on the outside. This makes the middle ones go faster than the ones on the outside.

Now I guess I’ve done my job. Test your movie, and if it works, congratulate yourself. You did it partner!

©2004 Bali Khan Arts.

1

» Level Intermediate

Added: : 2004-02-02
Rating: 4.64 Votes: 34
Hits: 1986
» Author
Bali Khan 14 yrs Flash Rookie
» Download
Download the files used in this tutorial.
Download (10 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs