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.
FlashKit > Flash Help > Flash MX
Posted on: 06-06-2003, 08:58 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Optimize Flash File Size - With Bitmap Images?
I see this fantastic photosites, photographers online portfolio - using flash and large bitmap-photos - but how do you manage to keep the flash file size so low? Any tips on that?
Thanks again ;D
coala
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!
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
Bitmap Questions
does dispose(); release memory for external bitmaps (mypic.jpg) that have been loaded with loadMovie ? If not how do i make a bitmap that was loaded with loadMovie imediately availiable for garbage collection?
Bitmap Questions
how do i save a bitmap that is created using bitmap.draw(); function to the local hard drive?I'd like to save the file as myPic.jpg on the desktop.
Bitmap Questions
Hey,
Im trying to make a simple tileset system just as a prototype, however im a bit puzzled with some things...
A) Ive read that bitmaps are like wrappers for bitmapdata so you can display it on the screen.
Now ive got a class that contains an array of the tiles as Bitmaps, however i dont know how im supposed to draw the bitmaps to the screen. I only ever see examples showing addChild(tile[0]); although in classes addChild wont compile, and its not part of the direct scene anyway, is there any direct rendering to screen functions with bitmaps... like render(x,y) or anything, so i can completely seperate the logic and the scene.
B) Ive read that bitmaps are better for storing small pixel animations as it can run at an independant speed to the actual scene and are small memory wise, is this worthwhile advice?
C) Is there any decent flash IRC or chat rooms where you can talk to other AS developers? its a pain when i have small problems having to scour the net for hours to find a tiny bit of obscure information that tells me what i need to know
I will admit that im not that experienced with AS, i have lots of other programming experience, so when i hit small problems it would be nice if i could just ask someone who knows their stuff... "hey can you do XXX in AS?"
Cheers for any help!
Easing / Tweening Questions...
I would like to replicate a few effects I have seen and can't quite get them without hand-making them. I've been trying since before I found this site, and it may simply be a job that has to be done manually, but I would much prefer to script it or find some helpful plugin to do it!
First is an elastic box, where the center portions of the box are more elastic than the corners. The first example I saw of this was a templatemonster template, http://www.templatemonster.com/flash...ates/9728.html - in the opening animation the box expands from the loading bar to the picture frame. In the process, it has the elastic effect I would like to replicate.
Second is another effect I saw on template monster, a delayed/ghosted size tween. As the image scales up and slightly to the side, it has a ghost or two behind it which only show select frames, not the entire tween. The one I saw was http://www.templatemonster.com/flash...ates/7008.html.
As I mentioned, I *can* replicate both effects manually, and have done so - I would like to find out if there is a way to do either (or both) with actionscript instead of a frame by frame manual animation. Or, alternately, a plugin which can make that frame by frame for me.
Thanks!
[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 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
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 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
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;
};
Blurry Bitmap Font In Scroller?...
http://www.josimar.com (see the news thing on the left)
At first it appears sharp, then if you scroll the dragbar all the way to the bottom, it sits slightly blurry.
It's not a sizing problem or a 'sitting on a pixel' problem as far as I can see because I have reset all the relevant .mc sizes to x=100% y=100%, and they all sit on whole number co-ordinates, eg x=2.0, y=31.0.
Any advice?
thanks in advance,
spumker
Custom Scroller With Bitmap Text
Hi, I've tried searching but keep on getting the same strange error. My scripting know-how is extremely limited so please bare with me.
I've created a custom text scroller and the scrolling text is bitmap text. The problem i'm having is that I need to have the scroller scroll in full pixel increments because the text ends up blurring if the clip doesn't end up on a whole number. Essentially what I need is: if text scrolls 0-0.5, text scrolls 0. if text scrolls 0.5-0.99, text scrolls 1 (I need it to round off to a whole pixel.).
Here's my script:
var scrollUpper:Number = 0;
var scrollLower:Number = 532;
var textLower:Number = 0;
var textUpper:Number = -256;
var scrollRange:Number = scrollLower - scrollUpper;
var textRange:Number = textLower - textUpper;
function scroll() {
var moved:Number = scroller_mc._y - scrollUpper;
var pctMoved:Number = moved/scrollRange;
var textMove:Number = pctMoved*textRange;
textClip._y = textLower - textMove;
}
scroller_mc.onPress = function() {
this.startDrag(false,this._x,scrollUpper,this._x,scrollLower);
this.onMouseMove = scroll;
}
scroller_mc.onRelease = scroller_mc.onReleaseOutside = function() {
this.stopDrag();
this.onMouseMove = null;
Any help would be much appreciated. This is driving me insane.
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.
A Good Text Scroller For Bitmap Fonts?
Basically what the title says...I would like to use a good, maybe simple to configure, text scroller that I can use my pixel fonts with. I don't want to externally load a text file, which I know is good, but the ones i have been using do not work well with pixel font because only a small fraction of the time are the fonts crystal clear. I would also like to have a bit of inertia in the scroller if its possible, but it's not essential.
I have looked all throught the movies section for something like this but to no avail.
Does anyone know of where a scroller like this can be downloaded or the scripts I would use for such a scroller?
Thanks you
Basic Questions Regarding Trace Bitmap
Hello. This is a novice question so please be patient (i already checked the tutes on this site)
i am trying to do a trace on a photo, i want to empty the color of a person in the photo and fill the white space with color using a tween, like kind of "filling up" the persons shape. then i would like to replace the colored space with the original persons image.
i have been told to do a trace. which i did, but that took ages. my real problem was, once i have emptied the image of color, how do i return the overall photo to a bitmap ?
im simply trying to master what is done on this site
http://www.nanand78.com
i have had people tell me today in such superior tones how "easy" this effect is, but they havent bothered to explain it.
if anyone has any tips for this i would really appreciate it thanks a lot.
-dj
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);
Scroller Questions, Please Help
Hi there,
I am trying to figure out how to make a scroller with animated buttons in it instead of text. The tutorials I've found seem to only be for text scrolling though. Is it the same type of deal that a text scroller uses or is it something different?
I would like the animated buttons in the scroller to open external swf's. Does anyone know off the top of their head any tutorials where I can see how this is done so I can teach myself?
Any help would be appreciated, thanks in advance.
P
Scroller Questions, Please Help
Hi there,
I am trying to figure out how to make a scroller with animated buttons in it instead of text. The tutorials I've found seem to only be for text scrolling though. Is it the same type of deal that a text scroller uses or is it something different?
I would like the animated buttons in the scroller to open external swf's. Does anyone know off the top of their head any tutorials where I can see how this is done so I can teach myself?
Any help would be appreciated, thanks in advance.
P
[F8] A Better Horizontal Scroller Questions...
Hey there,
I have been trying to work on the following flash script, posted here by ValueAmerica, I want to convert it to a scrolling top thumbnail area for an image gallery, but I can't seem to get the image size corret, apparently the AS is resizing the backgrounds or something, I have tried sample jpegs of 30, 100, 500 etc. and they are all stretched or gigantic, either way I can't figure it out after trying for a couple hours.
Here is the page with the .fla on it
http://www.flashkit.com/movies/Compo...0556/index.php
Any, any help regarding this simple script would be a huge help, as it's kicked my ass tonight --
cheers,
X
More Scroller Questions That Nobody Will Answer
I took the vertical scroller from the tutorial Kirupa posted, and then I tried to marry the horizontal scrollbar that Plonker sent me (Good lookin' out!) into the same SWF. The same problem ensued, one scrollbar works fine and the other shoots the mask way off to the side. What's with that? Are the scripts conflicting? Why doesn't Debugger address this? I even renamed the Bar, Dragger, Up_btn & Down_btn to Ba, Dragge, L_Btn and R_btn - in the script, in the library, and all instances... Does anyone have any feedback? Has anyone else ever run into this?
Continous Scroller Questions
I have a movie clip called scroller_mc which at present has 3 other movie clips with in it. My movie clip is scrolling across the stage, now here is what I would like to do. as the first image exit the stage reposition itself on the opposite side of the stage and dynamically load in another image. This would continue giving the illusion of a continous scrolling.(see attached)
I am looking for the best method to do this.
Any help greatly appreciated
|