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




[MX] Custom Scroller - External Source?



Hey everybody! Here's my question... I wanna design a custom scroller kinda like the on... http://www.driftlab.com/index2.html (right below the word welcome) I don't want to use the dull custom built in version MX provides cause lets face it, its ugly! and I'd like it to be linked to an external text document. I see this all over the place, so I'm pretty sure this is possible! If anyone could help out that would be great! Point me towards a tutorial or post an .fla with an example or something, I'd really appreciate it! I'm guessing a few other people may be interested too!

Thanks
Brad



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-25-2004, 05:16 PM


View Complete Forum Thread with Replies

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

[MX] Custom Scroller - External Source?
Hey everybody!

Here's my question... I wanna design a custom scroller kinda like the on... http://www.driftlab.com/ (right below the word welcome) I don't want to use the dull custom built in version MX provides cause lets face it, its ugly! and I'd like it to be linked to an external text document. I see this all over the place, so I'm pretty sure this is possible! If anyone could help out that would be great! Point me towards a tutorial or post an .fla with an example or something, I'd really appreciate it! I'm guessing a few other people may be interested too!

Thanks
Brad

[MX] Custom Scroller - External Source?
Hey everybody! Here's my question... I wanna design a custom scroller kinda like the on... http://www.driftlab.com/index2.html (right below the word welcome) I don't want to use the dull custom built in version MX provides cause lets face it, its ugly! and I'd like it to be linked to an external text document. I see this all over the place, so I'm pretty sure this is possible! If anyone could help out that would be great! Point me towards a tutorial or post an .fla with an example or something, I'd really appreciate it! I'm guessing a few other people may be interested too!

Thanks
Brad

Text Scroller Through External Source
This is my first time on a forum. I hope I'm doing this right. If not, please forgive me.

I'm relatively new to flash and the knowledge I do have is due to this site. I would like to make a special thanks to Kirupa for all the information that he is provided.

I'm trying to create a text scroller using an external text file into my flash project. I would like to be able to bold and underline the text in the source file. Such as <b>Hi Dan</b> the current tutorials that I've tried give the ability to bring plain text in. Is there something that can be added to those tutorials to give me the ability to bold, underline and create links?

External HTML Source For Text Scroller ?
Hiya,

I have been recreating the example of Kirupa's "Text Scroller with external Source".

It works very nucely.

I would like to know if I can extend this to take it's data from an external HTML source so I can add http links and email tags?

Can this be done?

Tanx

bmak

External HTML Source For Text Scroller ?
Hiya,

I have been recreating the example of Kirupa's "Text Scroller with external Source".

It works very nucely.

I would like to know if I can extend this to take it's data from an external HTML source so I can add http links and email tags?

Can this be done?

Tanx

bmak

Custom Scroller With External File
Yesterday i tried to made a custom scroller (got the tutorial from kirupa, flash8) I modified it by load the text from external file(.txt). I used dynamic text for that purpose. But i couldn't get the text._height variable correctly, since the text._height variable equal to the height of the dynamic text's box i have made before. So even the loaded text was longer than the box, the variable wouldn't change and the scroller didn't work correctly. Is there any way i could get the variable correctly? Sorry for my creepy english...

Problem Adding Custom Scroller Button On External Loaded Text (help)
Hello,
I have been following all the wonderful tutorials in this forum to learn about AS and flash.
This time I tried to combine 2 tutorials and make a text field with external loaded text and custom scroller button, but I failed.....

I tried to look for different tutorials to find the answer, but It didn't work out either...

So If anyone can spare a min to look at the file, please help !!!

Thanks
Getata
problem_scroller.zip

Help With Scroller Issue - Pics And Source Included
Hey,

I'm trying to make a fullscreen flash scroll bar and have been making some progress, in terms of adjusting a scrollbar to a fullscreen. Anyway, I've hit a bit of a stumble. In my function Stage.onResize I'm trying to make the scrollbar dragger a percentage of the amount of content which is shown on the screen as the picture below shows.

The problem is that when you scroll down for some reason the _y position of the scroller is creating a gap, which seems to become bigger the more you drag the scroller down (make sure you have the content displayed in a box like the picture, otherwise the scroller won't show because all the content is on screen.. like a scroller should do!).

So the red line is aligning to the scroll dragger's y position to show my point.

What I want to be able to do is when you drag the scroll dragger I want it to stop when you get to the bottom, at the moment it seems to be going to the bottom and beyond. I want it to stop when you get to the bottom of the content (all content shown on screen) like a normal html scroller.

It might be important to note that I have changed the registration points a little, as you'll see in the fla.

Any help on this would be greatly appreciated.

Here are a couple of pictures to illustrate the problems and source files and code.










Code:
//import for mac scrollwheel operation
import com.pixelbreaker.ui.MouseWheel;

stop();
//Align at top left?
Stage.align = "TL";
Stage.scaleMode = "noScale";
// Padding between top of stage and content **MAKE THIS A PERCENTAGE**
var contentPadding = 30;
//Set the position of the content in the middle of the screen upon movie load
content_mc._x = Stage.width/2;
content_mc._y = contentPadding;
//Position the scroller to the right and to the height of the stage upon movie load
scroller_mc._x = Stage.width-scroller_mc._width/2;
scroller_mc._y = 0;
scroller_mc._height = Stage.height;
// y position on top of the content box
var topContentBox = content_mc._y;
//Create new listener object to listen to stage resize
var stageResizeListener:Object = new Object();
//Everytime the stage is resized...
stageResizeListener.onResize = function() {

// Amount of content in pixels displayed on screen
var contentOnScreen = Stage.height-topContentBox;
// Percentage of content shown on screen
var pctContentOnScreen = contentOnScreen/content_mc._height;
//Position the scroller to the right and to the height of the stage
scroller_mc._x = Stage.width-scroller_mc._width/2;
//scroller_mc._y = Stage.height/2
//Set the position of the content in the middle of the screen
content_mc._x = Stage.width/2;
//scroller_mc.scrollerBar_mc._height = Stage.height;
scroller_mc.scrollerBar_mc._height = Stage.height;
//trace(Stage.height);
scroller_mc.scrollerDragger_mc._y = 0;
if (pctContentOnScreen<1) {
scroller_mc.scrollerDragger_mc.enabled = true;
scroller_mc.scrollerDragger_mc._visible = true;
scroller_mc.scrollerDragger_mc._height = pctContentOnScreen*(Stage.height-100)/2;
scroller_mc.scrollerDragger_mc._y = 0;
} else {
scroller_mc.scrollerDragger_mc.enabled = false;
scroller_mc.scrollerDragger_mc._visible = false;
}
//pctDraggerOnScreen = scroller_mc.scrollerDragger_mc._height / Stage.height;
//trace(pctDraggerOnScreen);
//this.scroller_mc.scrollerDragger_mc._y = topContentBox;
};

//create a listener for when the stage is altered
Stage.addListener(stageResizeListener);
scroller_mc.scrollerDragger_mc.onPress = function() {
//**WORKING ON THIS!!**//
this.startDrag(false,this._x,0,this._x,scroller_mc.scrollerDragger_mc._height+Stage.height);
};


scroller_mc.scrollerDragger_mc.onRelease = scroller_mc.scrollerDragger_mc.onReleaseOutside=function () {
this.stopDrag();
};

onEnterFrame = function () {
holder_mc._y = scroller_mc.scrollerDragger_mc._y;
};

Custom Scroller?
Im just curious how to create a nice clean (small) custom scroller, preferrably with inertia, here is an example of a really nice one, but without inertia http://www.adamskitchens.com/main.html please look in the OUR COMPANY link Ive tried a couple of tutorials but have been unsuccessfull, if any one knows how to create a scroller such as the one found on this link, with inerta if possible, could you please post a FLA, or expalin in detail how i go about creating one


thns in advance

sean

Custom Scroller
Hey...Ive been looking for a tutorial online to which goes through how to make a custom scroller - however most of them are about using the flash scrollbar and the others were very vague.

I want to produce a scrollbar similar to the one on the charlie and the chocolate factory site
http://pdl.warnerbros.com/wbmovies/c...ite/index.html
in the 'about dvd' section.

Does anyone know how I would be able to do this, it looks quite simple, however i cant find any tutorials relevant to this?

Thanks alot!

Help With Custom Scroller
I have a news section that is populated from an XML file. For each "story" node in the XML file I attach an instance from the library and position them vertically. I have a mask area so that only a few show and scroll bar to obviously scroll through them. Problem is that my scroll bar is only scrolling through a portion of them and not all of them. You can view the example here. Just click on the "Press" button at the bottom of the page. Below I've attached my source code. Any help with this would be awesome as I'm currently stumped.

code:
var pressXML:XML;
var rootNode:XMLNode;
var totalNodes:Number;

pressXML = new XML();
pressXML.ignoreWhite = true;
pressXML.onLoad = loadPress;
pressXML.load("data/press.xml");

function loadPress(success:Boolean) {
if (success) {
rootNode = this.firstChild;
totalNodes = rootNode.childNodes.length;
for (var i:Number = 0; i < totalNodes; i++) {
loadStory(i);
}
checkScroll();
} else {
trace("crap!");
}
}

function loadStory(_i:Number) {
var clipName:String = "story_" + _i + "_mc";
var clipY:Number = 130 * _i;
holder_mc.attachMovie("story_mc", clipName, _i);
holder_mc[clipName]._y = clipY;
holder_mc[clipName].header_txt.text = rootNode.childNodes[_i].attributes.header;
holder_mc[clipName].short_txt.text = rootNode.childNodes[_i].attributes.short;
holder_mc[clipName].pdf_btn.onRelease = function() {
getURL(rootNode.childNodes[_i].attributes.link, "_blank");
}
}

function checkScroll() {
holder_mc._y = 0;
dragger_mc._y = 0;

if (holder_mc._height > mask_mc._height){
_root.text_mc.dragger_mc.enabled = true;

var targY:Number = 0;

dragger_mc.onPress = function(){
startDrag(this, false, this._x, mask_mc._y, this._x, mask_mc._height - this._height);
}
dragger_mc.onRelease = dragger_mc.onReleaseOutside = function(){
stopDrag();
}

holder_mc.setMask(mask_mc);

holder_mc.onEnterFrame = function(){
scrollAmount = ((this._height - (mask_mc._height)) / (this._height - dragger_mc._height));
targY =- dragger_mc._y * scrollAmount;
this._y -= ((this._y - targY) / 3);
}
} else {
holder_mc._y = 0;
dragger_mc.enabled = false;
}
}

stop();

Custom Scroller?
I was wondering how to do those scrollers in textboxes that do not have the arrows, but just like a grey rectangle so to speak that you can drag along up or down.

If anyone has any ideas on how to do this, it would be greatly appreciated.

And by the way, how do you make the grey retangle not display the "hand" symbol on the mouse when rolling over it?

Thanks

Custom Scroller Help
I want to be able to load an external image into a scrolling text field and customize the look of it (up and down arrows, scroll bar, etc). Can anyone point me in the direction of where I may find one for use.

Many Thanks In Advance.

Custom Scroller
hi,

I'm new to flash and use mx 2004. My problem is i want to make a cusomised text / image scroller like in the link below.

http://www.kirupa.com/developer/flash8/scrollbar.htm

Trouble is its a flash 8 tutorial and i cant get the fla to open in my version of flash. I really like the design and its exactly what I want to produce.

Can some tell me how to make one in flash mx 2004 please.

Thanks.

Custom Scroller?
I was wondering how to do those scrollers in textboxes that do not have the arrows, but just like a grey rectangle so to speak that you can drag along up or down.

If anyone has any ideas on how to do this, it would be greatly appreciated.

And by the way, how do you make the grey retangle not display the "hand" symbol on the mouse when rolling over it?

Thanks

Custom Scroller Help
I want to be able to load an external image into a scrolling text field and customize the look of it (up and down arrows, scroll bar, etc). Can anyone point me in the direction of where I may find one for use.

Many Thanks In Advance.

Custom Scroller
this is probably beyond basic, but is there a good tutorial, either book or online, for making a custom scroller? something like the one driftlab uses in his news section. something like that and maybe also one with some enertia so that the text being scrolled rolls just a bit once you stop moving the scroller.

thanks for any help

Help For My Custom Scroller...it Works... Just Want It To Look Better
so I built a custom scroller but there is one problem with it... when the mouse button is pressed, you can move the bar up and down depending on direction of mouse movement(this is great) but, you can also move the mouse so quickly that the pointer is no longer over the scroller... this doesnt look very good... what I am asking is if anyone knows how to keep the pointer over my button when I am moving... at slow speeds it works... at high speeds the pointer just goes... I tried _root._ymouse = mybtn_btn._y; but it didnt work...

here is the code and an attached .fla (they do not have the dynamic main_txt field physically in them...I have also left out a lot of other things... just want to focus on the mouse pointer position over the button) thanks...also, I am new to flash so if there is a better way to code or my code is garbage feel free to tell me. thanks

s_btn.onPress = function () {
Mouse.addListener(s_btn);
trace("listener added");
};

s_btn.onMouseUp = function () {
Mouse.removeListener(s_btn);
trace("listener removed");
};

s_btn.onMouseMove = function () {
if(_root._ymouse > s_btn._y) {
s_btn._y += 2;
if (main_txt.scroll < main_txt.maxscroll) {
main_txt.scroll++;
}
trace("listener down drag");
}
else if(_root._ymouse < s_btn._y) {
s_btn._y -= 2;
if (main_txt.scroll > 1) {
main_txt.scroll--;
}
trace(" listener up drag");
}
};

[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

Custom Scroller Problem
Good day All,

I'm having some problems with my custom scroller script. I've created a custom scroller in Flash CS3 using Actionscript 3.0. I have the scroller and it's script on its own layer, the scoller and script would perfect. Script below:

const scrollUpper:int = 268;
const scrollLower:int = 580;
const scrollRange:int = scrollLower - scrollUpper;
var dragBounds:Rectangle = new Rectangle(scroller_mc.x, scrollUpper, 0, scrollRange);

var viewableHeight:int = 325;
var textUpper:int = text_mc.y;
var textLower:int = textUpper + text_mc.height;
var textRange:int = text_mc.height - viewableHeight;

scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN , startScrolling);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.addEventListener(Event.MOUSE_LEAVE, stopScrolling);
stage.addEventListener(Event.DEACTIVATE, stopScrolling);

function scroll(e:Event = null){
const pctMoved:Number = 1 - (dragBounds.bottom - scroller_mc.y) / dragBounds.height;
text_mc.y = textUpper - (pctMoved * textRange);
}

function startScrolling(event:MouseEvent):void{
addEventListener(Event.ENTER_FRAME, scroll);
scroller_mc.startDrag(true, dragBounds);
}

function stopScrolling(event:Event = null):void{
removeEventListener(Event.ENTER_FRAME, scroll);
scroller_mc.stopDrag();
}

The problem I'm having is when I'm on a different page which contains 2 buttons when the buttons are clicked I receive the following error message, can someone please help me understand why I'm getting the error message and how to remove the error. Below is the error message I'm receiving:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

Any help would be greatly appreciated.
Thanks a lot,
ALAN

ps. have yourself a wonderful July 1st & July 4th weekend

Custom Side Bar Scroller
Does anyone know how to make a custom text scroll bar or know of a good tutorial for one? I want create a scroll bar that looks like a slider that will match the theme of my website, however I'm not sure how to impliment the code.

Custom Scroller Problems
I'm having trouble with a custom scroller. I want it to go left to right and NOT up and down as it currently does. I thought I could just switch the x and y coordinates and letters and it would work but it still scrolls upand down. Thanks for any help.

stop();
var scrollLeft:Number = 107.5;
var scrollRight:Number = 666.8;

var imageLeft:Number = 23;
var imageRight:Number = -639;

var scrollRange:Number = scrollRight - scrollLeft;
var imageRange:Number = imageRight - imageLeft;

function scroll() {
var moved:Number = scroller._y - scrollLeft;
var pctMoved:Number = moved/scrollRange;
var imageMove:Number = pctMoved*imageRange;
images._y = imageRight - imageMove;
}

scroller.onPress = function() {
this.startDrag(false,this._x,scrollLeft,this._x,scrollRight);
this.onMouseMove = scroll;
}

scroller.onRelease = scroller.onReleaseOutside = function() {
this.stopDrag();
}

Custom Scroller Issues
I've just run into a snag with my scrolling window.

I followed this tutorial and got my own scroller to work. Then I placed a dynamic textfield in the content section. It loads an external news.txt file into the field. I have the font embedded. When I run the movie the text loads fine and the scrolling works.

My first problem is the text length. The news.txt file (currently just a bunch of random placeholder text) is rather lenghty. The problem is I can only make the dynamic textfield so long because once implemented in the website I'm making, the length of the news will vary. If the news is short on a particular day, there will be a bunch of blank space after the text but it will still scroll on the blank space. If the news is really long, the textfield isn't long enough to load all of it and it gets cut off. So I need the length of the textfield to change dynamically with the length of the content in the news.txt file.

The second problem is, I want to use HTML in my news text so I can use more formatting options. But when I enable "Render text as HTML" the text disappears. But the font is embedded so I have no idea why it does this.

- BOB!

Custom Scroller - Dynamic Text
Okay - I know that this has been asked several times and I apologize in advance for being a pest. About a week ago, Oldnewbie helped me out by providing an FLA file.

I still cannot get this thing to work. Is there anyone willing to have a peek and see what I am doing wrong?

Here are the specifics:

1. Please look at the "credentialscontentMC" movie clip. Here you will see what I am trying to do by using a custom made scroller where you can drag the heart shape down and see the text scroll.

2. The text does not even show up but the scroll bar does. I want the text to fade in when the user clicks on "Credentials" which is located in the drop down menu under "About Us."

3. Pleae note that this client was very adamant about using the horrific font - against my suggestion not to use it. I think it look ridiculous and is hard to read. But Whatever! I am so over it at this point.

4. I have only done About Us and Services as far as the drop down menu and content goes.

As always, any help is greatly appreciated!!

Denise

Custom Scroller Using Flash MX 2004
I don't really have any idea what I'm doing as I have adapted this (or at least tried) from a flash tutorial I found here on flash kit that was created using flash 5.

Anyway I'm doing something seriously wrong this much is clear.

Well the long and the short of it is I have created this custom scrollbar which isn't scrolling like it should. I have a big deadline soon and am feeling very behind and WAY out of my depth!

I'm still using MX 2004 (would flash 8 be any better?)
Can anyboy recommend any good flash tutorial programs that are video based (and cheap!) as I obviously need to improve my basic knowledge!

Thanks for looking

Please help me!

Very desperate.

Custom Scroller Script Problem
Good day all,

I've created a custom scroller which works perfect however I have a small problem. When the user uses the scroll bar, they can only scroll and see half of the text. The scrolling continues but doesn't show the rest of the text, can anyone explain to me why this is.

The position of my text box is x: 420 y:2084 with a height of 3155

Below is my script:

const scrollUpperbase:int = 240;
const scrollLowerbase:int = 605;
const scrollRangebase:int = scrollLowerbase - scrollUpperbase;
var dragBoundsbase:Rectangle = new Rectangle(basescroller_mc.x, scrollUpperbase, 0, scrollRangebase);

var viewableHeightbase:int = 400;
var textUpperbase:int = basetext_mc.y;
var textLowerbase:int = textUpperbase + basetext_mc.height;
var textRangebase:int = basetext_mc.height - viewableHeightbase;

basescroller_mc.addEventListener(MouseEvent.MOUSE_ DOWN, basestartScrolling);
stage.addEventListener(MouseEvent.MOUSE_UP, basestopScrolling);
stage.addEventListener(Event.MOUSE_LEAVE, basestopScrolling);
stage.addEventListener(Event.DEACTIVATE, basestopScrolling);

function scrollbase(e:Event = null){
const pctMovedbase:Number = 1 - (dragBoundsbase.bottom - basescroller_mc.y) / dragBoundsbase.height;
basetext_mc.y = textUpperbase - (pctMovedbase * textRangebase);
}

function basestartScrolling(event:MouseEvent):void{
addEventListener(Event.ENTER_FRAME, scrollbase);
basescroller_mc.startDrag(true, dragBoundsbase);
}

function basestopScrolling(event:Event = null):void{
removeEventListener(Event.ENTER_FRAME, scrollbase);
basescroller_mc.stopDrag();
}

Your help would be greatly appreciated.

Thanks,
Alan

Custom Text Scroller (bug & Revision)
Hi all.

I finally made a scroller. Except one feature, it works fine like the UIScrollBar component. That one feature is what happens when you press onto the "passive" area where scroll bar moves. Anyway...

Two bugs I could find:

1. In removing the up and down buttons located over and under the scroll bar.. I don't know how and why I can't do that while in contrary I can remove the bar and the background of it.

2. In the flash player (standalone program) while unloading these buttons and the scroll bar, it seems to be taking an action that is actually located below the removing line in actions, that is, it modifies its size. Interestingly this does not happen in "test movie" mode of flash.

My script may not be either practical or economic, I know. I haven't checked any tutorials or files on the net, that's probably why. Any suggestion is more than welcome. I'll be glad to learn what you think.

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.

Using Pixel Font With Custom Scroller?
Hi Peeps,

Havent posted in a while here. Anyhoo, I paid money to use my damb "FFF Professional" Pixel Font and I'm stressing trying to get it working with a scroller I used. It works wen I preview it on my pc, but on others it doesnt work, and shows up as one of the main fonts. You know, Veranda, Times New Roman, Arial; one of those. Heres the Tutorial I used to do it:

http://www.actionscripts.org/tutoria...ox/index.shtml

Basically, The font ONLY shows up correctly on my pc, offline and when I upload it online. I figure that's, because I have the font installed. But it should still work for others right? What am I doing wrong? How do you use my paid for Pixel Font with a custom scroller. And Dont recommend me those damb $35 scrolling thingys, I've spent enough money already. There must be a way to do it without Spend Spend Spend.

Please if you can help me, asap please. Thanks guys

Kirupa Custom Scroller Help (set Content ._y)
http://www.kirupa.com/developer/flash8/scrollbar.htm

trying to move to a certain point in my content without actually usually the scrollFace or arrow buttons. I can move the content easily enough by just setting the _y position of the content MC, but figuring out the placement of the scrollFace is driving me nuts. Any suggestions?

Hoping for something like this:

Code:
function moveMyContent(ypos) {
contentMain._y = ypos;
scrollFace._y = ????
}

I'm sure it's something like ypos*(contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight) but I can't get it.

Custom Dynamic Text Scroller
Hello everyone,

I, may be asking for to much, but I need to create a custom scrollbar with easing capabilities, which loads dynamic text from an external file or files. it does not sound like much to ask, but i am just a designer and I am trying to break my way into site development. Can some one please help me with this issue.

No Dynamic Text In Custom Scroller?
Using this tutorial :
http://www.kirupa.com/developer/flash8/scrollbar3.htm

From what I have been working with, dynamic text field do not show up all, but dynamically loaded pictures and static text is showing up?

Anyone have a solution? I figure it has something to do with the masking, but I cant seem to
get it to work.

Regards.

Text Scroller W/ CSS Custom Links Help?
Hi All,
I have been following kirupa's great tutorials but I am just stumped at why I am unable to get my CSS to work with my links. I want to have a background on my links you know like a colored background on rollover (hover). My links are underlined but it ignores some of my CSS like the background on the hover link. Any suggestions?

However, here is what i want it to do.

1.) On rollover (hover) of a link it has a background color and it is underlined. The underline works just not the light background color.

2.) I want my headers to be bold.

Custom Text Scroller In Flash Mx
http://www.christopherlawrence.com/

anyone know how to make these type of text scrollers ??

Problem With Custom Ease Scroller Code...
Hi, I'm having trouble with my scroller code. The problem is that the drag button does not stay attached to the scrollbar track. The dragger floats around the page with the mouse....any info is greatly appreciated. Thanks! Here is the file...

[F8] Text Scroller W/ CSS Custom Fonts And Links - HELP PLEASE
Hi all,
So with the help of a ton of Flash tutorials I created a text scroller. And, the CSS works for a few things but not everything. I have seen CSS work well with text scrollers before so I know i am doing something miserablly wrong. Can someone please review my example and give me advice on how to fix my issue. I have managed to get my active links to work with the CSS.

However, here is what i want it to do.

1.) On rollover (hover) of a link it has a background color and it is underlined. The underline works just not the light background color.

2.) I want my headers to be bold.

Perhaps I am using the wrong approach ABSOLUTELY ANY SUGGESTIONS are welcome

Custom Scroller With Dynamically Loaded Text
Hi there,
I really can't find a tutorial for a custom vertical scroller with dynamically loaded text and/or images from xml. Do you know some? I really need this. Thank you in advance guys. Keep up the good work!

Movieclip Scroller With Custom Skin And Tween
Check the movie clip scroller which I developed,
www.lostinscript.com/Downloads.htm

Advantages:
1. Component skin can be easily changed from properties window.
2. User defined shapes can be used as scrollers.
3. Scroller rollOver indication for custom rollOver animations.
3. Different copys of same component can carry different scrollers.
4. 'Ease-In' tween option for scrolling content.
5. Scroller can be on right or left side of component.
6. Extra space can be given between clip and scroller
4. Scroller doesn't shrinks according to content length, so that user defined shapes

Thankyou,
Karthik CK

Custom Scroller With Dynamically Loaded Text
Hi there,
I really can't find a tutorial for a custom vertical scroller with dynamically loaded text and/or images from xml. Do you know some? I really need this. Thank you in advance guys. Keep up the good work!

Help With Custom Scroller With Externally Loaded Text File
Basically, my problem is that the dragger will not scroll all the way down and I have no clue how to fix it. It works well when there is a lot of text in the text file but when there isn't, the dragger does not behave as it should.

Here is my file so hopefully someone can help me out here.

Thanks a lot,
Prich...

Its done with mx 2004 btw

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

Closing .an Exe From An External Source
Hiya folks

I have a major headache thats had 2 and a half FULL days of research on it and I was wondering if any of you Flash folk out there could help me.

I have a Flash projector (a menu) that at a certain point, launches another Flash projector (the production).
The menu calls up an (MFC 32) app to launch a minimized .bat file which in turn launches a .vbs file, which compares a file on a CD with the currently running production. If the file on the CD is a newer version, then the .vbs file copies the new version over the old (currently running) production and launches it.....well thats the theory.

The problem is that though I can copy the new file over if the production is not running, if it is running then of course I have no permission to overwrite as the running file is locked. So I need to be able to shut down the runing projector file either from some external file OR from the menu projector file which always runs in the background.

Doeas ANYONE know of a way to shut down a currently running projector from another projector OR any other type of file ?

I would really appreciate ANY help you folk could give as this is a real stumbling block for my whole project.

Cheers folks

Akash

Loading A Url From An External Source
What I'm trying to do is have my url in an outside file (txt, xml) and have flash be able to open the browser and go to that web address without specying the url directly on the button. Making the url editable outside of flash.


Any one ever try this before or knows if its possible?

External Audio Source?
hey guys,
I've made a "audio player" for a site.
but i then realized..damn, Im gonna have to save a new swf file for every single audio this way!, (around 100 )
I think u can load an audio clip from an excternal souce right? instead of having to save 100 differnt swf's. eating up more bandwidth then I really need to use.

so far I have this
FIRST FRAME :

this.onEnterFrame = function () {
if (stopped!=true) {
myMusicDurationText=_root.myMusic.duration/1000;
myMusicPositionText=_root.myMusic.position/1000;
}
}


AND MY PLAY BUTTON

on (press) {
//Sound is not playing and has not been paused
if (playing!=true) {
if (paused!=true) {
playing=true;
paused=false;
stopped=false;
myConditionText="PLAYING";
myMusic.start();
//
} //closes paused!=true
//
//Sound has been paused
if (paused==true) {
playing=true;
paused=false;
stopped=false
myMusic.start(myMusicPosition,0);
myConditionText="Playing";
_root.myMusic.onSoundComplete = function() {
myMusic.start();
} //Closes function
} //Closes paused==true
//
//END
}//Closes playing!=true
//
}//Closes on press




I also have a pause button and stop,

can anyone help me get external .mp3 files to play in the swf, and what would I put in my normal html code if I were to do so.

..thank you

LoadMovie From External Source
I am creating a parent movie that will load several other swfs. I will be sending a marketing email with a link that needs to be able to go to the parent movie and load specific swfs based on which email the user received (ie. If user received email A, go to the parent movie and load swf A... if user received email B, go to the parent movie and load swf B). Is there a way to do this?

How Do I Call From External Source?
Im making a flash document and burning it on CD, when it plays I want to be able to click on a button to download images from the CD in a folder onto the desktop.

how do I make this happen anyone have any script?

LoadVars From An External Source
OK I've read a lot of tutorials about this and I'm still pretty confused and not entirely sure if LoadVars() is what I should use...

I have two .swf files, the first .swf file is the main web page that displays all the content, and the second .swf file is where the site administrator will update all the content on the first .swf file. There's no html or php involved, this is all done in Flash.

I'm trying to find a way to get the first .swf file to, before it loads completely, first load the variables from the second .swf file in case if there are any changes. All of the content in the first .swf file can be controlled and edited from the second .swf file.

I'm sure a lot of people are familiar with this already. Do I still have to use that .txt file with all the variables with the amperstands after them or is there an easier, quicker, more efficient way? Thanks! Any help is greatly appreciated!

External Source, Weather Help.
Ok bare with me whilst I confuse you loads!

I have my seasonal island which cleverly changes itself in time with the natural world, i.e. today the island looks like its the middle of autumn.

Now I'm trying to install a weather system. I currently have one, where I just randomly placed Rain and Snow movie clips at different days.
For example, on the 4th of september, there is a rain movie clip, that will play all day of the 4th, however this means every 4th of september there will be rain.

I was wandering if there was a way to reference to like a weather website, and create like a complicated if statement, so it only rains when the weather website says there will be rain...

does this make sense?
Does it sound aty all possible?


Thank you.

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