Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


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

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


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

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


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

Search Tutorials


Tutorials Tutorials » Interactivity/Other

Categories More Scrolling Function in Flash 5
Author: Dan Ludwig | Website: http://www.danludwig.com |

 
Page 15
«prev ... 3 4 5 6 7 8 9 10 11 12 13 14 15 16 next»

The script runs again when you release and press the scroll button again. This time the "if" argument can't be evaluated to a null, since we have a definite value (5000) stored in the up_last_click variable. Lets assume you pressed the button exactly one quarter (1/4) second after the first press, and lets step through this script again:

up_first_click = getTimer( );

Now the up_first_click variable is updated to a new value by the "getTImer" action. Since one quarter second translates to 250 ms, up_first_click's new value will be 5250 (5000 + 250 = 5250). With that done, we move to the "if" condition, and fill in our numeric values for the up_first_click and up_last_click variables. 5250 - 5000 = 250 ms. Using this inequality expression, Mick has set the double-click threshold to 350 ms. As long as the pause between button presses is equal to or less than 350 ms, as it is in our example, the "if" argument returns "true" and its embedded action is executed. If the pause between cicks is longer than 350 ms, the continuous feedback buttons are triggered instead.

The embedded action, "scroll_shape._y = scroll_shape.logic.top;" immediately sets the _y position of scroll_shape to its uppermost limit, top. This is what creates the jump effect. Since our example "if" argument returns "true," the continuous feedback action embedded within the "else" clause is skipped. (A "true" value for the "if" statement voids the "else" clause below it.) Either way though, the action loop in logic is always triggered on (press) because the "gotoAndPlay("scroll_logic")" action isn't embedded within either the "if" or the "else." Conversely, logic is always stopped on (release).

The script for the bottom button is again structured very similarly to the top, however the double click variables are named down_first_click and down_last_click. Also the jump action embedded within the "if" statement sets scroll_shape._y to bottom, not top. The code in the source FLA is extensively commented, but feel free to remove the comments ("//blah blah blah") if it makes the code easier to understand for you :^)

«prev ... 3 4 5 6 7 8 9 10 11 12 13 14 15 16 next»

» Level Intermediate

Added: : 2000-12-08
Rating: 7.53 Votes: 94
Hits: 3568
» Author
Me Like Flash 5. Flash 4 good. Flash 5 better.
» Download
Download the files used in this tutorial.
Download (229 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