My Scroller Won't SCROLL :'(
Help!
I used the tutorial on flashkit by Patrick Mineault to create a scrolling text box. The first one worked fine, but the other two don't work AT ALL, what could be going on?!
my site: http://www.7inone.info/monkeybut
the tutorial: http://www.flashkit.com/tutorials/In...29/index.shtml
basically, it's 3 parts in a MC. The first part is a dynamic text box, with a variable name. Part 2 is the up button, for which the AS is:
on( press ){ scrolling = "up"; } on( release, releaseOutside ){ scrolling = 0; }
Part 3 is the down button, which is scripted as:
on( press ){ scrolling = "down"; } on( release, releaseOutside ){ scrolling = 0; }
Now the MC with the 3 parts, is loaded onto the stage, and has the following object action:
onClipEvent (load) { this.loadVariables ("fclient.txt"); scrolling = 0; frameCounter = 1; speedFactor = 2; } onClipEvent (enterFrame) { if (frameCounter%speedFactor == 0) { if (scrolling == "up" && fclient.scroll>1) { fclient.scroll--; } else if (scrolling == "down" && fclient.scroll<fclient.maxscroll) { fclient.scroll++; } frameCounter = 0; } frameCounter++; }
if you go to the "Café" button on my site, and click "Café Events" you get a perfect scrolling text box.
I made the other scrollers in much the same way, just using copy and paste. TO see what's going on, go to:
1) News, Client Corner.
2) Then click on "feat. client"
the other option is
3) click on "feat. article"
In both cases - there is no scrolling. Can someone pls help!?!?!??!!?
much appreacite it
Sid.
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-11-2002, 04:47 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Text Scroller Help - Scroller Won't Scroll Full Length Of Text?
I have a text scroller that calls for a external text file. I have 16 numbered items in the .txt file but only 12 items will scroll. Why is this and how do I fix it? Also, is there any way to format text in the .txt file so that it appears formatted in flash? Right now there is a bunch of spaces between the numbered items. Thanks anyone!!
Scroller To Scroll Buttons...
I've searched and all I've found is people saying you could with the ScrollPane and a movie, but that's about it. No directions or suggestions. Right now, I have the ScrollBar Component just scrolling text, but eventually, I'll want that text to be different buttons to choose from. Any suggestions or links to Tutorials would be great...
Scroller Wont Scroll
Iv attatched the file. The scroller doesnt continuously scroll, it only scrolls down one bit.
A simple code error I think, please help!
Thanks
[F8]custom Scroller Needs To Scroll A Mc
The custom scroller worked fine scrolling a text box but now I need it to scroll a movie clip (as I want seperate boxes pulling in a picture, text, etc. from an xml file).
Any help in what I need to change is appreciated.
Here's the scroller actionscript:
#initclip 1
/*
FScrollBarClass
EXTENDS FUIComponentClass
*/
FScrollBarClass = function()
{
if (this._height==4) {
return;
}
this.init();
this.minPos = this.maxPos = this.pageSize = this.largeScroll = 0;
this.smallScroll = 1;
this.width = (this.horizontal) ? this._width : this._height;
this._xscale = this._yscale = 100;
this.setScrollPosition(0);
this.tabEnabled = false;
if ( this._targetInstanceName.length > 0 ) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
}
FScrollBarClass.prototype = new FUIComponentClass();
// ::: PUBLIC METHODS
FScrollBarClass.prototype.setHorizontal = function(flag)
{
if (this.horizontal && !flag) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && !this.horizontal) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
}
// updates the thumb, turns the bar on and off
FScrollBarClass.prototype.setScrollProperties = function(pSize, mnPos, mxPos)
{
if (!this.enable) {
return ;
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos,0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if (this.maxPos-this.minPos<=0) { // turn it off
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = this.downArrow_mc.onRelease = this.downArrow_mc.onDragOut = null;
this.upArrow_mc.onPress = this.upArrow_mc.onRelease = this.upArrow_mc.onDragOut = null;
this.scrollTrack_mc.onPress = this.scrollTrack_mc.onRelease = null;
this.scrollTrack_mc.onDragOut = this.scrollTrack_mc.onRollOut = null;
this.scrollTrack_mc.useHandCursor = false;
} else { // turn it on
var tmp = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = this.upArrow_mc.onDragOver = this.startUpScroller;
this.upArrow_mc.onRelease = this.upArrow_mc.onDragOut = this.stopScrolling;
this.downArrow_mc.onPress = this.downArrow_mc.onDragOver = this.startDownScroller;
this.downArrow_mc.onRelease = this.downArrow_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onPress = this.scrollTrack_mc.onDragOver = this.startTrackScroller;
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb;
this.scrollThumb_mc.useHandCursor=false;
this.thumbHeight = this.pageSize / (this.maxPos-this.minPos+this.pageSize) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max (this.thumbHeight, 6); // 6 is the smallest a thumb should be
this.midHeight = this.thumbHeight - this.thumbTop_mc._height - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = this.midHeight * 100 / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
tmp = Math.min(tmp, this.maxPos);
this.setScrollPosition(Math.max(tmp, this.minPos));
}
}
FScrollBarClass.prototype.getScrollPosition = function ()
{
return this.scrollPosition;
}
FScrollBarClass.prototype.setScrollPosition = function(pos)
{
this.scrollPosition = pos;
if (this.scrollThumb_mc!=undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = ((pos-this.minPos) * this.trackHeight / (this.maxPos-this.minPos)) + this.scrollTop;
this.executeCallBack();
}
FScrollBarClass.prototype.setLargeScroll = function(lScroll)
{
this.largeScroll = lScroll;
}
FScrollBarClass.prototype.setSmallScroll = function(sScroll)
{
this.smallScroll = sScroll;
}
FScrollBarClass.prototype.setEnabled = function(enabledFlag)
{
var wasEnabled = this.enable;
if (enabledFlag && !wasEnabled) {
this.enable = enabledFlag;
//if (this.textField!=undefined) {
//this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize,
this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if (!enabledFlag && wasEnabled) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter==undefined) {
this.setScrollProperties(this.pageSize,0,0);
} else {
this.clickFilter=true;
}
this.enable = enabledFlag;
}
}
// stretches the track, creates + positions arrows
FScrollBarClass.prototype.setSize = function(hgt)
{
if (this._height==1) return;
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = 100 * this.width / this.scrollTrack_mc._height;
if (this.upArrow_mc==undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1); //1 is arbitrary
this.attachMovie("DownArrow", "downArrow_mc", 2); //2 is arbitrary
this.downArrow_mc.controller = this.upArrow_mc.controller = this;
this.upArrow_mc.useHandCursor = this.downArrow_mc.useHandCursor = false;
this.upArrow_mc._x = this.upArrow_mc._y = 0;
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField!=undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
}
// ::: PRIVATE METHODS
FScrollBarClass.prototype.scrollIt = function (inc, mode)
{
var delt = this.smallScroll;
if (inc!="one") {
delt = (this.largeScroll==0) ? this.pageSize : this.largeScroll;
}
var newPos = this.getScrollPosition() + (mode*delt);
if (newPos>this.maxPos) {
newPos = this.maxPos;
} else if (newPos<this.minPos) {
newPos = this.minPos;
}
this.setScrollPosition(newPos);
}
FScrollBarClass.prototype.startDragThumb = function()
{
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
}
FScrollBarClass.prototype.dragThumb = function()
{
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove += this._y;
if (this.scrollMove<this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
}
else if (this.scrollMove>this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var c = this.controller;
c.scrollPosition = Math.round( (c.maxPos-c.minPos) * (this._y - c.scrollTop) / c.trackHeight) + c.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
}
FScrollBarClass.prototype.stopDragThumb = function()
{
this.controller.isScrolling = false;
this.onMouseMove = null;
}
FScrollBarClass.prototype.startTrackScroller = function()
{
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
}
FScrollBarClass.prototype.scrollInterval = function(inc,mode)
{
clearInterval(this.scrolling);
if (inc=="page") {
this.trackScroller();
} else {
this.scrollIt(inc,mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
}
FScrollBarClass.prototype.trackScroller = function()
{
if (this.scrollThumb_mc._y+this.thumbHeight<this._ymo use) {
this.scrollIt("page",1);
} else if (this.scrollThumb_mc._y>this._ymouse) {
this.scrollIt("page",-1);
}
}
FScrollBarClass.prototype.stopScrolling = function()
{
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
}
FScrollBarClass.prototype.startUpScroller = function()
{
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one",-1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval",500, "one", -1);
}
FScrollBarClass.prototype.startDownScroller = function()
{
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one",1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
}
//
// Begin Special text scroller functions
//
FScrollBarClass.prototype.setScrollTarget = function(tF)
{
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[ (this.horizontal) ? "hScroller" : "vScroller" ];
if (!(this.textField.hScroller==undefined) && !(this.textField.vScroller==undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) return;
this.textField = tF;
this.textField[ (this.horizontal) ? "hScroller" : "vScroller" ] = this;
this.onTextChanged();
this.onChanged = function()
{
this.onTextChanged();
}
this.onScroller = function()
{
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
}
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
}
FScrollBarClass.prototype.callback = function(prop, oldVal, newVal)
{
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return newVal;
}
FScrollBarClass.prototype.onTextChanged = function()
{
if (!this.enable || this.textField==undefined) return;
clearInterval(this.synchScroll);
if (this.horizontal) {
var pos = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
} else {
var pos = this.textField.scroll;
var pageSize = this.textField.bottomScroll - this.textField.scroll;
this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
}
}
FScrollBarClass.prototype.executeCallBack = function()
{
if (this.textField==undefined) {
super.executeCallBack();
} else {
if ( this.horizontal ) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
}
}
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Scroll With Mouse Scroller - Possible?
hello!
i'm in desperate need!! for this website i'm helping in, the client wanted me to scroll this section with words AND images. so , i used the scroll pane component from Flash mx8. it works. but, now the client wants it to scroll faster when using their mouse scroller.
currently it does scroll, but very slowly. is there another tutorial i could scroll both text and images with the mouse scroller? i'm still using action script 2.0
Scroller Allowing Really Long Scroll
Hi, I am looking for a scoller fla which you can write as much as you want and it would still scroll.
Also no loading in text file, all text would be already in the swf itself. Thank you.
SCROLL PANE Loads Sometimes With No Scroller
Hello,
Has anyone had the problem of using the Scroll Pane, loading a swf file into it, and then when you navigate back and forth on the timeline the scroller in the scroll pane doesn't show up, you leave go back and its there.
The largest pain in the butt is that it normally happens when it first loads.
Anyone experiencing this? Any solutions? Any causes?
.scroll Based Scroller Not Working In Pc's
Hi all.
I made a scroller that executes its action according to the text length. It's an html text by the way but otherwise is not responding either. I'm using TextField.maxscroll, TextField.bottomScroll and TextField.scroll in my script. When the text is longer, scroller functions, when it is shorter scroller does not allow any user action (on purpose).
My problem is, with some texts it functions in macs but not in pc's. I couldn't see why. I used <img> tags in a single text and it did not cause any malfunction in mac FF and Safari but it does not work in pc FF and IE either. Funny thing is, in pc's, some longer texts allow scrolling while some other don't. Note that I'm using the <img> tag in a single file.
To disable it in the script, I'm checking the length of the text via the following:
ActionScript Code:
if (myText.maxscroll <= 1) {
// disable scroller
}
Anybody has an idea? Thanks in advance.
Scroller Doesn't Scroll When Loaded
Hello, I'm making a new site but I got stuck. I hope someone can help me 'cause I just don't understand what I'm doing wrong.
I made a "site" in which I load the other parts of the site, for example "scroller" (both in attachment). If you open "scroller" you'll see it works just fine (I wish it would only skip one line at a time but that's not that important). When you open "site" it loads "scroller" in it but the scroller doesn't work anymore?!?
What did I do wrong? I guess it has something to do with the referrence path, but I can't find the sollution.
Please help me if you know how to fix it.
Thanx a lot!
Scroller Doesn't Scroll When Loaded
Hello, I'm making a new site but I got stuck. I hope someone can help me 'cause I just don't understand what I'm doing wrong.
I made a "site" in which I load the other parts of the site, for example "scroller" (both in attachment). If you open "scroller" you'll see it works just fine (I wish it would only skip one line at a time but that's not that important). When you open "site" it loads "scroller" in it but the scroller doesn't work anymore?!?
What did I do wrong? I guess it has something to do with the referrence path, but I can't find the sollution.
Please help me if you know how to fix it.
Thanx a lot!
Need XML Scroller To Scroll Based On Time?
Ok. So I am trying to create a thumbnail scroller with 2 movieclips.
1. "thumbs" <----------- 10 images of wich about 5 or 6 are visible in the panel
2. "bigthumbs" <--------10 images of which only 1 is visible (the main stage)
"thumbs" and the "bigthumbs" content are all grabbed via an XML file.
The part I need help in:
I then want the "thumnails" and the "bigthumbs" to scroll, but scroll based on time. So say every 5 seconds the panels will scroll say 50 px to the left.
I have no clue how that works. Can anyone point me in the right direction?
Thanks!
ZG
PS - If this works out, I'll post a tutorial on what I am doing. Should be pretty neat.[/u]
My Scroller Doesnt Scroll When I Load It Into Empty MC
i have a .swf(combobox.swf) that has a combobox on the scene. when the user selects something in the combobox it loads the selection into an empty movieclip (called "holder")on the scene. this part of the movie works fine. problem is....the movies that i want to be loaded have scrollers that load up txt from text file. that works fine too except that my up and down buttons do not work. however, the very same file (news.swf) scrolls just fine when it is viewed on its own. i cant figure this out? i guess when the news.swf movie is loaded into the empty movie clip the variables that define the up and down scrolling are not being passed
here is the URL to what i am working on
http://www.digitaldementia.ca/jimmyt...x/jsrouter.htm
if you select "movie3" the scroller will pop up on the scene but you will notice that it doesnt scroll!!!
i am also including all the files combobox.zip here:
http://www.digitaldementia.ca/jimmyt...x/combobox.zip
Scroller Component Doesn't Update New Scroll Max *$&#^@^
Ok, I'm posting this after almost 3 hours surfing other threads about the same thing, but no answer.
I'm modifying a guestbook I think I got from here at FK, and my mod includes the scroller component.
when I reload the guest book text from the external file, the scroller doesn't scroll! here's the link:
http://www.mike-watt.com/phpTests/GuestBook.html
notice the black box? click inside the text field and type something. the box does a little animation when you type. I used the "onChanged" function to do that. But the onChanged function doesn't seems to listen to when new text is loaded in. Go ahead, sign the guest book, and after pressing submit, the box don't move when the new entry loads. What is going on here. Macromedia, you are so stupid to not have thought of this!!!!!!!!!!
Please help...
Thanks,
MB
Dynamic Text Scroller As External Swf...won't Scroll...
I have a dynamic text scroller as an swf that i'm trying to use as an external swf in my main movie....it works fine on it's own, but when i use it as an external swf..the text shows up in the main movie and the scroller moves up and down, but the text doesn't actually move..i'll attach an example of the scroller so you know what kind of actionscript i'm using.....cheers for any help...
Flash VR Scroller -making It Scroll Vertical
hey guys!
ive been using this basic flash template for vr scrollers for ages..but im crap with actionscript..
anyhow this attached fla only scrolls horizontally..for a coming project i would need a scroller that only goes..so scrolls vertically..
could someone kindly modify this current actionscript so that it would do it vertically...id be so greatful!!
cheers!
ps..if you are kind enuff to email it back to me that would be the easiest..thanks again for taking the time and helping me out!
cc
How To Scroll Multiple Text Boxes With One Scroller
Hey guys
I am creating an index for a flash file and am working with the scroll component for the first time. I've got a couple of quick and probably easy questions.
First
I was wondering how to get one scollbar component to scroll multiple text box within the same frame. I have tried to give the different text boxes the instance name of "scroller" but it seems to only want to scroll the box that it is attached to.
Second
Also is there a way to attach a button to the different lines of text within the scrollbox, so that they will scroll with the text.
I'm could just go the old school way of making a scroll box, but I was hoping that there would be an easier way of doing it with the new component...
Thanks
pea
[F8] Horizontal Scroller Flash - Dyanamic Scroll Bar
I want to create a full window flash movie and be able to scroll the content horizontally as seen on this site:
http://www.designwright.co.uk/
The important feature I want to mimic is the scrollbar along the bottom. Regardless of the window size, it automatically resizes itself to fit in the window. The horizontal scroll also has some sweet easing.
Do any of you guys know how to create this scroller and scrollbar combo?
[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.
Dynamic Scroller - Reset Scroll Position. HELP ME
I'm using the dynamic scroller found on the kiropa site found here http://www.kirupa.com/developer/mx/dynamic_scroller.htm
In the action script on the ScrollBar, I can't find what variable to change to reset the position of the bar to the top of the scroller when I use the same dynamic text area for other content. It loads just fine, but if the scroller was left at the bottom, it stays there on the new text until you move it a bit, then the text catches up.
I'm hoping to find the variable and reset it when the new text loads.
I'd appreciate your time since I'm still a novice with action script.
Thanks.
Make A Standard Thumb Scroller / Scroll Infinitely
I've got a standard horizontal thumbnail scroller and want to have it scroll infinitely. So when it reaches the last one in the list from the xml it continues to show thumbnails starting over with the first... alternately when it starts and a user chooses to scroll in the other direction it shows the last one and progresses toward the first...
hopefully that makes sense.
I load the thumbs via xml here:
PHP Code:
function urlLoaded(event:Event):void { xml = XML(event.target.data); xmlList = xml.children(); for (var i:int=0; i < xmlList.length(); i++) { var thumb:Thumbnail = new Thumbnail(xmlList[i].url); arrayThumb.push(thumb); thumbNail.push(arrayThumb); arrayThumb[i].y = 0; arrayThumb[i].x = 10+(150*i); photoContainer.addChild(thumb); }}
then when one of my arrows to navigate left or right, i check to see if reaches the end and if it does I bounce it back to 0. which is what the onComplete event calls to and passes the max positions, in the checkPos function if the argument is true it Tweens all back to 0, but I'd rather just continue looping on through...
PHP Code:
function moveRight(e:MouseEvent):void{ var maxRight:Number = - photoContainer.width + stage.stageWidth; if(photoContainer.x < maxRight){ // do nada }else{ Tweener.addTween(photoContainer,{x:photoContainer.x-300, transition:"easeInOutBack", time:1.5, onComplete:checkPos, onCompleteParams:[maxLeft,maxRight]}); }}
any suggestions
Scroller Jumping To Middle Of Scroll Line Once Clicked.
I have an external loaded mc text file scrolling and easing just fine, my only issue is that when first pressed (scroller_mc), it jumps half way down my scroll line (line_mc). Every thing else works perfect after the scroll button (scroller_mc) makes the initial jump to the middle of the scroll line. I have followed a lynda.com tutorial 4 times and saw no mention of a bug, and followed the code exactly. Any help with this is much appreciated. Thanks
//---------------code---------------//
var textLoader:URLLoader = new URLLoader();
var textFile:URLRequest = new URLRequest("text/external.txt");
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = text_mc.y;
var easing:Number = 6;
function textLoaded(event:Event):void
{
text_mc.external_txt.text = textLoader.data;
minScroll = text_mc.y;
maxScroll = minScroll - text_mc.height + mask_mc.height;
}
function dragScroller(event:MouseEvent):void
{
var dragX:Number = line_mc.x;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
}
function stopDragging(event:MouseEvent):void
{
scroller_mc.stopDrag();
//stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
}
function setScrollPercent(event:Event):void
{
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
{
scrollPercent = 0;
}
else if(scrollPercent > 1)
{
scrollPercent = 1;
}
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
text_mc.y -= (text_mc.y - targetScroll) / easing;
}
function scrollUp(event:MouseEvent):void
{
}
function scrollDown(event:MouseEvent):void
{
}
textLoader.load(textFile);
scroller_mc.buttonMode = true;
text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);
//--------------code--------------//
Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.
Here's the code:
scrolling = function () {
var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};
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.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = 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();
Any ideas?
Thanks,
Dave
Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.
Here's the code:
scrolling = function () {
var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};
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.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = 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();
Any ideas?
Thanks,
Dave
Text Scroller With Image With Mouse Scroller
Hi to all,
I have problem with flash. that i want to creat dynamic text & image scroller in scroller by creating custom scroller (not inbuilt component) That scroller i can scroll with help of mouse's scroller. (the mouse's scroller & image must be include in to the scroller box)
Help me !
Help me !
Reply me fast if u have solution for it!!!!
Regards,
Samual
Convert Vertical Scroller To Horizontal Scroller
Hi have a cool vertical scroller that I did try to convert to horizontal, but I could not make it work.
Can someone help ??
Below is the code for vertical scroller:
Thanks to anyone who can help.
//code by Billy T
//set a variable
targY=0;
//set the x position of the dragger
dragger._x = 370;
line._x = 370;
//set the drag action of the dragger
//drag is restricted to the height of the mask
dragger.onPress=function(){
startDrag(this,false,this._x,0,this._x,theMask._he ight-this._height);
}
//stop the drag
dragger.onRelease=dragger.onReleaseOutside=functio n(){
stopDrag();
}
//set the mask for the text
theText.setMask(theMask);
//the scrolling animation
theText.onEnterFrame=function(){
/*set a variable
this variable basically stores info regarding what fraction of the total text
is being displayed through the mask and ensures that dragging the dragger
from top to bottom will reveal all the text.
this allows you to change the amount of text and the scroller will update itself
*/
scrollAmount=(this._height-(theMask._height/1.3))/(theMask._height-dragger._height);
//set a new target y position
targY=-dragger._y*scrollAmount;
//set the y of the text to 1/5 of the distance between its current y and the target y
//change the 5 to a lower number for faster scrolling or a higher number for slower scrolling
this._y-=(this._y-targY)/5;
}
Horizontal Scroller...NOT Vertical Scroller
Hi all:
I was just curious if anyone knows of a good tutorial for a horizontal scroller ... I want to use arrows not a bar, and I can find the vertical tutorials, but I was curious if anyone knew of a horizontal one.
THanks in advance
Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!
Does anybody know how to do the following things in Flash MX?
1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.
Can anybody help me, please? This is urgent!
Thanks in advance!
animind
Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!
Does anybody know how to do the following things in Flash MX?
1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.
Can anybody help me, please? This is urgent!
Thanks in advance!
animind
Scroll Bar Show Up If Needed And Only Scroll To Dynamic Text Input Bottom... HOW
I have attached a copy of my scroll bar that i am currently using how can i make the scroll bar not show up unless needed (really not all that important but would be nice.)
The important thing is that i can setup a dynamic text box inside my item_holder movie clip but my scroller always scrolls to the bottom of the scroll box not matter if inside my scroll box i have on line of text loaded dynamicly or i have 100. So if i have 1 line of text and a large dynamic text box the scroll bar will scroll to the bottom of the scroll box even though it only has one line. See attachment and see if anyone can help. Thanks in advance. Brian
Scroll Text > Button > Load Txt File > Reset Scroll Bar...?
Hi i am looking for a tutorial or an explanation of how you can load an external text file into a text field and have...let's say 3 buttons that load the .txt files...when they are loaded...i want the scroll bar to be reset to the top of the text field/box....
any help...welcome...
ta...tiger...
Linking Text Buttons In Scroll To Image Outside Scroll Area
Hi,
I am desperately hitting my head against a brick wall - so please help me!
I have created a flash area that is divided up with an image on top and a scroll area under.
I am trying to get the text buttons in the scroll area to each change the image above and cant seem to get it to work because of the masking.
I have tried heaps and heaps of different ways and am going crazy!
PLEASE HELP ME!!!!
thanks,
kova
Change Vert Scroll Script To Horiz Scroll
I found this tutorial for a scrollbar. It works great for vertical scrolling (ex:http://www.matthewterry.net/safetyguide.html click any section), but I want to change it to scroll horizontally, for another project.
Can someone help me change it to affect horizontal scrolling?
On the content's movie:
onClipEvent(load){
goY = this._y;
myY = this._y;
ySpeed = 0;
clicked = false;
delay = 2;
barDis = 380;
barPercent = 0;
}
onClipEvent(enterFrame){
if(math.round(myY) != math.round(goY) || clicked == true){
barPercent = (_parent.scroller.scrolllever._y/barDis)*100;goY = 116.7 - ((340/100)*barPercent);
myY = this.setonescroll._y;
ySpeed = (myY-goY)/delay;
this.setonescroll._y -= ySpeed;
}
}
On the scroller:
on(press){
startDrag(this,0,0,0,0,_parent._parent.setone.barD is);
_parent._parent.setone.clicked = true;
}
on(release, releaseOutside){
stopDrag();
_parent._parent.setone.clicked = true;
}
Thanks,
Matt
Please Help Me Place The Arrows Of My ScrollPane Scroll Bar Together On One End Of The Scroll Track
I have a scrollpane component with a movie clip of some thumbnail images.
I just want to have its scrollbar arrows together on one end of the track (or together ANYwhere) instead of having them at opposite ends of the scroll track.
I have been able to customize the appearance of the scrollpane and its scrollbar using the HaloTheme library, but that approach has so far been of no use in getting the arrows together.
I cannot tell you how deeply any help will be appreciated. I will probably sob and mewl with gratitude, the way I imagine someone lost in a vast rain forest for many weeks mewls when rescued. I am desperate. I am going insane. Please, please help me.
Modifying Position Of Scroll Arrows In Scroll Pane
Does anyone out there know how to modify the code of the standard Flash component scroll pane to allow you to place the arrows anywhere you want on the page? I was able to go in and assign x and y coordinates for them, but they seem to be linked to the bounding box somehow and whenever I raise or lower them the box follows suit, which ends up cutting of the content inside the box...
I didn't post any code because there is so **** much of it and I can't figure out where it is that the position of the arrows is linked to the position of that ****ed box (this is what I suspect the problem is, but please tell me if you know different!)!!!
HELP!!!!
Modifying Position Of Scroll Arrows In Scroll Pane
Does anyone out there know how to modify the code of the standard Flash component scroll pane to allow you to place the arrows anywhere you want on the page? I was able to go in and assign x and y coordinates for them, but they seem to be linked to the bounding box somehow and whenever I raise or lower them the box follows suit, which ends up cutting of the content inside the box...
I didn't post any code because there is so **** much of it and I can't figure out where it is that the position of the arrows is linked to the position of that ****ed box (this is what I suspect the problem is, but please tell me if you know different!)!!!
HELP!!!!
Scroll Bar Component Doesn't Scroll When Dynamic Txt Is Used?
I have a dynamic text box with the Flash UI component "Scroll Bar" attached to it. It works and scrolls fine when you enter text directelly into the dynamic box but when you use the loadVariables command to load an external txt file into it, it fails to scroll the text?
Is there a way to get it to scroll?
thx Bk9
Text + Image Scroll Function With Scroll Bar. Help
Hi, tring to create a scrollable text window that can also include different text colours, styles, links and images. I have tried a few tutorials but they only seem to work with dynamic text without different colours, styles, links and images. is there an easier solution i can use..
Please help
Scroll Gallery [doesn't Scroll After Particular Point]
Hello guys,
I have got this script from one of the opensource files on flashkit and want to use it for one of my requirements. Basically all I want to do is, scroll images vertically based on mouse movement. I've done that already but the issue is that when I have over 10-15 images, it doesn't scroll as there is no place left for the mouse to go further down. If you have a look at the attached file, you'll know what exactly I am talking about. Ideally, if mouse is held downwards, the images should keep scrolling untill it reaches it's end.
Can anybody have a look at the fla and help me out.
Cheers,
D
Scroll Wheel - Control Page Scroll?
Alrightly... So I have a flash file that is 750 x 1000 px and is embedded into an html page. Since it's height is a 1000px in order to see the whole flash file one needs to scroll down on the page. This is fine except that when people are working with the flash file (have clicked on it) and then want to use the scroll wheel it won't scroll the html page..
I realize this is because in flash you can assign your own properties to the scroll wheel. But is there a way to have the scroll wheel perform it's normal function of scrolling the html page?
I'm not sure if there is an easy way or if I would have to write some code for flash to call javascript to scroll the page? I know people must have run into this problem before and probably have some good solutions.
Thanks in advance
Scroll Text With Image In Scroll Panel ? Help
Hi,
I m trying scroll pannnel to show image and dynamic text both in scroll panne but when i select dymanic text in text option it comes outer from scroll pannel but static text is coming.
I need help to show dynamic text also in scroll pannel.
Thanks
Changing Quality On Scroll :: Scroll Plane
Hi There,
Does anyone know a easy way of getting the flash movie to change quality when a scroll plane is scrolling... I have loads of content in the plane and need to set the quality to low whilst scolling to improve performance....
at the moment I have this code.
Code:
var dragQual:Object = new Object();
dragQual.scroll = function(eventObj){
_quality = "LOW"
}
tDragObject.addEventListener("scroll", dragQual);
but it only sets the quality to low, once the user has finnished scolling I want the quality to go back to best....
Any Ideas?
Change Horizontal Scroll To Vertical Scroll
Hi,
I've flash source code that is having a horizontal scrolling. Anybody can help me to change this to a vertical scroll.
Pls check the attached file.
thanks in advance...
Scroll Text With Image In Scroll Panel ? Help
Hi,
I m trying scroll pannnel to show image and dynamic text both in scroll panne but when i select dymanic text in text option it comes outer from scroll pannel but static text is coming.
I need help to show dynamic text also in scroll pannel.
Thanks
Changing Quality On Scroll :: Scroll Plane
Hi There,
Does anyone know a easy way of getting the flash movie to change quality when a scroll plane is scrolling... I have loads of content in the plane and need to set the quality to low whilst scolling to improve performance....
at the moment I have this code.
Code:
var dragQual:Object = new Object();
dragQual.scroll = function(eventObj){
_quality = "LOW"
}
tDragObject.addEventListener("scroll", dragQual);
but it only sets the quality to low, once the user has finnished scolling I want the quality to go back to best....
Any Ideas?
|