Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Help With Simple Scroll



Ok guys let me show you what I have:
I have a movie loaded on level 10.
Inside this movie, at the last frame, there is a MC called scroller.
Inside Scroller there is a text scrolling up, two buttons (up and down scroll) and a MC called sub.
Inside sub there is 3 frames like this...
1. stop

2. tellTarget ("/scroll") {
prevFrame();
}

3. tellTarget ("/scroll") {
prevFrame();
}
gotoAndPlay(2);


On the down scroll button it's like this:
on (press) {
play();
}
on (release) {
stop();
}

And on the up scroll button is like this:
on (press) {
tellTarget ("sub") {
gotoAndPlay(2);
}
}
on (release) {
tellTarget ("sub") {
stop();
}
}

And I keep getting this error msg when I press the upscroll button:

Target not found: Target="/caralho" Base="_level0.instance1.sub"

Can you guys help me with this one?! Where did I screw it?



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-28-2002, 10:17 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Simple SCROLL Help Please
i've been looking for a simple scroll tutorial, hard to find.

i want to have a movie symbol with content in it, and an up and down arrow, two seperate buttons to make the movie clip scroll up and down.

surely theres a simple bit of actionscript to do this.

anyone.....


Ta.

Simple Scroll
this sounds stupid but I just need a simple smooth scroll for my site. Can someone please help me through it? I know there are thousands on flashkit but I want to customize my own.

please help!!!
thanks
Jake

Simple Scroll
Hi all,

I've got some xml data loaded into this custom scroller script (below) which all workg great. But ass soon as I move the mask anything above 200 pixels high the scroller disappears.

Which is a problem as I need it to be 350 pixels high. I've attached the file as well.

Hope someone can help me out here!

Thanks.


Code:
_global.scrolling = function ()
{
trace("scroll")
var moveSpeed:Number = 1;
var scrollHeight:Number = scrollbg._height;
// how much of the movie can be scrolled
var scrollable:Number = contentMain._height-maskedView._height;
var initContentPos:Number = contentMain._y;
// the drag positions that are possible for the dragger
var left:Number = scrollbg._x;
var top:Number = scrollbg._y;
var right:Number = scrollbg._x;
var bottom:Number = scrollbg._height-dragger._height+scrollbg._y;
// before we do anything make sure the content is even scrollable, if it isn't hide everything and return
if (scrollable < 0)
{
dragger._visible = false;
btnUp.enabled = false;
btnUp._alpha = 50;
btnDown._alpha = 50;
scrollbg._alpha = 50;
btnDown.enabled = false;
return;
}
// Updates the contents position
function updateContentPos()
{
var percent_scrolled:Number = (dragger._y-btnUp._height)/(scrollHeight-dragger._height);
contentMain._y = Math.round(initContentPos-(percent_scrolled*scrollable));
}
dragger.onPress = function()
{
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function()
{
updateContentPos();
};
};
dragger.onMouseUp = function()
{
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function()
{
this.onEnterFrame = function()
{
dragger._y = Math.max(top, dragger._y-moveSpeed);
updateContentPos();
};
};
btnUp.onDragOut = function()
{
delete this.onEnterFrame;
};
btnUp.onRelease = function()
{
delete this.onEnterFrame;
};
btnDown.onPress = function()
{
this.onEnterFrame = function()
{
dragger._y = Math.min(bottom, dragger._y+moveSpeed);
updateContentPos();
};
};
btnDown.onRelease = function()
{
delete this.onEnterFrame;
};
btnDown.onDragOut = function()
{
delete this.onEnterFrame;
};
// makes the first update to scroll in case the user offset the dragger
updateContentPos();
};

Most Simple Scroll Bar
hi i was wondering whats the easiest scroll bar to make with static text, and you can add buttons. i just wnat an up arrow adn down arrow... no scroller if anyone knows the simplest to understnad please help me

Simple Scroll Bar
Hi,

I've amended Kirupas simple scrolling box to allow me to load in XML data, including images.

That all works, Waht I can't do is make the mask more than 200 pixels high. It needs to be more like 350 pixels high but as soon as I enlarge it the scroll bar dissapears.

Help, it driving me crazy! I've attached a working example.

Simple Scroll Bar Example
Hi,

I tried the simple scroll bar example/tutorial on this site and found it very easy to implement on its own and when encapsulated in another movieclip (for use in other projects). However, once I tried to add it to my existing fla, the scrollface jumps around the screen when clicked. Also, when I trace the variables, they come up as "undefined".

Do you know why this might be? I feel it should work in principle but have no explanation and need some scrolling ability for my site? The Flash 8 scrollpane component is too buggy and doesn't work for me either.

Thanks.

Simple Scroll
I am new at flash and I was wondering how to make a simple scroll bar to scroll text. If someone had a fla example that would also help!

Thanks
Jordan

Looking For A Simple Vertical Scroll Bar
I downloaded a "simple" scroll bar from the download fla section. There is very minimal code, yet when I try to incorpoate it into my movie the text will not scroll. I have to put this scrolling bar on a different Scene, not on the parent Scene and I think the code is confused, it is possibly still looking for the text on the parent Scene.

If anyone is interested in looking at the code let me know, I can email the file to you. Like I said, the code is minimal, yet I can't find where anything needs to be changed.

If anyone knows of a simple vertical scroll bar out there that will work in a Scene (I have to set up 16 different Scenes) please let me know.

Thanks!!

Simple Scroll Question
i've been looking for a simple scroll tutorial, hard to find.

i want to have a movie symbol with content in it, and an up and down arrow, two seperate buttons to make the movie clip scroll up and down.

surely theres a simple bit of actionscript to do this.

anyone.....


Ta.

Simple Tutorial For Scroll Bar
hello,
i am looking for simple tutorial for a scroll bar , that works like a frame. I'm thinking it will have a movie clip and a mask, and a button to make it scroll up and a button to make it scroll down. Can anyone help

Help ASAP (simple Scroll)
Hi buddies.
I know that this is a simple matter but I can't accomplish it...

Here's the FLA and you can see in there a simple dynamic text and two buttons with code for scroll the Dynamic text. I don't know what's going on, but it doesn't work...

I want to scroll!!!!!

...

Simple Scroll Question
Hi, can somone please help me with this...

I have a dynamic textfield that i wish to scroll, it is called "content" and lives inside an mc. that mc has this simple script on it:


onClipEvent (enterFrame) {
if (down == true) {
content.scroll += 1;
}
}
onClipEvent (enterFrame) {
if (up == true) {
content.scroll -= 1;
}
}


This works fine, the only problem is that it scrolls mutch to fast!!!
I really need to run my flash file at 60 fps.

is there any way to slow it down? i've tried the obvious, like putting "content.scroll += 0.2;" etc... but it stops working!

tnx

Scroll Script (simple)
Hey guys, (Flash MX 2004)

I have a menu that scrolls depending on, if your mouse pointer is on the left or right of the screen.
simple code: _root.onEnterFrame = function() {
movieClip._x=movieClip._x+(0.5*Stage.width-_xmouse)/10
This works great,
Problem: It scrolls off the screen. How do I keep it from scrolling of the screen? Is there an "if" statement that will script boundaries or something.

I am not a programmer so I am kinda stuck. Please Help!!!!!

-AJ

Simple Scroll Action
Okay so I want to make a simple mouse over scroller with just too buttons, no scroll bar.

So the basic button would have actionscript like this:

on(rollover) {
elementName.scroll += 1;
}

But I also want it to continue to scroll if the user leaves there mouse on the button like an onMouse over or while mouse over. However I can't get this to work with just actionscript. I was thinking something like this:

on(rollover) {
while(this.MouseOver) { //psuedo code this.MouseOver doesn't work
elementName.scroll +=1;
}
}


is it possible to do this with action script or will this type of functionality require using frames?

Simple Vertical Scroll Bar
Hello friends.

i need you to show me how can i make a simple vertical scroll bar for my site. i have one movieclip masked up and the scroller. i wrote an startDrag() function for that last one, but im having problems trying to figure out how to make the container move...

here is an example of what i got:



thanks a lot for the help.

AS2 Translated Simple Scroll Bar
I've translated a tutorial for a simple scroll bar from AS2 to AS3 but it doesn't seem to scroll smoothly always, and it still drags if you release the mouse outside of the scrollbar.


Code:
import flash.display.Sprite;
import flash.events.Event;

var scrollUpper:Number = 13.7;
var scrollLower:Number = 187.0;

var textLower:Number = 0.0
var textUpper:Number = -107.0
var scrollRange:Number = scrollLower - scrollUpper;
var textRange:Number = textLower - textUpper;

function startscroll(event:MouseEvent):void {
var moved:Number = scroller_mc.y - scrollUpper;
var pctMoved:Number = moved/scrollRange;
var textMove:Number = pctMoved*textRange;
text_mc.y = textLower - textMove;
}

function onstopdrag(event:MouseEvent):void{
event.target.stopDrag();

}
// new Rectangle(x, y, width, height) )
function scrollermove(event:MouseEvent):void{
event.target.startDrag(false,new Rectangle(202,13,0,175));
//event.target.MOUSE_MOVE = startscroll; //this works too
event.target.addEventListener(MouseEvent.MOUSE_MOVE,startscroll);
event.target.addEventListener(MouseEvent.MOUSE_UP, onstopdrag);
}

//scroller_mc.addEventListener(MouseEvent.MOUSE_MOVE,startscroll);
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN,scrollermove);
//scroller_mc.addEventListener(MouseEvent.MOUSE_UP, onstopdrag);
I've toyed with it a bit but I'm not getting any great results.
Any ideas on how to make this better?

Simple Scroll Bars
Hi all,

I'm trying to build a custom scrollbar class which will automatically add scrollbars if the content it holds gets too big. I can handle most of it but i'm stuck trying to get the out-of-bounds content to hide.

The content is contained within a Sprite variable which is a child of the ScrollBar class. Whenever I add content (i.e using graphics.drawRect() ) that is bigger than the ScrollBar class (which extends Sprite), the program just resizes the base sprite to fit the content, which makes a mess of everything.

Any advice?

Cheers.

Simple Scroll Bar Question
So I found a scroll bar I like that's rather simple, yet I can't figure out how to adapt it to my site. I'm sure it's that I just don't understand how they setup the dimensions, if someone could tell me that would be great. I'll post a stripped down copy of the file with everything you should need as well.

text box has a variable set to text and is 189.0 x 169.5

The Up Button is not labeled and has the following code...

Code:
on (release) {
text.scroll--;
if (myscroll3._y>myscroll3.top) {
myscroll3._y = myscroll3._y-((200-myscroll3._height)/5);
}
}
The Down Button is not labeled and has the following code...

Code:

on (release) {
text.scroll++;
if (myscroll3._y<(170-myscroll3._height+myscroll3.top)) {
myscroll3._y = myscroll3._y+((200-myscroll3._height)/5);
}
}
The Scroll Button Is Located within a Movie Clip. The Button is not labeled and has the following code...
Code:
on (press) {
startDrag("", false, left, top, right, bottom);
dragging = true;
}
on (release, releaseOutside) {
stopDrag();
dragging = false;
}
The Movie clip is labeled "myscroll3" and has the following code...

Code:
onClipEvent (load) {
_height = 26;
top = _y;
left = _x;
right = _x;
bottom = _y+(275-_height);
}
onClipEvent (enterFrame) {
if (dragging == true) {
_root.text.scroll = 1+int((_y-top)*50/(300-_height));
}
}
You can see a published version at:

http://personal.jjarts.net/textbox/textexample.swf

Simple Scroll Script Help?
I am not a programmer but can "Play" with code.
Can anyone help manipulate this code for a side scrolling background?

Basically I want the background to scroll from the top down instead from right to left.
This is the code as is that works. ( Right to Left)

onClipEvent (load) {

ground.duplicateMovieClip("ground2", 100);
ground2._x = ground._x+ground._width;
groundStartx = this._x;
groundSpeed=10;

}

onClipEvent (enterFrame) {

this._x-=groundSpeed;
if (this._x<= (groundStartx-ground._width)){
this._x=groundStartx-groundSpeed;
}


}

I have tried several things and can't quite get it to work properly.
Such as it will not duplicate the movie clip or will work from bottom to top .
The code is placed in the actionscript of a background image which is in its own layer and has the name backGround and instance as backGround.

Thanks for any info

Simple Help For Scroll Menu
I am building a flash page that has buttons and a thumbnail. There are more of these buttons than will fit going down the left side of the screen. I want to create a scrollable menu so when dragged it will reveal the other buttons on the screen. I understand I will need to use a mask and I'm OK with that part. What I can't figure out is how to have the scrollalbe handle control the MC with the buttons. I'm sure I have to use AS and assign some Y values but I'm lost in being able to go any further. If you want to see what it is so far go to http://www.mikeyhaynes.com/gj/VRL_Interface_04.html

Thanks for any help anyone can offer.

Scroll Buttons(simple I Know...)--help Please
Can someone point me in the direction of a tutorial to scroll a text field down and up with the press of the 'down' and 'up' button? I realize this is very simple, so if you could be so kind to take 20 seconds and let me know, thanks! Take care.

Victor.

Simple Scroll Problem
Hi there Kirupians!

I've got a simple problem and I can't remember how to fix this.
I have a textField with text greater than the field.
Below this textField I have two buttons. scroll_down_btn and scroll_up_btn.
These buttons scroll the text once they're pressed.

ActionScript Code:
on(press){textField.scroll =+1}


But how do I have to change my code so that as long as the user holds the mouse down over the button, the text keeps on scrolling?
In the current situation the user has to click the button for each line he/she wants to scroll.

Can anybody help me?

Super Simple Scroll Bar
Hi, i got some contet id like to scroll. Not text so id have to use the scrollpane, but i think the scroller looks, well, not so nice

Anyone know how i make a diffrent one, or how to modefy it so some simple sqaures???
It was simple in MX but now i dont get it.

Simple Scroll Bar Tutorial
I followed this tutorial http://www.kirupa.com/developer/flash8/scrollbar.htm

My question is how would i change the initial postion of the content and the scroll bar to start in the middle?

heres a diagram

------------------------^


blah balh blah
blah blah blah
Middle of the content-- [ ]
blah blah blah
blha blha blha
blah blah blah


-----------------------^

Question For The Simple Scroll Bar Example
Hi Kirupa,

I had completed the tutorial for the simple scroll bar in your site. Since I am applying the scroll bar into my photo album's thumbnails, and when I converted all the thumbnails into the "contentMain" mc, and ran the movie, I was able to get the scroll bar to work propertly, however, the bottons in the "contentMain" lost their functions. Is there anyway that I can resolve this problem?!~

thanks.

Simple Scroll Bar Question
hello again,

Ok im trying to use this scrollbar i got from kirupa.com...its the custom one....

now everything works on it except wen i click the up button....wen i click the up button it jus goes str8 back to the top instead of scrolling....i downloaded the whole Scrollbar and wen i compared to code to the Custom Scrollbar Tutorial, there were different at the btnUp.onPress = function() { part....

here is the code on the scrollbar i downloaded

scrolling = function () {
var scrollHeight:Number = scrollbg._height;
var contentHeight:Number = contentMain._height;
var draggerHeight:Number = dragger._height;
var maskHeight:Number = maskedView._height;
//
var initPosition:Number = dragger._y=scrollbg._y; var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
//
var left:Number = scrollbg._x;
var top:Number = scrollbg._y;
var right:Number = scrollbg._x;
var bottom:Number = scrollbg._height-draggerHeight+scrollbg._y;
//
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-draggerHeight);
//
dragger.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
};
};
dragger.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y + speed < maskedView._y) {
trace(dragger._y + " " + top);
if (dragger._y <= top) {
dragger._y = top;
contentMain._y += speed;
} else {
contentMain._y += speed;
dragger._y -= speed / moveVal;
}
} else {
dragger._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onMouseOut = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y - speed >finalContentPos) {
if (dragger._y>=bottom) {
contentMain._y -= speed;
dragger._y = bottom;
} else {
contentMain._y -= speed;
dragger._y += speed/moveVal;
}
} else {
dragger._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};
};
scrolling();


Now...here is the code on the tutorial


scrolling = function () {var scrollHeight:Number = scrollTrack._height;var contentHeight:Number = contentMain._height;var scrollFaceHeight:Number = scrollFace._height;var maskHeight:Number = maskedView._height;var initPosition:Number = scrollFace._y=scrollTrack._y;var initContentPos:Number = contentMain._y;var finalContentPos:Number = maskHeight-contentHeight+initContentPos;var left:Number = scrollTrack._x;var top:Number = scrollTrack._y;var right:Number = scrollTrack._x;var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;var dy:Number = 0;var speed:Number = 10;var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight); scrollFace.onPress = function() {var currPos:Number = this._y;startDrag(this, false, left, top, right, bottom);this.onMouseMove = function() {dy = Math.abs(initPosition-this._y);contentMain._y = Math.round(dy*-1*moveVal+initContentPos);};};scrollFace.onMouseUp = function() {stopDrag();delete this.onMouseMove;};btnUp.onPress = function() {this.onEnterFrame = function() {if (contentMain._y+speed<maskedView._y) {if (scrollFace._y<=top) {scrollFace._y = top;} else {scrollFace._y -= speed/moveVal;}contentMain._y += speed;} else {scrollFace._y = top;contentMain._y = maskedView._y;delete this.onEnterFrame;}};};btnUp.onDragOut = function() {delete this.onEnterFrame;};btnUp.onRollOut = function() {delete this.onEnterFrame;};btnDown.onPress = function() {this.onEnterFrame = function() {if (contentMain._y-speed>finalContentPos) {if (scrollFace._y>=bottom) {scrollFace._y = bottom;} else {scrollFace._y += speed/moveVal;}contentMain._y -= speed;} else {scrollFace._y = bottom;contentMain._y = finalContentPos;delete this.onEnterFrame;}};};btnDown.onRelease = function() {delete this.onEnterFrame;};btnDown.onDragOut = function() {delete this.onEnterFrame;}; if (contentHeight<maskHeight) {scrollFace._visible = false;btnUp.enabled = false;btnDown.enabled = false;} else {scrollFace._visible = true;btnUp.enabled = true;btnDown.enabled = true;}};scrolling();

i would like to go with the first code i pasted....but ive tried both and the first one wen i click up goes all the way up without stopping....the second one jus doesnt let me scroll up at all lol....so if someone can help me with the first code that i pasted....

Basic Problem = When i click the scollup button, it goes all the way to the top without stopping...



Thank you,


Amy

Simple Custom Scroll Bar
hi folks from a swedish flashwannabe.
i read your article on simple custom scrollbar. i liked the simplicity of the look of the scrollbar, and i want one just like that.

my problem is how can i make it work if i have a .swf that has a dynamic textbox, and where i have linked the text/content from an external textfile, written in notepad.

i send you my .fla and .txt to studie

/micke p

Scroll Buttons(simple I Know...)--help Please
Can someone point me in the direction of a tutorial to scroll a text field down and up with the press of the 'down' and 'up' button? I realize this is very simple, so if you could be so kind to take 20 seconds and let me know, thanks! Take care.

Victor.

Simple Scroll Problem
Hi there Kirupians!

I've got a simple problem and I can't remember how to fix this.
I have a textField with text greater than the field.
Below this textField I have two buttons. scroll_down_btn and scroll_up_btn.
These buttons scroll the text once they're pressed.

ActionScript Code:
on(press){textField.scroll =+1}


But how do I have to change my code so that as long as the user holds the mouse down over the button, the text keeps on scrolling?
In the current situation the user has to click the button for each line he/she wants to scroll.

Can anybody help me?

Simple Scroll Effect?
Hi, I recently found this site i'm supprised i didn't stumble upon it eariler, alot of useful flash techniques. I'm still a flash newbie but learning fast and did have one question. Its been bothering me for a long time. I was wondering if anyone knew how to make a image scroll diagonally. I've seen those effects where they would use clouds and have them scroll horizontally so it looked like the clouds were moving but when I applied that technique diagonally it failed. If your still confused as to what i'm saying Lets take a basic tile image for example and now have it scroll from the top left to the bottom right continously at a smooth frame rate no skips. I've had that problem also where its set so the image jumps so much it looks ugly. Anyone have an idea?

Simple Scroll Text Question
I need this dynamic text field to include a scroll bar. Can someone please post the text or lead me to an answer. Not too familiar with script but trying like hell to make sence of it.

Attached is the .fla file

Simple Scroll Bar For Text Box With Mx2004?
All I want to do is add a simple scroll bar to a text box. Why is this so dificult? Do I have to use those component things?

Thankyou

Simple Scroll Problems With OnMouseDown
ok i used one of the tutorial on here regarding a simple scroll, using two buttons and a box of dynamic text. the code for the buttons is:

on (release) {
scrolltext.scroll += 1;
}

and


on (release) {
scrolltext.scroll -= 1;
}


what i really want to do is be able to use onMouseDown or anything that will let it scroll by holding the button down instead of have to click it repeatadly, any help would be amazing.

Very Simple Scroll Bar That Won't Stop Scrolling
hey,

I have made a very simple scroll bar (attached). And it works fine. I stops scrolling where i want it to stop. But, when i export my "info.swf" file, the file that has the scroll bar, and load it into another movie, then my scroll bar scrolls continously. I don't know what i am doing wrong.


Baljinder

Simple Problem With Scroll Pane.
ok well for some reason, when i export through flash the content in the scroll panes works fine, then when i insert it into an html document for some reason it doesnt work? any ideas why?

Simple Scroll Text - I Am Going Insane
I am using the newest version of Flash.

I have been trying to create a scrolling text
field using two buttons - up and down. Very simple-
yet I cannot get it to work. I spent the last two days
reading all the "newbie" postings on this subject
and looking at the MX 2004 tutorials. This
is what I have done:

Created a dynamic text field
Set the field to "scrollable" and "multiline"
Entered Text
Dynamic text field instance name: scrolltext

Up Button:

on (press) {
scrolltext.scroll += 1;
}

Down Button:

on (press) {
scrolltext.scroll -= 1;
}


I doesn't work! I am going insane over here. I am
sure there is just a simple step I am missing.
I am uploading my .fla. Please Help.

Thank You!

Simple Scroll Bar Component Issue
hi,
want to dynamically load scrollbox.
Trying to use:


_root.ppp.flagscroll.contentPath = "Symbol 1";


this is called from a button on root level...

scrollbox is sitting in MC (MC link called ppp) and is an instance called flagscroll.
Dont have anything in the contentPath box as want to fill it dynamically as above...
Symbol 1 is just graphics.

help?
thx
shaf

[CS3] AS2 - Changing A Scroll Bar To Simple Arrows?
I have some xml content being loaded into a movie clip. Currently, I've got it working with a scroll bar. I'd like to change the scroll bar to simple up & down arrows. It seems like this should be pretty straight forward but I think there must be some trick to it with the code or I'm having a very bad week with flash! I thought i could just modifiy the dragger code but no such luck. Here's my code with the scrollbar.

Actionscript

Code:
/////////////////////////////////////////////////////////////////////
Stage.scaleMode = "noscale";

/////////////////
// Loading XML //
/////////////////
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("portfolio.xml");
myXML.onLoad = function(_status) {
if (_status) {
tempxml = myXML.firstChild.childNodes;
var path1 = myXML.firstChild.attributes.path1;
var path2 = myXML.firstChild.attributes.path2;

var space = 25; // Space between items you can increase this to whatever
for (var i = 0; i<tempxml.length; i++) {

var item = list_mc.attachMovie("clip", "clip"+i, i); // In the library, rightclick on item and choose linkage. You'll see that our items are represented in the code the "clip" name

item._y = (item._height+space)*i; // This places our items on y axis
item.title_txt.text = tempxml[i].attributes.title; // For i<total, attaches a title i to our item
//item.date_txt.text = tempxml[i].attributes.date; // For i<total, attaches a title i to our item
item.descr_txt.text = tempxml[i].attributes.description; // This attaches a description i to our item
//item.url_txt.text = tempxml[i].attributes.url; // And this one a url i to our item

//item.thumbHolder.loadMovie(tempxml[i].firstChild); // Attaches thumbnails to each item
item.thumbHolder.loadMovie(path1 + tempxml[i].firstChild); // Attaches bw thumbnails to each item
item.thumbHolderC.loadMovie(path2 + tempxml[i].firstChild); // Attaches color thumbnails to each item

item.onRollOver = function() {
this.alphaTo(100, 2.0, "easeOutExpo");
this.thumbHolder._visible = false;
};

item.onRollOut = function() {
this.alphaTo(100, 2.0, "easeOutExpo");
this.thumbHolder._visible = true;
};
//item.btn.id = i;
//item._alpha=75; // Sets an alpha = 50 to our items. This can be increased or decreased. It serves for the fade in/fade out effect
//item.onRollOver = function() {
//this.alphaTo(100, 1, "easeOutExpo"); // When I rollOver each item, alpha goes smoothly to 100
//};
//item.onRollOut = function() {
//this.alphaTo(75, 1, "easeOutExpo"); // When I rollOut alpha goes back to 50 as it was. This value should be the same with the one above
//};
//item.onRelease = function() {
//item.btn.getURL(this.url_txt.text,"_blank"); // When I click on an item, it opens an url (wich I set in the xml for each button) in a blank window of my browser
//};
}

delete myXML;
}
};

////////////////////////////
// Setting our scroll bar //
// We'll call it dragger ///
////////////////////////////
targY = 50;
abstandDragger = -195; // If you resize the items, or whatever you'll have to modify this value in order to have your dragger in the right x position
dragger._x = mask_mc._width+abstandDragger;


dragger.onRollOver = function (){
this.colorTo("0xFFFFFF", 1, "easeOutExpo"); // The color code from here makes our dragger white. Change this to modify color
};

dragger.onRollOut = function (){
this.colorTo("0x999999", 1, "easeOutExpo"); // The color code makes our dragger grey as it is in fact. This should be the same as dragger's color as shape ;)
};

dragger.onPress = function() {
startDrag(this, false, this._x, 0, this._x, mask_mc._height-this._height); // Doesn't allow our dragger to get out of some coordinates
};



dragger.onRelease = dragger.onReleaseOutside=function () {
stopDrag(); // Stops the mouse drag action
};


list_mc.setMask(mask_mc);
list_mc.onEnterFrame = function() {
scrollAmount = (this._height-mask_mc._height)/(mask_mc._height-dragger._height);
targY = -dragger._y*scrollAmount;
this._y -= (this._y-targY)/10; // Scroll delay - Ease. Change this value to experiment
};

/////////////////////////////////////
// Setting the mouse wheel support //
/////////////////////////////////////
var dragger:Object = new Object();
dragger.onMouseWheel = function(delta) {
if(this._y >= 3)
{
this._y -= delta;
}else{
this._y = 3;
}
if(this._y <= mask_mc._height-this._height)
{
this._y -= delta;
}else{
this._y = (mask_mc._height-this._height);
}
}
Mouse.addListener(dragger);

/////////
// End //
/////////

Simple Scroll Bar & Button Tutorial
I'm looking for a simple tutorial on creating three scroll buttons for my scroll text (up arrow, down arrow & a scroll bar). Some of the tutorials I've come across are missing steps on how do apply the action script or are too complicated.

Please send me a simple tutorial or point me in the right direction (by the way, I'm using Flash MX).

Thanks!

A Simple Scroll Script I Want To Customize
i have this neat little script that loads multiple text files into dynamic fields and scrolls them:

on a button:
on (release) {
loadVariables ("document1.txt", "");
mytext.scroll=x
}

on a scroll button:
onClipEvent (enterFrame) {
if (textscroll) {
_root.mytext.scroll--;
}
}

and this is the only AS i can find in the darn thing, unlike others that do the same thing with so much more scripting. anyway, it works great, but i'd like to include the buttons, field and scroller buttons into an MC; when i do, the load buttons still make the text load, but the scroller doesn't work. what might be the problem with this, and a way to make it work inside an mc?

also, any way to slow this thing down a bit? golly it's too simple a script; it seems to me there's go to be more to it...

thanks,
glennn

Can't Seem To Make A Simple Scroll Text...
Hi,

I'm trying to do a simple scroll text in Flash, but with or without components it doesn't work. The idea is to have a scroll text that will change according to the menu item that is pressed. Ok, I made a movie clip that has a dinamic text and 2 buttons - I adapted this from a fla file. The text is to be imported from a txt file. So, in the main scene ( where the effects are, etc. ) I placed the movie in a new layer. In another layer, called actions, I wrote the code:


Code:
loadVariablesNum("intro.txt", 0);
I test the movie and although the text area has the ID name of the variable in the intro.txt, nothing happens.

In another try, I used the ScrollBar component. That worked; only, when it reached the end of the timeline ( at least I think that's the reason ), the Scrollbar would return to the initial state as for the text...

I'm really a newbie in Flash - even if the effects I was able to create surprised myself. I think my problem is not understanding movie clips and timelines ( as for scenes ).

Please, can someone help me out?

Kind regards,

Kepler

Simple Scroll Panel Problem
I am using a scroll pane instance in which I am loading an external swf.
When I test the movie from within the Flash MX program it works fine.. but when I export it and try to use it outside the Flash program it exhibits an oddness...
Where the scroll pane ends on top and bottom, the external clip I loaded should lose visibility oursite the viewable scrollpane area... and it does so within the test movie function of the main flash program. But on its own outside the program, the scroll works but the entire external swf image is now viewable ..although it can be scrolled.. it does not hide what is outside the pane area....

What am I doing wrong?

Simple Scroll For Image Gallery
hi

i have an image gallery with a row of about 35 images along the bottom within an mc with the instance name 'scroll' which i have masked so only 3 or 4 are visable at a time.

i have a 'left' mc and a 'right' mc with the following code

left
frame1

stop()

frame 2
movespeed = 5;
if (_root.scroll._x>=292.6) {
gotoAndStop(1);
} else {
_root.scroll._x += moveSpeed;
}

frame 3
gotoAndPlay(2);


right
frame1
stop()


frame2
movespeed = 5;
if (_root.scroll._x<=-3451.3) {
gotoAndStop (1);
} else {
_root.scroll._x -= moveSpeed;
}

frame3
gotoAndPlay(2)


i then have 2 buttons

for the left scroll
on (press) {
tellTarget ("left") {
gotoAndPlay(2);
}
}
on (release) {
tellTarget ("left") {
gotoAndStop(1);
}
}

for the right scroll
on (press) {
tellTarget ("right") {
gotoAndPlay(2);
}
}
on (release) {
tellTarget ("right") {
gotoAndStop(1);
}
}


i cant make the 'scroll' mc scroll, i dont understand why. Please help me someone

Im using flash 8 if that helps

i have the fla at the following url if it will make it easier
http://www.ats-heritage.co.uk/div/Barony_DVD_VB.fla

cheers

Simple Way To Produce Scroll Bar In Flash5?
Is there a simple way in which you can produce a scroll bar in Flash 5? Aparently its really easy in mx but i havent got it yet? and ive been playing around with scroll bars in my free time them for ages.

Any help will be great. Thanx

Anyone Know Simple Code To Scroll Text (without Using Components)?
I'm trying to use an up and down button to scroll text, but I don't want to use the scrollbar component in Flash MX 'cause it's hard to customize (i.e. make the buttons circular instead of square).

Is there a SIMPLE tutorial or sample movie you know of that I could copy-and-paste code from? All of the ones I've seen either use the scrollbar component or are far too advanced for what I need.

Completed file would be similar to Eric Jordan's TURI site:
<a href="http://www.turivodka.com/">http://www.turivodka.com/</a>
(click on "Culture" to see the scrolling text)

Simple Scroll Text Doesn't Work...?
Hi,

Today is "questions day" as far as I'm concerned.I'm kidding - but I'm starting, and that's the worst part.

I've already put another question previously. Now I have a new one: I created a text box ( dynamic text ) that I called "textField". Now, I'm trying to make a simple scroll. So I put two buttons ( up and down ).
From one movie, i took this code:

on (rollOver)
{
textField.scroll += 1;
}

on (rollOut)
{
textField.scroll += 0;
}

but it doesn't work.

What is the problem? I tryed the Macromedia mx tutorial example, and it doesn't work either.

Can anyone help me out?

Regards,

Adamastor

They Call Me BUTTONS (issue With A Simple Scroll)
Alright Im getting Frustrated beyond belief.
I have a Dynamic Text field which is accepting an RSS feed. I HATE the way a compnent scroll bar looks. I created a widget and want to use custome buttons to scroll the dynamic text field.

The Dynamic text field's instance name is rss_txt. A simple scroll (meaning they have to click each time they want to move the text field one line)

I have a button thats a down arrow. On this button I have the following

PHP Code:




on(press)
{
    rss_txt.scroll=rss_txt-1;
}







Nothings happening its not working at all and Im kind of stumped as I have done things like this in the past. anyone have any idea?? HELP please

[CS3] SIMPLE | Getting Text To Scroll Using UI Scroller Component.
Ok this is driven me nutz I'm just playing around trying to get the UI scroller component to work and I'm having to problems. One the scroller isn't working and 2 most of the Lorem Ipsum dynamic text isn't showing up. This is TOTALY weak. Cause the video tutorial I have on this makes it look unbelievable easy to make both works. Just drag the UI scroller in place and purplish and it should be working we it’s not working for ME!

Link to sample project file:

www.johncliffordtaylor.com/text_scroll.fla

Thx for any help and feed back on what I'm doing or not doing to make this work.

[CS3] AS2 - Confused Getting Simple Arrows To Scroll Xml Content
I found a tutorial online for an xml/flash gallery. I've got it working with a scrollbar but i want to be able to scroll through the images with an up arrow & down arrow instead. I've taken a stab at the code but can't get it working. I've left the original script in just for reference purposes but am stumped as to how to get this function with just arrows. I've tried removing the dragger but nothing happens??? I've attached the files for reference. If anyone can help me out I'd really appreciate it.

P.S - I can't post the image folder as it's too large.


Code:
/////////////////////////////////////////////////////////////////////
Stage.scaleMode = "noscale";

/////////////////
// Loading XML //
/////////////////
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("portfolio.xml");
myXML.onLoad = function(_status) {
if (_status) {
tempxml = myXML.firstChild.childNodes;
var path1 = myXML.firstChild.attributes.path1;
var path2 = myXML.firstChild.attributes.path2;

var space = 25; // Space between items you can increase this to whatever
for (var i = 0; i<tempxml.length; i++) {

var item = list_mc.attachMovie("clip", "clip"+i, i); // In the library, rightclick on item and choose linkage. You'll see that our items are represented in the code the "clip" name

item._y = (item._height+space)*i; // This places our items on y axis
item.title_txt.text = tempxml[i].attributes.title; // For i<total, attaches a title i to our item
//item.date_txt.text = tempxml[i].attributes.date; // For i<total, attaches a title i to our item
item.descr_txt.text = tempxml[i].attributes.description; // This attaches a description i to our item
//item.url_txt.text = tempxml[i].attributes.url; // And this one a url i to our item

//item.thumbHolder.loadMovie(tempxml[i].firstChild); // Attaches thumbnails to each item
item.thumbHolder.loadMovie(path1 + tempxml[i].firstChild); // Attaches bw thumbnails to each item
item.thumbHolderC.loadMovie(path2 + tempxml[i].firstChild); // Attaches color thumbnails to each item

item.onRollOver = function() {
this.alphaTo(100, 2.0, "easeOutExpo");
this.thumbHolder._visible = false;
};

item.onRollOut = function() {
this.alphaTo(100, 2.0, "easeOutExpo");
this.thumbHolder._visible = true;
};
//item.btn.id = i;
//item._alpha=75; // Sets an alpha = 50 to our items. This can be increased or decreased. It serves for the fade in/fade out effect
//item.onRollOver = function() {
//this.alphaTo(100, 1, "easeOutExpo"); // When I rollOver each item, alpha goes smoothly to 100
//};
//item.onRollOut = function() {
//this.alphaTo(75, 1, "easeOutExpo"); // When I rollOut alpha goes back to 50 as it was. This value should be the same with the one above
//};
//item.onRelease = function() {
//item.btn.getURL(this.url_txt.text,"_blank"); // When I click on an item, it opens an url (wich I set in the xml for each button) in a blank window of my browser
//};
}

delete myXML;
}
};
////////////////////////////
// Setting the Arrows //
////////////////////////////
_root.uparrow_mc.onRollOver = function (){
this.alphaTo(100, 1, "easeInExpo"); // The color code from here makes our dragger white. Change this to modify color
}

_root.downarrow_mc.onRollOver = function (){
this.alphaTo(100, 1, "easeInExpo"); // The color code from here makes our dragger white. Change this to modify color
}

_root.downarrow_mc.onRollOut = function (){
this.alphaTo(10, 1, "easeOutExpo"); // The color code makes our dragger grey as it is in fact. This should be the same as dragger's color as shape ;)
}

_root.uparrow_mc.onRollOut = function (){
this.alphaTo(10, 1, "easeOutExpo"); // The color code makes our dragger grey as it is in fact. This should be the same as dragger's color as shape ;)
}

_root.uparrow_mc.onPress = function(){
this.onEnterFrame = function(){
target_mc._y -= 1;
}
}

_root.uparrow_mc.onRelease = function(){
delete this.onEnterFrame;
}

_root.uparrow_mc.onPress = function(){
this.onEnterFrame = function(){
target_mc._y += 1;
}
}

_root.uparrow_mc.onRelease = function(){
delete this.onEnterFrame;
}
////////////////////////////
// Setting our scroll bar //
// We'll call it dragger ///
////////////////////////////
targY = 50;
abstandDragger = -195; // If you resize the items, or whatever you'll have to modify this value in order to have your dragger in the right x position
dragger._x = mask_mc._width+abstandDragger;

dragger.onPress = function() {
startDrag(this, false, this._x, 0, this._x, mask_mc._height-this._height); // Doesn't allow our dragger to get out of some coordinates
};

dragger.onRelease = dragger.onReleaseOutside=function () {
stopDrag(); // Stops the mouse drag action
};

list_mc.setMask(mask_mc);
list_mc.onEnterFrame = function() {
scrollAmount = (this._height-mask_mc._height)/(mask_mc._height-dragger._height);
targY = -dragger._y*scrollAmount;
this._y -= (this._y-targY)/10; // Scroll delay - Ease. Change this value to experiment
};

/////////////////////////////////////
// Setting the mouse wheel support //
/////////////////////////////////////
var dragger:Object = new Object();
dragger.onMouseWheel = function(delta) {
if(this._y >= 3)
{
this._y -= delta;
}else{
this._y = 3;
}
if(this._y <= mask_mc._height-this._height)
{
this._y -= delta;
}else{
this._y = (mask_mc._height-this._height);
}
}
Mouse.addListener(dragger);

/////////
// End //
/////////

Copyright © 2005-08 www.BigResource.com, All rights reserved