Custom Scrollbar For Dynamic Text Field
I know there are a million tuts out there but I can't find one about building my own custom scrollbar using images!
Anyone know how to do this?
Can the UI scrollbar images be replaced?
I'm trying to find a timely solution to this, since I need to do this all the time. I have a scrollTrack and dragBar that I want to use for my site, but I can't get the code to work properly with a dynamic text field, so I want to build it from scratch and finally learn how to do it without the UI components (if they can't be skinned)
Any Flash GURUs out there?
thanx~
Ultrashock Forums > Flash > Flash Professional
Posted on: 2005-05-14
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Text Box With Custom Scrollbar
Hi guys. I pretty much have no idea where to start on this one, even though ive looked through a bunch of tutorials...they all seem to conflict or not do exactly what i want. I have a dynamic text box, which i made a graphical shell for, that i want to be controlled by custom arrows and scrollbar i made. Ive included the fla so you can see what im working on. And help, manipulation of fla, or link to tutorial that can point me in the right direction would be greatly appreciated. Thanks in advance!!!
Jesse
Dynamic Text With Custom Scrollbar
Hi,
I am trying to adopt Lee Bremelow's OOP Scrollbar 2 to load external text. So far without luck. This tutorial uses three classes. In fla file there are movieclip scrollbox, inside of which are dynamic text field (txtField) and custom scrollbar ( consisting of two clips: thumb and track).
If I copy some text into text field, everything works. If load external text into text field, text is loaded but it doesn't scroll.
Below are codes from all classes:
Attach Code
//----------------------------------------------------------------------------------------------
package
{
import flash.events.*;
public class ScrollBarEvent extends Event
{
public static const VALUE_CHANGED = "valueChanged";
public var scrollPercent:Number;
public function ScrollBarEvent(sp:Number):void
{
super(VALUE_CHANGED);
scrollPercent = sp;
}
}
}
//-------------------------------------------------------------------------------------------------
package
{
import flash.display.*;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLLoaderDataFormat;
import caurina.transitions.*;
public class ScrollBox extends MovieClip
{
public function ScrollBox():void
{
sb.addEventListener(ScrollBarEvent.VALUE_CHANGED, sbChange);
//Loading external text----------------------------------------
var txtLoader = new URLLoader();
txtLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
txtLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void
{
txtField.htmlText = e.target.data.myBody
addChild(txtField);
}
txtLoader.load(new URLRequest("../Scripts/about.txt"));
//---------------------------------------------------------------------
}
private function sbChange(e:ScrollBarEvent):void
{
Tweener.addTween(txtField, {y:(-e.scrollPercent*(txtField.height-masker.height)),
time:1, transition:"easeOutBack"});
}
}
}
//------------------------------------------------------------------------------------------------------
package
{
import flash.display.*;
import flash.events.*;
public class ScrollBar extends MovieClip
{
private var yOffset:Number;
private var yMin:Number;
private var yMax:Number;
public function ScrollBar():void
{
this.addEventListener(Event.ADDED_TO_STAGE, added);
}
private function added(e:Event):void
{
yMin = 0;
yMax = track.height - thumb.height;
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
}
public function setPosition(percent:Number)
{
var newPos:Number = ((this.yMax) / 100) * percent;
thumb.y = newPos;
dispatchEvent(new ScrollBarEvent(-((thumb.y)/yMax)));
}
private function thumbDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
yOffset = mouseY - thumb.y;
}
private function thumbUp(e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbUp);
}
private function thumbMove(e:MouseEvent):void
{
thumb.y = mouseY - yOffset;
if(thumb.y <= yMin)
thumb.y = yMin;
if(thumb.y >= yMax)
thumb.y = yMax;
dispatchEvent(new ScrollBarEvent(thumb.y / yMax));
e.updateAfterEvent();
}
}
}
//--------------------------------------------------------------------------------------------
Edited: 12/18/2008 at 01:36:21 AM by igreck
Dynamic Text Custom Scrollbar Help
I'm trying to create a dynamic text box with a custom scrollbar. I tried tweaking the code from the kirupa tutorial for scrollbars here:
http://www.kirupa.com/developer/flash8/scrollbar.htm
Right now I have a textbox, scrolltrack, and a scrollbox with this code:
loadVariables("filltext.txt", this);
scrolling = function () {
var scrollht:Number = scrolltrack._height;
var boxht:Number = scrollbox._height;
var scrollarea:Number = scrollht-boxht;
var ms:Number = textfill.maxscroll;
var scale:Number = scrollarea/(ms-1);
var initpos:Number = scrollbox._y=_root.textbox.scrolltrack._y;
var left:Number = scrolltrack._x;
var top:Number = scrolltrack._y;
var right:Number = scrolltrack._x;
var bottom:Number = (scrolltrack._y+(scrollht-boxht));
var ymove:Number = 0;
scrollbox.onPress = function() {
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
ymove = Math.abs(initpos-this._y);
textfill.scroll = textfill.scroll+(Math.round((-(ymove))/scale));
};
scrollbox.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
};
if (ms==1) {
scrollbox._visible = false;
scrolltrack._visible = false;
} else {
scrollbox._visible = true;
scrolltrack._visible = true;
}
};
scrolling();
I'll also attach the .fla and .txt files. Please help. Thanks.
Custom Scrollbar For Dynamic Text.
I need to create a custom scrollbar for a dynamic text box that I am using. In Flash MX and earlier, there used to be the Flash UI Compnents folder in the Library and you could modify the individual parts of the Scrollbar. how is this done in MX 2004 or Flash 8? Or if anyone has a good tutorial for a custom text scroller. I have looked and can't find much for The newer versions of Flash.
Custom Scrollbar With Dynamic Text
I have a problem with global variables that declare _root.
I found some code on the internet for a custom scrollbar.
I used it in my .swf and it works fine, however, when my 'profile.swf' file is dynamically loaded into my main 'homepage.swf' file, it doesn't work.
I'm positive it is confused about _root since 'profile.swf' isn't the root anymore once it is loaded into my main 'homepage.swf' .
Here is a link to JUST the 'profile.swf' file:
http://www.intotheether.org/main_profile.html
* Click on the experience link in the middle to load the text files, and the scrollbar slides up and down fine.
Here is a link to the 'homepage.swf' file:
http://www.intotheether.org/index_flash.html
* Click on 'profile' once the whole main movie loads, and click on the experience link again, and the text loads, but DOES NOT Scroll
There is two main code snippets that allow the scrollbar to work.
I believe the part I need to modify is the part that reads:
ActionScript Code:
//declare a persistent reference to _root
_global.mainTL = this;
Here is the complete code that is in the main timeline of the 'profile.swf' file.
The code also has comments from the writer of the code to explain what each part is.
ActionScript Code:
/*
###################################################################################
Be sure to modify the name and path to your text field if you use this code in another
movie. My text field is at the _root level, named "myText_txt"
The instance of the scroll mechanism is named "scroller_mc" - make SURE you name the
instance, and that you make the necessary adjustments if you rename it.
Locate the scrollModule_mc movie clip in the Library and refer to additional code
in that timeline Note that you can modify the height and width of the track_mc and
thumb_mc to fit your text field. The code should accomodate so long as the instances
are named.
This demo .fla should be in a folder along with three text files named "longText",
"medText" and "smText". If they are missing, nothing will show up in the text field!
###################################################################################
*/
//declare a persistent reference to _root
_global.mainTL = this;
//boolean variable used to shut off dynamic thumb positioning if thumb is doing the scrolling;
//set initially to false. See the onScroller callback at bottom of page to observe how it's used
var usingThumb = false;
//start with scroll mechanism invisible
//it will appear only when necessary
scroller_mc._visible = false;
//create loadVars object
readText = new loadVars ();
/*define callback for when text loads
namely: fill the dynamic text field with the content of the external file
and initialize three things:
- be sure the text field starts at the first line (scroll = 0);
- be sure the scroll thumb is at the top of its track (_y = 0);
- modify the thumb's _yscale proportional to the quantity of text
*/
readText.onLoad = function () {
//declare contents of text field
myText_txt.html = true;
myText_txt.htmlText = this.myText;
//disable scroll mechanism if it's not needed
if (myText_txt.maxscroll < 2) {
scroller_mc._visible = false;
} else {
scroller_mc._visible = true;
}
//initialize text field's scroll property
myText_txt.scroll = 0;
//initialize scrollbar thumb's position
scroller_mc.thumb_mc._y = 0;
//set variable which is ratio of total text to what's visible
var percentVisible = (myText_txt._height / myText_txt.textHeight) * 100;
//use this variable to modify _yscale of scrollbar thumb
scroller_mc.thumb_mc._yscale = percentVisible;
};
/*for testing, define three different text files with different amounts of content
three buttons load the files to test response of scroll mechanism
you don't need this if you're not loading different text files into the textfield
*/
profile_b1.onRelease = function () {
readText.load ("profile_experience.txt");
};
profile_b2.onRelease = function () {
readText.load ("profile_inspiration.txt");
};
profile_b3.onRelease = function () {
readText.load ("profile_qanda.txt");
};
/*
onScroller is an event in Flash MX which is called when any property related to
scroll in the targeted textfield changes. I use it here to vary the _y property
of the scrollbar thumb based on the scroll property of the text field
*/
myText_txt.onScroller = function () {
//check to be sure scrolling is being done with arrows instead of the thumb
if (!usingThumb) {
//find the usable length of travel, which is the height of the track minus the height of the thumb
var trackLength = scroller_mc.track_mc._height - scroller_mc.thumb_mc._height;
//find where the textfield scroll is
var scrollPos = (this.scroll - 1) / (this.maxscroll - 1);
//finally, set _y property of thumb
scroller_mc.thumb_mc._y = trackLength * scrollPos;
}
};
Here is the code that is inside the 'scroller_mc' movie clip which is the scrollbar:
ActionScript Code:
//--------------------Arrow behaviors-------------------
upArrow_mc.onPress = function () {
this.onEnterFrame = function () {
mainTL.myText_txt.scroll -= 2;
};
};
upArrow_mc.onRelease = upArrow_mc.onReleaseOutside = upArrow_mc.onDragOut = function () {
delete this.onEnterFrame;
};
downArrow_mc.onPress = function () {
this.onEnterFrame = function () {
mainTL.myText_txt.scroll += 2;
};
};
downArrow_mc.onDragOut = downArrow_mc.onRelease = downArrow_mc.onReleaseOutside = function () {
delete this.onEnterFrame;
};
//--------------------Thumb behaviors-------------------
thumb_mc.onPress = function () {
//go to "on" frame
this.gotoAndStop(2);
//find the usable length of travel, which is the height of the track minus the height of the thumb
var travelLength = track_mc._height - this._height;
//make clip draggable
this.startDrag (false, 0, 0, 0, travelLength);
//scroll text in proportion to thumb position
//use onMouseMove so behavior is continuous; (thanks Cameron). Could also use onEnterFrame,
//however onMouseMove supportes the updateAfterEvent method which helps make motion smoother
this.onMouseMove = function () {
mainTL.usingThumb = true;//disable onScroller function
//find the fraction of thumb's current position to its total travel length
var whereIsThumb = (this._y / travelLength);
//multiply text field's maxscroll by this fraction
_root.myText_txt.scroll = (_root.myText_txt.maxscroll + 1) * whereIsThumb;
//make this behavior independent of movie's frame rate
updateAfterEvent();
};
};
//clear the enterFrame and restore usingThumb variable
thumb_mc.onRelease = function () {
//go to "off" frame
this.gotoAndStop(1);
stopDrag ();
delete this.onMouseMove;
mainTL.usingThumb = false;
};
If anyone has time to help me or point me in the right direction, would be very helpful
Thank you
Govinda
Scrolling Dynamic Text With Custom Scrollbar
I have created a custom scrollbar for some dynamic text ("services_txt") under a movieclip ("servicestext_mc" with the instance name services_mc). The name for the scroller is scroller_mc.
The scrollbar works fine, but it doesn't seem to want to connect to the text box. I keep getting error message 1120: Access of undefined property services_txt.
I've tried scrolling my text several ways and seem to keep getting this error - I have a feeling it's because I've inputted the text manually and forgot to do something, instead of using an external text loader.
Any help would be appreciated. Here is the code I've inputted:
var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = services_txt.y;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN , dragScroller);
function dragScroller(event:MouseEvent):void
{
var dragX:Number = line_mc.x - scroller_mc.width/2;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;
scroller_mc.startDrag(false, new Rectangle(dragX, dragY, dragW, dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
}
function stopDragging(event:MouseEvent):void
{
scroller_mc.stopDrag();
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
}
function setScrollPercent(event:Event):void
{
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
{
scrollPercent = 0;
}
else if(scrollPercent > 1)
{
scrollPercent = 1;
}
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
services_txt.y = targetScroll;
}
...And I've attached my .fla file with the faulty code disabled.
Thank you to anyone who can help me!!
Dynamic Text With Custom Scrollbar(Flash 7)
I've searched the forums up and down and I can't find anything to do this. I want to have an updates section on my site that has xml loaded news, but has a custom scroll bar for when more needs to fit. Can anyone point me in the right direction?
Basically I want the scrollbar text thing seen here:
http://www.kirupa.com/forum/showthread.php?t=27214
but have it dynamic through xml
Creating Custom Scrollbar's For Dynamic Text Boxes
Hi there,
I've just implemented the tutorial on this page:
http://www.smartwebby.com/Flash/text_scrollers.asp
This example is great because it allows two buttons to be used to scroll a dynamic text box. It doesn't use the technique which most of the other tutorials of this nature use, which is to use a mask and move the text box up and down. Basically it's the perfect example of what I need, apart from the fact that it doesn't include instructions for how to implement the actual 'bar' element of the scrollbar.
Is there a way to try and fit a scrolling feature into this tutorials' example without it getting too over-complicated? My ActionScript is very poor, and so any help I get with this is greatly appreciated.
Thanks,
Dave
ScrollBar And A Dynamic Text Field
Need some help with the following.
I'm using Flash MX on Windows Platform.
How do I make a ScrollBar work in a Dynamic Text Field where TEXT is being loaded using the LoadVar?
I created a txt document and then a dynamic text field and then I placed the loadvar in the frame and everything worked great.
I wanted to make it scrollable so I added the Scroll Bar component and gave my Dynamic text field an instance name and told the scroll bar what it was, but when I test the movie the scroll bar does not work, and there's plenty of text to scroll.
What else do I need to do to make it work?
Scrollbar With Dynamic Text Field?
I have a dynamic text field, multi-line. I have attached a scrollbar component to it via drag and drop.
It is empty but gets text dumped into it via AS's appendText() method when the user clicks a button.
It works, but if there are more lines than what fits into the text field, the scroll bar does not "activate", and allow the user to scroll to see all of it.
I'm sure I am missing something simple here, can anyone please help. Thanks.
Assigning A Scrollbar To A Dynamic Text Field
Ok, so I have a dynamic text field, it brings up the text document "test.txt" when the movie loads. I dragged the scrollbar component and it attached to the box. But it just sits there when I load the movie, I suppose I need some sort of actionscript assigning that scrollbar to that text box. How would I do that? Thanks.
Dynamic Text Field And Scrollbar Prob
got my dynamic text field going and reading a text file ok. Then I attach a scrollbar component to it and it all looks fine...
when I publish, I see my dynamic text, but it won't scroll and I know for a fact that it's way bigger than the window I have created.
anyone know why?
P.S. When I change it to input text and type stuff in it starts to scroll, but that's no good.
Thanks in advance. -j
Scrollbar Component + Dynamic Text Field
I have a dynamic text field, and a scrollbar component attached to it, for some reason the scrollbar does not recognise when there is text dynamically entered into and thus the scrollbar does not react.
Any ideas guys?
lee
Autohide Scrollbar On A Dynamic Text Field?
I'm loading some text into a dynamic text field from a database and have that working fine. The content will change at the whim of the client and what I'd like to do would be to have a scrollbar appear when it's neeed. ie- if there is a short bit of content then there would be no scrollbar, but if they enter in several paragraphs then the scrollbar should appear.
I'm looking for any ideas on how to go about this. I managed to use a textarea and have it work perfectly, but I can only get the content loaded into it when everything is in one swf file. In the final application of all this there will be a main.swf that will in turn load the content swf into another layer, when I do it that way the textarea stops talking to the databse for some reason... because of that I'd rather do it with a dynamic text field since I have that working with multiple layers and still connecting to the db properly.
Any suggestions about the autohide scrollbar for a dynamic text field are welcome.
Thanks in advance.
datter
Dynamic Text Field Scrollbar (not Component)
hello,
i would like to create a scrollbar for a dynamic textfield but do not want to use the common component.
i found this script:
http://www.flashdesignerzone.com/tutorials/t1033.php
it seems very easy, but don't manage to have it work ... and i don't understand how it manages the scrolling. it's only the 4 most essential lines i do not understand.
regards,
.d
Dynamic Text Field In My Custom Component Shows No Text In SWF
Flash MX 2004 on MAC platform (not professional version)
------------------------------------------------------------------------
Hi,
I created a custom component in Flash MX 2004, which has two custom text fields defined by variables and one link defined by a variable also (3 variables total).
When I publish my movie, one of the text fields in each instance of my component on the stage is always empty (the same one) ...does anyone have any idea why?
It doesn't make sense to me that i have it working for one text field and not for the other....I don't THINK that I am doing anything differently between them...?
I have uploaded my small FLA here:
http://www.lucid-life.com/my_component.fla.zip
Can anyone help?......
Thanks,
Cheska
Dynamic Text Field In My Custom Component Shows No Text In SWF
HI,
I created a custom component in Flash MX 2004, which has two custom text fields defined by variables and one link defined by a variable also (3 variables total).
When I publish my movie, one of the text fields in each instance of my component on the stage is always empty (the same one) ...does anyone have any idea why?
It doesn't make sense to me that i have it working for one text field and not for the other....I don't THINK that I am doing anything differently between them...?
I have uploaded my small FLA here:
http://www.lucid-life.com/my_component.fla.zip
thanks in advance of any help..
Cheska
Custom Dynamic Text Field .changing The BG Color?
i need to make a dynamic text box with a transparent BG....here is my code. also i would like any other code to help customize it..thanks!
Code:
loadText = new LoadVars();
loadText.load("http://www.akmphoto.net/images/example.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.exampletext;
};
Load .txt File Into A Dynamic Text Field With Scrollbar
Hi, i was wondering how to make a movieclip - loader
(onClipEvent(load)) load news.txt into a dynamic text field (var = rinfo) and make it scrollable.
Use scrollbar to scroll the text when loaded into the text box.
I have been trying for ages, but cant get it working.
Help Me :)
Martin
PS. if you could make me a .fla for me to download it would be helpful
Dynamic Text Field Scrollbar Using Variable Text
Hello there,
Has anyone beat this problem?
I have a txt file that I can successfully display through variables. I can successfully make a dynamic text field with a scrollbar. I CANNOT put a scrollbar on a dynamic text field that is pulling a varable from a txt file.
The text shows, but the scrollbar does not work (but is present).
I attached the files in a zip if anyone wants a look. Please let me know what you think.
Using A Scrollbar For A Dynamic Text Field And Having The Movie Load In The Browser T
Hi all,
I'm a newbie and have 2 questions.
1. How do I use an actial scrollbar (not scrolling text buttons) in a dynamic text field area? I know it's in the "UI components" under scrollpane in the action panel, but can't figure out how to use it!AND......
2.How do I publish my movie to fit each and every browser so you don't have scroll bars vertical and horizontaly? I've tried publsihing all 3 ways and pixels seems to be the best, but still there are those scrollbars! By the way the move is sized 800x600.
Thanks to who ever can help!
Fadaka
Custom Scrollbar W/Dynamic Txt Not Working.
Hello guys, and thanks for taking the time.
Well since I have found many tutorials about scrolling textboxes
but none of them provide all the features I need:
1.Dynamic text (sharp text not smooth anti-aliased)
2.Continuos Scroll buttons (not one scroll per click)
3.With scroll bar (not only scrollbuttons)
4.Ability to customize buttons and scrollbar with my own graphics
(I've tried the FlashMX Scrollbar component and I can't use an image
for the scrollbar without having it streched)
So... I've partially mixed 2 usefull tutorials from Flashkit and Actionscript.org
and I came with my own scrolling textbox BUT...the scrollbar
doesn't work properly:
a. Scrollbar does not move when clicking on the buttons.
b. Textbox does not increment or decrement the scroll according to the
proportional position of the scrollbar.
Can someone help....please ??
Here's the link to my scrollbox attempt, and on that page you can download
the FLA file if you wanna give it a shot:
http://www.zona-g.com/scroll_experiment.htm
Thanks !!
-Waltman
Load XML Into Dynamic Textfield With Custom Scrollbar
Found this great fla on the forum,
I've been trying to get this to work but my AS-skills are poor..
What I want is to load a new XML file with the press of a button into the dynamic textfield..
Greatful for any help!
zip with fla and xml attatched
Custom Scrollbar And External Text
when I test my movie my external text loads. if I scroll down any length with out retuning it to the top, and then click a button wich loads another external text file, you are not able to see the first few lines of the text file untill you click on the slider. the slider did not return to the untill I reset the sliders cordanites apon button click. is there a way I can reset the text field. any help will be greatly appreciated sincerely newwave
my code can be found in the sixth reply of this post
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=665&threadid=1413812&enterthread=y
Edited: 12/27/2008 at 08:28:35 PM by newwaveboats
Custom Scrollbar For Input Text
hi there!
i've build my one custom scrollbar... very nice... i think... but i've got some problems with scrolling input text. I cant really explain... see for yourself... please...
thanks!
Custom Scrollbar + External Text
I've serached the forums for an hour now and can't find out how to attach a custom built scrollbar to a dynamic text field that is loading external text. The tutorial of the dynamic scrollbar doesn't help me because its using the UI component. Anyone help? PLEASE!
How To Create A Custom TEXT Scrollbar.
Hey guys!
I have a dynamic text box that grabs text externally. No biggie, I even added a custom scroller to it. However I want to create more than a triangle at the top and bottom of the scroller. I'd like to create a custom scrollbar, so the user can click and drag the bar as well as hitting the arrows.
http://www.kirupa.com/developer/flash8/scrollbar.htm // in this tutorial kirupa has us building a custom scrollbar for a masked mc. It's works great, i even have the scrollbar working, however I can't get it to link correctly to my dynamic text box. I don't know how to properly change the actionscript to make it work.
My dynamic text box has an instance name of news_txt I tried plugging that in-place of the contentMain MC or contentMask MC that this tutorial uses. I also tried changing various other things, but I cannot get this to scroll. Besides changing the names of some instances, and making sure I followed the tutorial, it isn't that hard, however I don't know how to edit the actionscript.
If anybody knows how to change it, or another way or creating a custom scrollbar to go along with my arrows that'd be swell.
Kirupa ScrollBar Actionscript
P.S. ... please don't tell me to just use the component scrollbar, because it's just boring and unoriginal.
Custom Scrollbar For Input Text
hi there!
i've build my one custom scrollbar... very nice... i think... but i've got some problems with scrolling input text. I cant really explain... see for yourself... please...
thanks!
Custom Scrollbar + External Text
I've serached the forums for an hour now and can't find out how to attach a custom built scrollbar to a dynamic text field that is loading external text. The tutorial of the dynamic scrollbar doesn't help me because its using the UI component. Anyone help? PLEASE!
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
External Dyanmic Text & Custom Scrollbar
I have a custom scrollbar which works for Static Text, but not Dynamic Text. What am I doing wrong?
Thanks in advanced.
N
ActionScript Code:
stop();
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
main._y += dy;
};
};
Trouble Attaching Dyn Text To Custom Scrollbar
I found two helpful tutorials/source files. One teaches how a custom scrollbar works. The other teaches how to load an external .txt file into flash at runtime.
I tried to combine both of them. A lonnggg time later... err... nothing. no rabbit came out of the hat. not even one. Someone please look at my zip file and put me out my misery.
Thank you.
http://www.gustografik.com/ultrashoc...ynamictext.zip
Re: Linking Text Files To Flash With A Custom Scrollbar
Hi all,
I am looking to link text files to Flash MX for the content of my pages. I want to be able to scroll the text using custom scrollbars and have a custom scroll tracker as well. An exact example of what I need to do is the pages on www.velvetrevolver.com where from what I can make out, each page is in its own movie clip.
Please help me if you know how to do this. I've only just started with Flash MX so if you could please go easy on me, I'd be most grateful.
Thank you very much and I hope to hear from you.
Take care,
Mark
Scrollbar In Dynmic Text Field.
Well, after extensive reading of the help files I am forced to seek your'alls help.
I cannot get the scrollbar component to actually scroll text.
Please fill me in on the steps.
I've named my dynamic text field
I've pointed the scrollbar component to that name
I've filled in the text field with text using a variable.
So what am I missing?
Thanks folks,,,,
Editing Text In A Scrollbar Field
Right, ive just got MX. This is great because it has alowed me to use scroll bars in the news section of a site. Only problem is i cant edit the way the text looks. I can change the font etc but it is uniform to all the text. Is there anyway of having different parts of the text in different colours?
Dynamically Add Scrollbar To A Text Field
Hi ActionScripters,
I'm trying to add a (vertical) scrollbar to a text field. The text field itself is dynamically dropped in using createTextField from a movie clip.
The data for the text field comes from a text file. But I'm not able to get the scroll bar to work.
Here's what I'm working on:
http://www.arunmahendrakar.com/Misc/Development.zip
Please let me know what I'm doing wrong.
Thanks in advance
Arun
How To Have Scrollbar For A Static Text Field?
I know how to make scrollbar for a Dynamic Text Field. But I don't want to use Dynamic because in the Dynamic text I cannot choose to have Bold or Italic fonts for a single word and the whole context gets bold/italic instead.
Thats why I want to use static field with scrollbar, to be able to make some words Bold and have scrollbar at the same time.
I can imagin that if there is a way to make a single word Bold in a dynamic text field, then all my problem would be solved...
Do you have a hint??? //Thanx
Referencing Text Field Within Custom Class
I have set up two classes, one is the DocumentClass and it imports a custom class i have made called XMLLoader. The problem is I want to change the value of a dynamic text field on the stage with the instance name xml_txt from within the XMLLoader class...
Code:
package classes
{
import flash.display.MovieClip;
import classes.XMLLoader;
public class DocumentClass extends MovieClip
{
public function DocumentClass():void
{
var xml:XMLLoader = new XMLLoader();
}
}
}
Code:
package classes
{
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class XMLLoader
{
var req:URLRequest = new URLRequest("myXML.xml");
var loader:URLLoader = new URLLoader();
public function XMLLoader():void
{
loader.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.addEventListener(Event.COMPLETE, loadComplete);
loader.load(req);
}
private function loadProgress(event:ProgressEvent):void
{
var percent:Number = ( 100 / event.bytesTotal ) * event.bytesLoaded;
trace(Math.round(percent));
}
private function loadComplete(event:Event):void
{
var newLoader:URLLoader = URLLoader(event.target);
trace(newLoader.data);
}
}
}
Scrollbar Component Won't Snap To Text Field...why?
Ok I have both UI Component Set 1 and 2 installed in MX.
If I create a new Flash movie, create a dynamic text field with an instance name and then drag teh scrollbar component out of the components panel and onto the text field, it will snap to whatever side I am nearest.
Now, I have a movie that I have been working on and I just created a dynamic text field with a unique instance name on the root timeline. Nothing fancy...that's it. It has multiline set and no selection and no HTMl encoding. When I grab a fresh copy of the scrollbar component (from either component set) and try to get it to snap to my text field...it doesn't work. It recognizes what text field it is over and will scroll the text within it, but it never snaps to a side nor does it resize to the text box width (or height).
Any ideas? This is wacked.
Scrollbar Not Sizing To Size Of Text Field
Hello and thanks for your time.
I created a dynamic text field. Selected multi-line. Gave the text field an Instance Name(scroll_text).
Dragged my Scrollbar component to the right-hand region of my text field and it's not snapping to the side of my field or automatically sizing like others I've done. I have deleted, redone, rebooted Flash, rebooted my computer. Any ideas? Thank you again.
Sync Movieclip To Text Field & Scrollbar?
I've got a dynamic text box that's controlled with a scrollBar component. The text is updated dynamically, but it's consistent text.
Now, I've got an arrow_mc movieclip that points to the first line of each paragraph as the audio hits that paragraph. Is there a way I can have the arrow scroll up and down with the textbox when the user drags the scrollbar???
Thanks!!
How To Apply Scrollbar To The Static Text Field?
To be able to have Bold or Italic word in the a text field I have to use Static Text Field. At the same time want to have a scrollbar which I can not apply to static text field.
I have 2 choices:
a. Eiether be able to to change the text in Dynamic Text Field to be flexible for Bold and Italic properties or
b. I need to make Static Text Field to have scrollbar.
Do you have a hint?
//Thanx
Edited: 02/11/2007 at 11:52:01 AM by SwedKim
Draggable Scrollbar For Text Field (No Arrows)
I am attempting to create a draggable scrollbar for a dynamic text field including only a sliding thumb and track (no arrows). ex. www.ultimavez.com
I am new to Flash 8 and have a relatively good understanding for the program based on the length of time I’ve been using it, with the exception of creating/customizing components. If someone is able to assist me, please break the solution down as though you were explaining it to a 10 year old.
Thanks
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
Custom Font Not Working In Input Text Field
Ok guys i am in need some either some hints tips or if u feel like it a walk threw on what ive got to do to make the input text field i got use the custom font i want that is a font i downloaded some where of the net.
Below are the things i have done and tried but havnt worked.
1 = added font BankGothic Md BT to libary and set its identifier name as BankGothic Md BT and also have made it set to export for action scripting and export in first frame.
2 = made a layer called input text, made one input text box on that layer and gave it the instance name of maininput_txt and set the font to the same thing as the one in the libary.
3 = i set the options of that maininput.txt as follows below
textfield type = input
font = BankGothic Md BT
multiline
selectecable
bitmap text (no anti alias)
4 - ive also embeded the following
Uppercase a -z 27 glyphs
Lowercase a- z 27 glyphs
numerals 0 - 9 11 glyphs
punctuations 52 glyphs
5 - and have got auto kern unticked.
6 - added the following action script code to the first frame the input field is in
this.createTextField("mainimput_txt",1,2,2,550,50) ;
mainimput_txt.text="compiler active.....>";
style=new TextFormat();
style.font="BankGothic Md BT";
mainimput_txt.setTextFormat(style);
mainimput_txt.embedFonts=false;
================================================== =
Ok the thing is when i preview it as flash that setup works and it displays the font i want but when i actually have published it it changes the font to times new roman or some other one not the one i want.
I have also tried without that action script code ==== did not work
i have also tried change the embedFonts=flase statement to true - did not work
i have also tried removing that maininput_txt.text= "compiler active...>"
that also did not work
so please guys im at my wits end here, i wanna use this font and im running out of ideas to try.
the reason i made this so detailed post is to help u understand what ive done and what ive tried that hasnt worked so u dont just tell me to do things ive all ready tried which would just be wasting ur time and mine.
Hope someone here can help me cause i cant continue working on this untill i fix this problem.
Many thanks in advanced
Custom Font Not Working In Input Text Field
Ok guys i am in need some either some hints tips or if u feel like it a walk threw on what ive got to do to make the input text field i got use the custom font i want that is a font i downloaded some where of the net.
Below are the things i have done and tried but havnt worked.
1 = added font BankGothic Md BT to libary and set its identifier name as BankGothic Md BT and also have made it set to export for action scripting and export in first frame.
2 = made a layer called input text, made one input text box on that layer and gave it the instance name of maininput_txt and set the font to the same thing as the one in the libary.
3 = i set the options of that maininput.txt as follows below
textfield type = input
font = BankGothic Md BT
multiline
selectecable
bitmap text (no anti alias)
4 - ive also embeded the following
Uppercase a -z 27 glyphs
Lowercase a- z 27 glyphs
numerals 0 - 9 11 glyphs
punctuations 52 glyphs
5 - and have got auto kern unticked.
6 - added the following action script code to the first frame the input field is in
this.createTextField("mainimput_txt",1,2,2,550,50) ;
mainimput_txt.text="compiler active.....>";
style=new TextFormat();
style.font="BankGothic Md BT";
mainimput_txt.setTextFormat(style);
mainimput_txt.embedFonts=false;
================================================== =
Ok the thing is when i preview it as flash that setup works and it displays the font i want but when i actually have published it it changes the font to times new roman or some other one not the one i want.
I have also tried without that action script code ==== did not work
i have also tried change the embedFonts=flase statement to true - did not work
i have also tried removing that maininput_txt.text= "compiler active...>"
that also did not work
so please guys im at my wits end here, i wanna use this font and im running out of ideas to try.
the reason i made this so detailed post is to help u understand what ive done and what ive tried that hasnt worked so u dont just tell me to do things ive all ready tried which would just be wasting ur time and mine.
Hope someone here can help me cause i cant continue working on this untill i fix this problem.
Many thanks in advanced
Custom Font Not Working In Input Text Field
Ok guys i am in need some either some hints tips or if u feel like it a walk threw on what ive got to do to make the input text field i got use the custom font i want that is a font i downloaded some where of the net.
Below are the things i have done and tried but havnt worked.
1 = added font BankGothic Md BT to libary and set its identifier name as BankGothic Md BT and also have made it set to export for action scripting and export in first frame.
2 = made a layer called input text, made one input text box on that layer and gave it the instance name of maininput_txt and set the font to the same thing as the one in the libary.
3 = i set the options of that maininput.txt as follows below
textfield type = input
font = BankGothic Md BT
multiline
selectecable
bitmap text (no anti alias)
4 - ive also embeded the following
Uppercase a -z 27 glyphs
Lowercase a- z 27 glyphs
numerals 0 - 9 11 glyphs
punctuations 52 glyphs
5 - and have got auto kern unticked.
6 - added the following action script code to the first frame the input field is in
this.createTextField("mainimput_txt",1,2,2,550,50) ;
mainimput_txt.text="compiler active.....>";
style=new TextFormat();
style.font="BankGothic Md BT";
mainimput_txt.setTextFormat(style);
mainimput_txt.embedFonts=false;
================================================== =
Ok the thing is when i preview it as flash that setup works and it displays the font i want but when i actually have published it it changes the font to times new roman or some other one not the one i want.
I have also tried without that action script code ==== did not work
i have also tried change the embedFonts=flase statement to true - did not work
i have also tried removing that maininput_txt.text= "compiler active...>"
that also did not work
so please guys im at my wits end here, i wanna use this font and im running out of ideas to try.
the reason i made this so detailed post is to help u understand what ive done and what ive tried that hasnt worked so u dont just tell me to do things ive all ready tried which would just be wasting ur time and mine.
Hope someone here can help me cause i cant continue working on this untill i fix this problem.
Many thanks in advanced
Loading Extrenal Text Into The Custom Scrollbar Made In Kirupa's Tutorial.
Well, that title was a mouthful...
Anyways, I've tried five different tutorials for laoding external text now, and none of them work with the custom scrollbar.
What i currently have is a dynamic textbox in the content movieclip in the scrollbar.
the code for the frame is:
Code:
myData = new LoadVars();
myData.onLoad = function() {
myText.text = this.content;
}
myData.load("menucontent.txt");
And yes, the textbox has a instance name, and a variable name.
Does anyone know what I'm donig wrong?
|