|
|
| mybluehair 2006-04-18, 6:38 pm |
| ok, so im making a site, and on 1 page theres a bit to much text to fit in the
flash box (or whatever you want to call it) so I wanted to know how to be able
to make it scroll down. like...look on the right side of this page here, you
can scroll down using that. well how can I make make a scroll bar in my flash
movie?
thanks.
| |
| WebXperience 2006-04-19, 6:30 am |
| Here's a sample of something I learned from Fkash MX 2004: Beyond the Basics.
Using a dynamic textfield into which a text file is loaded dynamically,you
could place to button symbols on the stage on the side of your text field. one
to scroll up and one to scroll down. Then using centralized actionsript
programing you can have the text field scroll depending upon which button gets
pressed.
//======================== Beginning of scroll code ==============\\
var scrollDirection:String;
_level0.myLV.load("vars/ourHistory.txt");
//---------------- Scroll Buttons ---------------\\
this.scrollDown.onPress = function () {
scrollDirection = "down";
scrollText();
}
this.scrollDown.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function () {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
function scrollText () {
_root.onEnterFrame = function () {
if (scrollDirection == "down") {
loadedInfo.scroll += 1;
} else if (scrollDirection == "up") {
loadedInfo.scroll -= 1;
}
}
}
//---------------- /Scroll Buttons ---------------\\
| |
| mybluehair 2006-04-19, 6:31 pm |
| Originally posted by: WebXperience
Here's a sample of something I learned from Fkash MX 2004: Beyond the Basics.
Using a dynamic textfield into which a text file is loaded dynamically,you
could place to button symbols on the stage on the side of your text field. one
to scroll up and one to scroll down. Then using centralized actionsript
programing you can have the text field scroll depending upon which button gets
pressed.
//======================== Beginning of scroll code ==============\\
var scrollDirection:String;
_level0.myLV.load("vars/ourHistory.txt");
//---------------- Scroll Buttons ---------------\\
this.scrollDown.onPress = function () {
scrollDirection = "down";
scrollText();
}
this.scrollDown.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function () {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
function scrollText () {
_root.onEnterFrame = function () {
if (scrollDirection == "down") {
loadedInfo.scroll += 1;
} else if (scrollDirection == "up") {
loadedInfo.scroll -= 1;
}
}
}
//---------------- /Scroll Buttons ---------------\\
ok, can you give me a more detailed tutorial? im kinda new at this.
| |
| mybluehair 2006-04-21, 6:41 pm |
| can you give me a hole tutorial or something?
| |
| WebXperience 2006-04-26, 10:34 pm |
| //======================== Beginning of scroll code ==============\\
var scrollDirection:String;
_level0.myLV.load("vars/ourHistory.txt"); // _level0 is a global variable in
flash that addresse the main level or main movie in
your flash document
myLV is a variable I created whch holds the definition of a LoadVatiable Object
which is where the text document from your disc is loaded into memory.
//---------------- Scroll Buttons ---------------\\
this.scrollDown.onPress = function () { // scrollDown and onPress
are built in functions of the Movie Class
scrollDirection = "down"; // the next
21 or so lines of code handle mouse events that take place e.g. when a mouse
scrollText(); //
button is pressed or released.
}
this.scrollDown.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function () {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function () {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function () {
delete _root.onEnterFrame;
}
function scrollText () { // This function is
called as each frame of the movie on the root level (_root or _levelo)
_root.onEnterFrame = function () { // is played.
if (scrollDirection == "down") {
loadedInfo.scroll += 1;
} else if (scrollDirection == "up") {
loadedInfo.scroll -= 1;
}
}
}
//---------------- /Scroll Buttons ---------------\\
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |