Easing Scroller To A Fixed MC Height.
Ok. I put this scroller together, I'm sure my methods are a bit off, but it works. The problem is, everytime I need to add some more text I have to go in and guess what to put on the down button as far as my _y positioning.
What I'm trying to get an answer to is:
What is the method of getting the scroll arrows to know the height of a MC.
Attached is my scroller.
Thanks, -t
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 02-01-2004, 12:21 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Easing Scroller To A Fixed MC Height.
Ok. I put this scroller together, I'm sure my methods are a bit off, but it works. The problem is, everytime I need to add some more text I have to go in and guess what to put on the down button as far as my _y positioning.
What I'm trying to get an answer to is:
What is the method of getting the scroll arrows to know the height of a MC.
Attached is my scroller.
Thanks,
-t
Fixed Width And Height?
I have a movie "product" inside a movie "contProduct". Now I increase the width and height as well as the _x and _y of the "product" movie. But I want the "contProduct" movie to stay the same size so that the "product" movie can grow without growing over the whole swf.
Can this be done??
Is This Possible? 100% Flash Movie Fixed Height?
Hello you flash gurus,
I am need of some advice which I hope you can help me with.
I have someone developing a flash banner for me, I was under the impression that creating a fluid flash banner was possible from what I've read previously.
On other sites I've seen flash adjust to the browser resolution with ease, without losing quality.
My developer has started to flag that this is now not possible?
What I am looking to do is have a variable width flash banner (with the actual .swf able to scale efficiently at 100% width) with my fluid layout whilst maintaining a static pixel measurement in height.
Your comments would be gratefully received. Thank you!
Text With Fixed Width But Dynamic Height
i need to have on my page a text which has to get
a fixed width ... but a dynamic height ( this text must be dynamic) !!
please tell me how can i do this !! ?
ThX.
[MX] Flash Panel With Fixed Height, But Liquid Width?
i have a flash panel that is 700 x 200 pixels, with 5 lines of text.
I want to have the width of the panel widen, when you widen the browser window which in turn will also widen the width of the text area. So the text might go from say,..5 lines to 3 since it is now a wider text column.
I have the html embed width defined as 100% which extends the background color fine, but i also want:
1) the text column to widen to whatever the width of the browser window
2) the panel not to shrink smaller than 700 x 200
I'm not sure i've even seen this done before, but thought i'd ask.
Flash 8 Cheerleader Slide Show With Fixed Height Of 400 Pixels
Hi, I'm fairly new to using Flash and this is my first post!
I modified one of the Flash slideshows and thought I'd post it here in case others wanted to play with it. Unfortunately I can't upload the zip as it's 1,422 KB. Here is the URL if you want to download and play. It has the .FLA, .SWF, .XML, and 10 small JPGs.
http://gocheer.com/downloads/cheerleader_slideshow.zip
Some changes I made:
1. Removed the preloader. Wasn't needed. I added static graphics in their place.
2. Set stage resize to no. I don't want images resized up.
To use the slideshow change the background static images, change the URL button, change the xml file to point to your files (locally or URL).
Note: To add new images to slideshow I found I like to resize the images in Photoshop to 400 pixels high (the width autosizes) and then save at about 70% to reduce image size.
Note: what I would like to see changed in the slideshow is add an autoscroll button with a variable autoscroll speed that toggles off/on.
Best wishes, Joe Hart
Cary, NC
Problem Making Fixed Thumb On Component Scroller
i'm trying to make the thumb on the component stay a fixed size. i dont want it to scale according to the size an accompanying text field. is there any way to do this?
i've been trying to look for the answer online, in books, tutorials with no luck. please help so i dont have to hurt the kids tonight.
as always any help is greatly appreciated. thanks
erase
Scroller With Easing
does anyone know where i can view tutorials for creating text scrollers with easing or help me with this?
Thanx in advance!
Scroller With Easing.
I've tried to create a scroller from some ActionScript.
The Scroller moves fine, but the Content doesn't move at all.
But it doesn't work (AS2/Flash Player 8):
space = 20;
friction = 0.9;
speed = 4;
y = Scroller._y;
top = Content._y;
bottom = Content._y+Mask._height-Content._height-space;
Scroller.onPress = function() {
drag = true;
this.startDrag(false,this._x,this._parent.y,this._ x,this._parent.y+this._parent.Mask._height-this._height);
scrollEase();
};
Scroller.onMouseUp = function() {
this.stopDrag();
drag = false;
};
scrollEase = function () {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(Mask._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-Content.y)/speed)*friction);
Content.y += dy;
};
};
Anyone that can spot the problem?
Scroller With Easing
does anyone know where i can view tutorials for creating text scrollers with easing or help me with this?
Thanx in advance!
Dynamic Height Scroller
I am having a problem locating a good source for a dynamic scroller.
I have created a schedule of events in flash using XML. They are displayed in a series of MClips. The number of These MClips is dynamic so there could be as few as 1 and as many as 100. I am looking for a scroller that will recognize the height of my main MClip that contains all of thes additional MClips and adjust the scroll accordingly.
I am having a hell of a time figuring this out and was wondering if someone could point me in the right direction :-)
Scrollpane And Scroller Height
Is it possible to have the vertical scroller of a scrollPane shortter than the whole ScrollPane it self?
If yes how can you do that?
using vScroller._height or something like that?
thanks
Image Scroller With Easing?
Hi, can anyone point me in the direction of a tutorial or movie (Flash 5 please) that features a continuous scrolling MC that when the mouse comes off it, slows down to a stop?
Take a look at the scrolling logos here to see what I'm talking about. I want to create the same effect but have them decellerate to a stop when the mouse leaves the logos area.
Thanks,
Andy
Easing Scroller With Arrow Up & Down?
Hello eveyone,
I am tryin to build a easing scroller with arrow up and down and scroll track. I have already scene the FLA on flashkit movies have with the smooth scroll. It has no up and down arrows.
Thanks!!!!!
Easing Movieclip Scroller
Hi,
I've built a script for a dynamically created movieclip scroller that eases smoothly when scrolled. I'm exporting as flash 6.
The script is *almost* working great, but I'm having a bit of trouble with the positioning of the content after the scrollbar has been pressed/dragged. I believe that the problem may be in the equation for the Ypos variable (inside the 'updateScrollbar()' function)...but I'm not sure. Can anyone help with suggestions for optimization of this script? i think it's a valuable one to have in a script library...once it's working 100% properly.
Please see the script below. Note that on the stage, there are 2 movieclips already existent: "content1" and "mask1". If you'd like to see the .fla or experiment with it, you may download it here:
http://www.gabewatkins.com/grab/scroller.zip
Any help is much appreciated!
------------------------
mc = content1;
mask = mask1;
scrollOffset = 10;
scrollIt(mc, mask, scrollOffset);
function addScrollElements(mask, offset) {
st = attachMovie("scrolltrack", "scrolltrack", 0); // attach the scrolltrack mc
st._x = mask._x+(mask._width+offset); // position it 'offsetR' number of pixels to the right of the mask
st._y = mask._y; // position it even with the top of the mask
st._height = mask._height; // set the height equivalent to the mask's height
sb = attachMovie("scrollbar", "scrollbar", 1); // attach the scrollbar mc
sb._x = st._x // position it's 'x' equivalent to the scrolltrack's 'x'
sb._y = st._y; // position it at the top of the scrolltrack
diff_y = mask._height-sb._height;
bounds = mask.getBounds(this);
top = bounds.yMin;
bottom = bounds.yMax-(sb._height);
}
function addEvents(mc){
mc.onEnterFrame = function() {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/6; //modify easing out speed here
this._y = Ysquare+Ymove;
}
sb.onMouseDown = function() {
startDrag(this, false, this._x, top, this._x, bottom);
scrolling = true;
}
sb.onMouseUp = function() {
stopDrag();
scrolling = false;
}
sb.onEnterFrame = function() {
if (scrolling) {
updateScrollbar(mc, mask);
done = false;
} else if (!done) {
done = true;
}
}
}
function updateScrollbar(mc, mask) {
Ypos = -(((sb._y-top)/diff_y)*(mc._height-mask._height));
}
function scrollIt(mc, mask, offset) {
addScrollElements(mask, offset);
addEvents(mc);
}
------------------------
Thank you!
Scroller For Buttons With Easing
I'm have a lot of buttons, so I wanted to use a drag scoller with easing to scroll through them. I checked out the action script on a text scroller tut on flashkit. My scroller works superbly. However, the buttons don't work. If I take the script out, it won't scroll, but the buttons work. I've been pulling my hair out for 2 days!!!
I've attached the file. Can any one help?
Easing Movieclip Scroller
Hi,
I've built a script for a dynamically created movieclip scroller that eases smoothly when scrolled. It's working great, but I'm having a bit of trouble with the positioning of the content after the scrollbar has been pressed/dragged. I believe that the problem may be in the equation for the Ypos variable (inside the 'updateScrollbar()' function)...but I'm not sure. Can anyone help with suggestions for optimization of this script? i think it's a valuable one to have in a script library...once it's working 100% properly.
Please see the script below. Note that on the stage, there are 2 movieclips already existent: "content1" and "mask1". If you'd like to see the .fla or experiment with it, you may download it here:
http://www.gabewatkins.com/grab/scroller.zip
Any help is much appreciated!
------------------------
mc = content1;
mask = mask1;
scrollOffset = 10;
scrollIt(mc, mask, scrollOffset);
function addScrollElements(mask, offset) {
st = attachMovie("scrolltrack", "scrolltrack", 0); // attach the scrolltrack mc
st._x = mask._x+(mask._width+offset); // position it 'offsetR' number of pixels to the right of the mask
st._y = mask._y; // position it even with the top of the mask
st._height = mask._height; // set the height equivalent to the mask's height
sb = attachMovie("scrollbar", "scrollbar", 1); // attach the scrollbar mc
sb._x = st._x // position it's 'x' equivalent to the scrolltrack's 'x'
sb._y = st._y; // position it at the top of the scrolltrack
diff_y = mask._height-sb._height;
bounds = mask.getBounds(this);
top = bounds.yMin;
bottom = bounds.yMax-(sb._height);
}
function addEvents(mc){
mc.onEnterFrame = function() {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/6; //modify easing out speed here
this._y = Ysquare+Ymove;
}
sb.onMouseDown = function() {
startDrag(this, false, this._x, top, this._x, bottom);
scrolling = true;
}
sb.onMouseUp = function() {
stopDrag();
scrolling = false;
}
sb.onEnterFrame = function() {
if (scrolling) {
updateScrollbar(mc, mask);
done = false;
} else if (!done) {
done = true;
}
}
}
function updateScrollbar(mc, mask) {
Ypos = -(((sb._y-top)/diff_y)*(mc._height-mask._height));
}
function scrollIt(mc, mask, offset) {
addScrollElements(mask, offset);
addEvents(mc);
}
------------------------
Thank you!
Easing Text Scroller
Hi Guys. Hope someone can help.
I've been using the same easing text scroller on my projects for a few months now and it works fine, but I've just noticed (after looking at other sites) that the one I'm using isn't very smooth. but when I scroll I find that the text changes between clear and fuzzy, even if I use pixel fonts? I can understand why but I've been looking at some which dont go fuzzy at all.
Does anyone know any tips for a good easing scroller that keeps the text clear or point me to a tutorial/fla file?
Is it something in the script to say only move in integres so that the text stays clear??
Thanks guys. Phil
Creating An Easing Scroller
Hi everybody!!!
How can I create an easing scroll text field, or find a tutorial about it??
Im thinking in somehing like the flashloaded ultimate scroller...
Can you helpme????
Adding Easing To My Scroller
I'm somewhat new to actionscripting but a fairly fast learner. Work wants me to create to a scroller like the one I've attached but with an elastic efftect to it.
I've looked at some others examples and some tutorials but was somewhat lost so I just sat down and tried coming up with a ghetto way. I the very basics done but im wondering if there's a much better way of doing this especially if I wish to do some easing.
link to fla
Looking For Scroller W/ Easing Tutorial
Just as the title says. I am using Flash 8, and I am looking for a tutorial that covers using a scroller with easing applied to text that is being dynamically loaded in through XML. Any help would be greatly appreciated.
Thanks.
Easing Scroller Goes Backwards?
Hi There
I'm using an easing text scroller, that takes in text from an external text file.
On my hard-drive it all works fine, but when I upload it to my site, the thing works in reverse, i.e. you drag the scrollbar down and the text goes down too.
It's almost as if it's not reading in all the necessary info?
You can view the scrollbar online here.
http://www.simpletoremember.co.uk/scroll/scroll.html
A zip file with all the files is here.
http://www.simpletoremember.co.uk/sc...gScrollBar.zip
please help! thanks a lot!
mark
Easing Movieclip Scroller
Hi,
I've built a script for a dynamically created movieclip scroller that eases smoothly when scrolled. It's working great, but I'm having a bit of trouble with the positioning of the content after the scrollbar has been pressed/dragged. I believe that the problem may be in the equation for the Ypos variable (inside the 'updateScrollbar()' function)...but I'm not sure. Can anyone help with suggestions for optimization of this script? i think it's a valuable one to have in a script library...once it's working 100% properly.
Please see the script below. Note that on the stage, there are 2 movieclips already existent: "content1" and "mask1". If you'd like to see the .fla or experiment with it, you may download it here:
http://www.gabewatkins.com/grab/scroller.zip
Any help is much appreciated!
------------------------
mc = content1;
mask = mask1;
scrollOffset = 10;
scrollIt(mc, mask, scrollOffset);
function addScrollElements(mask, offset) {
st = attachMovie("scrolltrack", "scrolltrack", 0); // attach the scrolltrack mc
st._x = mask._x+(mask._width+offset); // position it 'offsetR' number of pixels to the right of the mask
st._y = mask._y; // position it even with the top of the mask
st._height = mask._height; // set the height equivalent to the mask's height
sb = attachMovie("scrollbar", "scrollbar", 1); // attach the scrollbar mc
sb._x = st._x // position it's 'x' equivalent to the scrolltrack's 'x'
sb._y = st._y; // position it at the top of the scrolltrack
diff_y = mask._height-sb._height;
bounds = mask.getBounds(this);
top = bounds.yMin;
bottom = bounds.yMax-(sb._height);
}
function addEvents(mc){
mc.onEnterFrame = function() {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/6; //modify easing out speed here
this._y = Ysquare+Ymove;
}
sb.onMouseDown = function() {
startDrag(this, false, this._x, top, this._x, bottom);
scrolling = true;
}
sb.onMouseUp = function() {
stopDrag();
scrolling = false;
}
sb.onEnterFrame = function() {
if (scrolling) {
updateScrollbar(mc, mask);
done = false;
} else if (!done) {
done = true;
}
}
}
function updateScrollbar(mc, mask) {
Ypos = -(((sb._y-top)/diff_y)*(mc._height-mask._height));
}
function scrollIt(mc, mask, offset) {
addScrollElements(mask, offset);
addEvents(mc);
}
------------------------
Thank you!
Parallax Scroller Easing
i've got a simple parallax scrolling effect going on with this code... i was wondering how i would be able to ease it when it reaches the edges?
ActionScript Code:
onClipEvent (enterFrame) {
var speed = 80;
var distance = (_root._xmouse - (Stage.width/2));
// pic4 scrolling
_root.pic4._x -= (distance / speed / 4);
if (_root.pic4._x > 0){
_root.pic4._x = 0;
}
if (_root.pic4._x < -25){
_root.pic4._x = -25;
}
// pic3 scrolling
_root.pic3._x -= (distance / speed / 2);
if (_root.pic3._x > 0){
_root.pic3._x = 0;
}
if (_root.pic3._x < -50){
_root.pic3._x = -50;
}
// pic2 scrolling
_root.pic2._x -= (distance / speed);
if (_root.pic2._x > 0) {
_root.pic2._x = 0;
}
if (_root.pic2._x < -100) {
_root.pic2._x = -100;
}
}
thanks in advance
Smooth Scroller - Height Issues
Hi,
I found a "Really smooth scroller with decceleration plus" at flashkit the other day. Its great ! ( Link )
But i have one question when it comes to height :
I did as it said in the describtion, but i want the menu itself to be the same size, but now the "puller" moves out of its frame :
Link 01
( I exteded the lenght in buttonmc to -1800, compared to standard -1010 )
Link 02
( height -1010, standard )
If anyone could give me a hint of what i am doing wrong, that would be AWESOME !
Regards,
Simon Sebergsen from norway
[F8] Adding Easing To Non-button Scroller
Hallo, I'm pretty new to actionscript so please bear with me...
I'm using this non-button scroller code, with all the values changed to make it vertical instead of horizontal. It works perfectly but I want to make the motion smoother so when you mouse over the scroll area it accelerates into the scroll and when you mouse off it decelerates to a stop. Any help appreciated
Easing Decelerating Scroller Script?
How can I get the commented out section of the following to work...
Presently it's either one or the other, and I need both...
ActionScript Code:
...
if (Number(mousev)>200 and Number(mousev)<280) {
movevalue = (Number(movevalue*9)+Number(((mouseh-320)/20)))/10;
} else {
if(movevalue > 0){
movevalue -=.25;
}else{
movevalue = 0;
}
/*
if(movevalue < 0){
movevalue +=.25;
}else{
movevalue = 0;
}*/
}
...
Advanced Easing Scroller Woes
I have a scrollbar that uses an .as file. The scrollbar_mc itself is linked to this file. I'm trying to get 2 of the same type of scroller on the same page, but the text fields are different heights. I've given the mcs in the second .fla and .as files different instance names and it runs fine locally. Only when I put them on the net does the one that's supposed to scroll less, scroll as much as the longer one. Hope that explains my problem.
Any ideas? I can post and example if needed......
Thanks
Easing Movieclip Scroller Script
Hi,
I've built a script for a dynamically created movieclip scroller that eases smoothly when scrolled. It's working great, but I'm having a bit of trouble with the positioning of the content after the scrollbar has been pressed/dragged. I believe that the problem may be in the equation for the Ypos variable (inside the 'updateScrollbar()' function)...but I'm not sure. Can anyone help with suggestions for optimization of this script? i think it's a valuable one to have in a script library...once it's working 100% properly.
Please see the script below. Note that on the stage, there are 2 movieclips already existent: "content1" and "mask1". If you'd like to see the .fla or experiment with it, you may download it here:
http://www.gabewatkins.com/grab/scroller.zip
Any help is much appreciated!
------------------------
mc = content1;
mask = mask1;
scrollOffset = 10;
scrollIt(mc, mask, scrollOffset);
function addScrollElements(mask, offset) {
st = attachMovie("scrolltrack", "scrolltrack", 0); // attach the scrolltrack mc
st._x = mask._x+(mask._width+offset); // position it 'offsetR' number of pixels to the right of the mask
st._y = mask._y; // position it even with the top of the mask
st._height = mask._height; // set the height equivalent to the mask's height
sb = attachMovie("scrollbar", "scrollbar", 1); // attach the scrollbar mc
sb._x = st._x // position it's 'x' equivalent to the scrolltrack's 'x'
sb._y = st._y; // position it at the top of the scrolltrack
diff_y = mask._height-sb._height;
bounds = mask.getBounds(this);
top = bounds.yMin;
bottom = bounds.yMax-(sb._height);
}
function addEvents(mc){
mc.onEnterFrame = function() {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/6; //modify easing out speed here
this._y = Ysquare+Ymove;
}
sb.onMouseDown = function() {
startDrag(this, false, this._x, top, this._x, bottom);
scrolling = true;
}
sb.onMouseUp = function() {
stopDrag();
scrolling = false;
}
sb.onEnterFrame = function() {
if (scrolling) {
updateScrollbar(mc, mask);
done = false;
} else if (!done) {
done = true;
}
}
}
function updateScrollbar(mc, mask) {
Ypos = -(((sb._y-top)/diff_y)*(mc._height-mask._height));
}
function scrollIt(mc, mask, offset) {
addScrollElements(mask, offset);
addEvents(mc);
}
------------------------
Thank you!
Easing Movieclip Scroller Script
Hi,
I've built a script for a dynamically created movieclip scroller that eases smoothly when scrolled. It's working great, but I'm having a bit of trouble with the positioning of the content after the scrollbar has been pressed/dragged. I believe that the problem may be in the equation for the Ypos variable (inside the 'updateScrollbar()' function)...but I'm not sure. Can anyone help with suggestions for optimization of this script? i think it's a valuable one to have in a script library...once it's working 100% properly.
Please see the script below. Note that on the stage, there are 2 movieclips already existent: "content1" and "mask1". If you'd like to see the .fla or experiment with it, you may download it here:
http://www.gabewatkins.com/grab/scroller.zip
Any help is much appreciated!
------------------------
mc = content1;
mask = mask1;
scrollOffset = 10;
scrollIt(mc, mask, scrollOffset);
function addScrollElements(mask, offset) {
st = attachMovie("scrolltrack", "scrolltrack", 0); // attach the scrolltrack mc
st._x = mask._x+(mask._width+offset); // position it 'offsetR' number of pixels to the right of the mask
st._y = mask._y; // position it even with the top of the mask
st._height = mask._height; // set the height equivalent to the mask's height
sb = attachMovie("scrollbar", "scrollbar", 1); // attach the scrollbar mc
sb._x = st._x // position it's 'x' equivalent to the scrolltrack's 'x'
sb._y = st._y; // position it at the top of the scrolltrack
diff_y = mask._height-sb._height;
bounds = mask.getBounds(this);
top = bounds.yMin;
bottom = bounds.yMax-(sb._height);
}
function addEvents(mc){
mc.onEnterFrame = function() {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/6; //modify easing out speed here
this._y = Ysquare+Ymove;
}
sb.onMouseDown = function() {
startDrag(this, false, this._x, top, this._x, bottom);
scrolling = true;
}
sb.onMouseUp = function() {
stopDrag();
scrolling = false;
}
sb.onEnterFrame = function() {
if (scrolling) {
updateScrollbar(mc, mask);
done = false;
} else if (!done) {
done = true;
}
}
}
function updateScrollbar(mc, mask) {
Ypos = -(((sb._y-top)/diff_y)*(mc._height-mask._height));
}
function scrollIt(mc, mask, offset) {
addScrollElements(mask, offset);
addEvents(mc);
}
------------------------
Thank you!
Pixel Font Easing Scroller?
Last edited by bambi : 2004-02-16 at 21:27.
Can anyone give me a hand with this script. I'm looking to use an easing scroller with a pixel font. I would like to know how to get the text to always snap to a rounded number so that the font will be clear on the stop drag. It seems to work for the first half of the scroller but not for the second half.
here is the scroller-easing scroller
the code-
ActionScript Code:
targY = 0;
dragger._x = theMask._width;
dragger.onPress = function() {
startDrag(this, false, this._x, 0, this._x, theMask._height-this._height);
};
dragger.onRelease = dragger.onReleaseOutside=function () {
stopDrag();
};
theText.setMask(theMask);
theText.onEnterFrame = function() {
scrollAmount = Math.round((this._height-(theMask._height/1))/(theMask._height-dragger._height));
targY = -dragger._y*scrollAmount;
this._y -= (this._y-targY)/5;
};
Bitmap - Easing Scroller - Optimize QUESTIONS
1. I have an easing text scroller in my .swf. Everything works great except that the easing characteristic seems smooth on PC's but not on Macs. When I click and drag the scroller it stutters on a Mac. Not the text but the scroller. Is this a MX/Mac problem?
2. A red box which is the exact dimensions and location of the same text scroller I mentioned above appears wherever I go to in my test movie even though I inserted a blank keyframe in the text scroller layer so that the scroller wouldn't show up again. What have I done wrong?
3. I tried to create a motion tween with this text scroller. Starting from the right moving into the stage. There are two layers. The text field and the scroller_mc. I created a motion tween and had no errors or dotted tween line but the pieces still do not move into the stage. Why is this?
Thanks guys.
Text Scroller With Easing And Wheel Usability
Hello
Trawling through the many scroller / text box tutes out there, I have found a couple of good ones :
here
and here
but what i would love to read is a tutorial that offers both easing capability with the option of having the wheel move the text as well.
any guides out there for this ? (I will only be using static text)
DJ
Help To Add EASING To My Scroller Action Script[MX04]
Hi,
This is my first post here, Ok I'm working with my flash file which contains a scroller contained within a movieclip, I got the scroller from FlashDen, which was very helpful as I wasn't getting anywhere trying to use online tutorials. So scroller works great gets all of the html including images etc just want to polish off the motion a little with easing.
I have this code on a frame above the 'news' movieclip go inside there and we've got the dynamic text box instance name 'output' var: 'myfield' the code above the news movieclip goes as follows /
PHP Code:
//news codetextBox.html = true;var format = new TextField.StyleSheet();//path to the css filevar path = "style.css";var myVars:LoadVars = new LoadVars();// Define onData handler and load text to be displayed.myVars.onData = function(myStr:String):Void {if (myStr != undefined) {var quick = myStr;format.load(path);format.onLoad = function(loaded) {if (loaded) {_root.main.content.news.output.styleSheet = format;_root.main.content.news.output.text = myStr;} else {//throw an error if we cannot find the css file_root.main.content.news.output.text = "Error loading CSS file!";}};} else {trace("Unable to load text file.");}};function loadArticle() {myVars.load("news.htm");}v//load itloadArticle();news.output.embedFonts = true;
Inside here we've got dynamic text, thescroller movieclip which has the following code
PHP Code:
onClipEvent (enterFrame) { _root.targetfield = "myfield"; // if (this._parent.barColor != undefined) { this.mcScrollBar.setColor(this._parent.barColor); } if (this._parent.scrubColor != undefined) { this.mcDrag.setColor(this._parent.scrubColor); } if (this._parent.barHeight != undefined) { this.mcScrollBar._height = this._parent.barHeight; } // if (_parent[_root.targetfield].maxscroll<2) { _alpha = 0; _visible = false; } else { _alpha = 100; _visible = true; } // delete this.onEnterFrame();}
Then the draggermc of the scroller contains two frames first frame has a stop command above it then each frame with a different movieclip, first frame has mcScrub containing the following code
PHP Code:
onClipEvent (mouseDown) { if (this.hitTest(_root._xmouse, _root._ymouse, true)) { _parent.gotoAndStop(2); startDrag(this, false, 0, 0, 0, _parent._parent.mcScrollBar._height-_parent._parent.mcDrag._height-2); }}onClipEvent (mouseUp) { _parent.gotoAndStop(1); stopDrag();}
Frame 2 contains mcScrollPosition movieclip holding the following code //
PHP Code:
onClipEvent (mouseMove) { _parent._parent._parent[_root.targetfield].scroll = Math.round(_parent.mcScrub._y/((_parent._parent.mcScrollBar._height-_parent._parent.mcDrag._height-2)/_parent._parent._parent[_root.targetfield].maxscroll));}
If someone could edit this code slightly to allow easing that would help me out greately! I'm on quite a tight deadline too!!
How To Load Dynamic Text In Easing Scroller
hey guys, i downloaded one of the easing scrolls from the kirupa forum and i need some help on how to load dynamic text into the scrollbar. can anyone give me some ideas on how the script would be modified. i tried to modify the xml with the scroll but by screen turns black and the text/scrollbar don’t work. appreaciate any help. i attached the file here what i downloaded.
Code:
//THIS IS IN THE ROLAGEM AS FILE
import mx.utils.Delegate;
class Rolagem {
// VARIABLES
// ---
// MCs to be used
private var btnUp:MovieClip;
private var btnDown:MovieClip;
private var dragger:MovieClip;
private var scrollbg:MovieClip;
private var contentMain:MovieClip;
private var contentMask:MovieClip;
// Settings variables
private var moveSpeed:Number = 1;
private var easingSpeed:Number = 7;
private var scrollWheelSpeed:Number = 20;
// General use variables
private var mouseListener:Object;
private var left:Number;
private var top:Number;
private var right:Number;
private var bottom:Number;
private var scrollable:Number;
private var initContentPos:Number;
private var scrollHeight:Number;
private var easing:Number;
// CONSTRUCTOR
// ---
public function Rolagem(easing:Number, btnUp:MovieClip, btnDown:MovieClip, dragger:MovieClip, scrollbg:MovieClip, contentMain:MovieClip, contentMask:MovieClip) {
this.btnUp = btnUp;
this.btnDown = btnDown;
this.dragger = dragger;
this.scrollbg = scrollbg;
this.contentMain = contentMain;
this.contentMask = contentMask;
this.easing = easing;
this.scrollHeight = this.scrollbg._height;
// how much of the movie can be scrolled
this.scrollable = this.contentMain._height - this.contentMask._height;
this.initContentPos = this.contentMain._y;
// the drag positions that are possible for the dragger
this.left = this.scrollbg._x;
this.top = this.scrollbg._y;
this.right = this.scrollbg._x;
this.bottom = this.scrollbg._height - this.dragger._height + this.scrollbg._y;
this.contentMain.setMask(this.contentMask);
// before we do anything make sure the content is even scrollable, if it isn't hide everything and return
if (this.scrollable < 0) {
this.dragger._visible = false;
this.btnUp.enabled = false;
this.btnUp._alpha = 50;
this.btnDown._alpha = 50;
this.scrollbg._alpha = 50;
this.btnDown.enabled = false;
return;
}
this.scrollbg.useHandCursor = this.dragger.useHandCursor = false;
this.scrollbg.onPress = Delegate.create(this, scrollPress);
this.dragger.onPress = Delegate.create(this, dragPress);
this.dragger.onMouseUp = Delegate.create(this, dragMouseUp);
this.btnUp.onPress = Delegate.create(this, btnUpPress);
this.btnUp.onDragOut =
this.btnUp.onRelease = Delegate.create(this, btnUpDeleteEnterFrame); //Delegate.create(this, btnUpDragOut);
this.btnDown.onPress = Delegate.create(this, btnDownPress);
this.btnDown.onDragOut =
this.btnDown.onRelease = Delegate.create(this, btnDownDeleteEnterFrame); //Delegate.create(this, btnDownDragOut);
this.contentMain.onEnterFrame = Delegate.create(this, contentEnterFrame);
// Registering the listener
this.mouseListener = new Object();
Mouse.addListener(this.mouseListener);
this.mouseListener.onMouseWheel = Delegate.create(this, mouseWheel);
updateContentPos();
}
// onEnterFrame of the content
private function contentEnterFrame():Void {
if (!this.easing || this.easing == undefined) {
this.contentMain._y = this.contentMain.newY;
} else {
this.contentMain._y += Math.round((this.contentMain.newY - this.contentMain._y) / this.easingSpeed);
}
}
// Updates the contents position
private function updateContentPos():Void {
var percent_scrolled:Number = (this.dragger._y - this.top) / (this.scrollHeight - this.dragger._height);
// instead of setting the _y property directly, we simple set newY
// that way we can adjust how we handle the new Y coordinate we'd like to move to
this.contentMain.newY = Math.round(this.initContentPos - (percent_scrolled * this.scrollable));
}
// Dragger actions
private function dragPress():Void {
startDrag(this.dragger, false, this.left, this.top, this.right, this.bottom);
this.dragger.onMouseMove = Delegate.create(this, dragMouseMove);
}
private function dragMouseMove():Void {
updateContentPos();
updateAfterEvent();
}
private function dragMouseUp():Void {
this.dragger.stopDrag();
delete this.dragger.onMouseMove;
}
// Background of the Dragger actions
private function scrollPress():Void {
if (this.scrollbg._parent._ymouse > this.scrollbg._y + this.scrollbg._height - this.dragger._height) {
this.dragger._y = this.scrollbg._parent._ymouse;
this.dragger._y = this.scrollbg._y + this.scrollbg._height - this.dragger._height;
} else {
this.dragger._y = this.scrollbg._parent._ymouse;
}
updateContentPos();
}
// Up Arrow actions
private function btnUpPress():Void {
this.btnUp.onEnterFrame = Delegate.create(this, btnUpEnterFrame);
}
private function btnUpEnterFrame():Void {
this.dragger._y = Math.max(this.top, this.dragger._y - this.moveSpeed);
updateContentPos();
}
private function btnUpDeleteEnterFrame():Void {
delete this.btnUp.onEnterFrame;
}
// Down Arrow actions
private function btnDownPress():Void {
this.btnDown.onEnterFrame = Delegate.create(this, btnDownEnterFrame);
}
private function btnDownEnterFrame():Void {
this.dragger._y = Math.min(this.bottom, this.dragger._y + this.moveSpeed);
updateContentPos();
}
private function btnDownDeleteEnterFrame():Void {
delete this.btnDown.onEnterFrame;
}
// Mouse Wheel
private function mouseWheel(delta:Number):Void {
var d:Number;
if (delta > 1)
delta = 1;
if (delta < -1)
delta = -1;
d = -delta * this.scrollWheelSpeed;
trace(d);
if (d > 0)
this.dragger._y = Math.min(this.bottom, this.dragger._y + d);
if (d < 0)
this.dragger._y = Math.max(this.top, this.dragger._y + d);
updateContentPos();
}
}
Code:
//THIS IS IN THE FLA FILE
var rolagem:Rolagem = new Rolagem(10, mc_sobe, mc_desce, mc_rolagem, bg_rolagem, mc_conteudo, mc_mascara);
Interactive Movie Clip Scroller W/Easing
Hi guys,
Recently I've been developing a new site that runs 100% with noScale. What I'm aiming to achieve is the ability for the user to move their mouse up and down on the Y Axis to effectively scroll the site. (Without having to click)
I've tried adapting the Interactive Image Panner Actionscript from the Tutorial on kirupa - but it doesn't seem to be working quite right I've changed all the X Values to Y.
Code:
stop();
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _ymouse/Stage.height;
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destY = Math.round(-((target._height-Stage.height)*mSpeed));
target.onEnterFrame = function() {
if (target._y == target.destY) {
delete target.onEnterFrame;
} else if (target._y>target.destY) {
target._y -= Math.ceil((target._y-target.destY)*(speed/150));
} else if (target._y<target.destY) {
target._y += Math.ceil((target.destY-target._y)*(speed/150));
}
};
}
The zip containing the fla and html files are located here - http://www.archeradvertising.co.uk/kirupa/Archive.zip
If anyone can help I'd really appreciate it.
Cheers
David
Blurry Pixel Font In Easing Scroller
I'm using pixel fonts for my text area which scrolls vertically. At the start the pixel font looks fine but as I scroll and stop the drag my fonts go blurry. Anything I'm doing wrong.
Easing Scroller Dynamically Loading Text And Pics
I've seen how to load only text into a text scroller dynamically, and I've also seen Claudios version of an easing scroller with text and graphics yet it doesn't load externally.
Any way to make a scroller that'll load text and graphics with easing externally? Like using xml or something. Anyone know of any examples around? I'd just like to have a scroller that I could update regularly with text and graphics without having to go into flash all the time.
Loading Dynamic Text In Easing Scroller - Problem
sorry for the double post, i posted the message in the wrong section ... QUESTION: i downloaded one of the easing scrolls from the kirupa forum and i need some help on how to load dynamic text into the scrollbar. can anyone give me some ideas on how the script would be modified. i tried to modify the xml with the scroll but by screen turns black and the text/scrollbar don’t work. appreaciate any help. I attached the file here what i downloaded.
Code:
THIS CODE IS IN THE AS FILE
import mx.utils.Delegate;
class Rolagem {
// VARIABLES
// ---
// MCs to be used
private var btnUp:MovieClip;
private var btnDown:MovieClip;
private var dragger:MovieClip;
private var scrollbg:MovieClip;
private var contentMain:MovieClip;
private var contentMask:MovieClip;
// Settings variables
private var moveSpeed:Number = 1;
private var easingSpeed:Number = 7;
private var scrollWheelSpeed:Number = 20;
// General use variables
private var mouseListener:Object;
private var left:Number;
private var top:Number;
private var right:Number;
private var bottom:Number;
private var scrollable:Number;
private var initContentPos:Number;
private var scrollHeight:Number;
private var easing:Number;
// CONSTRUCTOR
// ---
public function Rolagem(easing:Number, btnUp:MovieClip, btnDown:MovieClip, dragger:MovieClip, scrollbg:MovieClip, contentMain:MovieClip, contentMask:MovieClip) {
this.btnUp = btnUp;
this.btnDown = btnDown;
this.dragger = dragger;
this.scrollbg = scrollbg;
this.contentMain = contentMain;
this.contentMask = contentMask;
this.easing = easing;
this.scrollHeight = this.scrollbg._height;
// how much of the movie can be scrolled
this.scrollable = this.contentMain._height - this.contentMask._height;
this.initContentPos = this.contentMain._y;
// the drag positions that are possible for the dragger
this.left = this.scrollbg._x;
this.top = this.scrollbg._y;
this.right = this.scrollbg._x;
this.bottom = this.scrollbg._height - this.dragger._height + this.scrollbg._y;
this.contentMain.setMask(this.contentMask);
// before we do anything make sure the content is even scrollable, if it isn't hide everything and return
if (this.scrollable < 0) {
this.dragger._visible = false;
this.btnUp.enabled = false;
this.btnUp._alpha = 50;
this.btnDown._alpha = 50;
this.scrollbg._alpha = 50;
this.btnDown.enabled = false;
return;
}
this.scrollbg.useHandCursor = this.dragger.useHandCursor = false;
this.scrollbg.onPress = Delegate.create(this, scrollPress);
this.dragger.onPress = Delegate.create(this, dragPress);
this.dragger.onMouseUp = Delegate.create(this, dragMouseUp);
this.btnUp.onPress = Delegate.create(this, btnUpPress);
this.btnUp.onDragOut =
this.btnUp.onRelease = Delegate.create(this, btnUpDeleteEnterFrame); //Delegate.create(this, btnUpDragOut);
this.btnDown.onPress = Delegate.create(this, btnDownPress);
this.btnDown.onDragOut =
this.btnDown.onRelease = Delegate.create(this, btnDownDeleteEnterFrame); //Delegate.create(this, btnDownDragOut);
this.contentMain.onEnterFrame = Delegate.create(this, contentEnterFrame);
// Registering the listener
this.mouseListener = new Object();
Mouse.addListener(this.mouseListener);
this.mouseListener.onMouseWheel = Delegate.create(this, mouseWheel);
updateContentPos();
}
// onEnterFrame of the content
private function contentEnterFrame():Void {
if (!this.easing || this.easing == undefined) {
this.contentMain._y = this.contentMain.newY;
} else {
this.contentMain._y += Math.round((this.contentMain.newY - this.contentMain._y) / this.easingSpeed);
}
}
// Updates the contents position
private function updateContentPos():Void {
var percent_scrolled:Number = (this.dragger._y - this.top) / (this.scrollHeight - this.dragger._height);
// instead of setting the _y property directly, we simple set newY
// that way we can adjust how we handle the new Y coordinate we'd like to move to
this.contentMain.newY = Math.round(this.initContentPos - (percent_scrolled * this.scrollable));
}
// Dragger actions
private function dragPress():Void {
startDrag(this.dragger, false, this.left, this.top, this.right, this.bottom);
this.dragger.onMouseMove = Delegate.create(this, dragMouseMove);
}
private function dragMouseMove():Void {
updateContentPos();
updateAfterEvent();
}
private function dragMouseUp():Void {
this.dragger.stopDrag();
delete this.dragger.onMouseMove;
}
// Background of the Dragger actions
private function scrollPress():Void {
if (this.scrollbg._parent._ymouse > this.scrollbg._y + this.scrollbg._height - this.dragger._height) {
this.dragger._y = this.scrollbg._parent._ymouse;
this.dragger._y = this.scrollbg._y + this.scrollbg._height - this.dragger._height;
} else {
this.dragger._y = this.scrollbg._parent._ymouse;
}
updateContentPos();
}
// Up Arrow actions
private function btnUpPress():Void {
this.btnUp.onEnterFrame = Delegate.create(this, btnUpEnterFrame);
}
private function btnUpEnterFrame():Void {
this.dragger._y = Math.max(this.top, this.dragger._y - this.moveSpeed);
updateContentPos();
}
private function btnUpDeleteEnterFrame():Void {
delete this.btnUp.onEnterFrame;
}
// Down Arrow actions
private function btnDownPress():Void {
this.btnDown.onEnterFrame = Delegate.create(this, btnDownEnterFrame);
}
private function btnDownEnterFrame():Void {
this.dragger._y = Math.min(this.bottom, this.dragger._y + this.moveSpeed);
updateContentPos();
}
private function btnDownDeleteEnterFrame():Void {
delete this.btnDown.onEnterFrame;
}
// Mouse Wheel
private function mouseWheel(delta:Number):Void {
var d:Number;
if (delta > 1)
delta = 1;
if (delta < -1)
delta = -1;
d = -delta * this.scrollWheelSpeed;
trace(d);
if (d > 0)
this.dragger._y = Math.min(this.bottom, this.dragger._y + d);
if (d < 0)
this.dragger._y = Math.max(this.top, this.dragger._y + d);
updateContentPos();
}
}
Code:
THIS CODE IS IN THE FLA
var rolagem:Rolagem = new Rolagem(10, mc_sobe, mc_desce, mc_rolagem, bg_rolagem, mc_conteudo, mc_mascara);
Making A "fixed" Bg In Scroller Pane...
Hi I need some help ive attached my file thats complete except one thing. If you watch the movie you ll see that my scroll pane works fine. The only problem is that i want the bg of the clouds to reamain in one place while the text rolls over it. Thanks for any help you can give
Height Of DisplayObject Doesn't Equal Sum Height Of Child Objects
Ok, I create a new object like so:
ActionScript Code:
_container = _target.addChild(new Sprite()) as Sprite;
I then run a loop to add children to it, then do this:
ActionScript Code:
var lastChild:DisplayObject = _container.getChildAt(_container.numChildren-1);
trace("container height: " + _container.height);
trace("lastChild: y=" + lastChild.y + " height=" + lastChild.height);
And I get the following output:
container height: 237.5
lastChild: y=200 height=50
Now, the child is top-left aligned, so if it's at y 200 and has a height of 50, surely the height of the container must be at least 250. So why does it say 237.5? Can anyone offer an explanation?
|