|
||||||
|
||||||
Flash Tutorial - Scrolling Dynamically Loaded Text

Free
Flash Tutorial
Step Seven: LoadVars() - ActionScript

ActionScript Explained:
var scrollBarMax:Number = _root.scrollDown._y - _root.scrollTrackbar._y - _root.scrollTrackbar._height
This line determines how far the scroll Bar can move down before touching the scroll down button.
myLV.onLoad = function(success) {
This line defines a function to be called when the handler onLoad is called. Whenever any called text file is completely downloaded from the server and ready to be imported into the movie, this line will call the following function, passing the Boolean variable "success" to indicate whether the text file was found and of the correct type.
loadedInfo.htmlText = myLV.info;
This sets the text in the loadedInfo text box to the text in the text file with the variable name "info". The property htmlText specifies that the text to be imported should be formatted for any html tags.
_root.loadedInfo.scroll = 1;
_root.scrollTrackbar.scrollBar._y = 0;
_root.loadedInfo.mouseWheelEnabled = false
This line will reset the scroll property of the text box and also reset the position of the scroll Bar. The scroll property will be explained in detail later.
scrollCheck();
This line runs the function scrollCheck() which will be later defined. The scrollCheck() function will test to see if the text file is long enough to need scrolling.
loadedInfo.text = "There has been an error loading the requested information. Please contact the Webmaster and report your error."
If the success value from the onLoad handler is returned false, then the text file was either corrupted or was not found. It is always a good idea to put a message just in case an error like this occurs.
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
49528 visitors to this page since
Sept 05 •
|
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|