Loading Ext. Text Into Scrolling Text Box. Problem With Text? Help Please?
Hi,
I am hoping someone can help me. I am loading an external text file into a scrolling text box. I was able to get my box and buttons, scroll bar, etc to work correctly. However, I am having two other problems that I cannot figure out.
1) My text file that I am loading is several lines long (320 or so), however, when I test my movie only the first 20 lines of the text shows up. How can I make all of my text show up? I will be adding to this text file over time and adding updates to it. So the text will gradually have more lines added over time.
2) The 20 lines of text that is showing up is all double-spaced, while the text in my text file is single spaced. How do I make my text show up single spaced? I checked the paragraph settings of my text box and everything is set to zero. What can I do fix this?
I am using Flash 5.0 and I created my text in Metapad.
Thanks in advance to anyone who can help me out.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Text From Text File And Then Scrolling It Using Components?
Helloo.
Can anyone please help me.
I want to dynamicaly load text into flash, probably from a txt file. Then I want to be able to set up my file so the text field is scrolable using the 'scrollbar' component.
Can anyone please help? Everytime I do it my text field wont scroll, even though I'm sure there is more text than can be seen?
Can anyone help with a .fla?
Cheers SHACK.
p.shackleton@brahm.com
Text Not Loading From "Scrolling Dynamically Loaded Text" Tutorial [renamed]
Hello!
I'm Having a problem with an ActionScript from one of Kirupa's Flash Tutorials, the tut is named "Scrolling Dynamically Loaded TexT". Well, I followed the tut exactly and when I click on File > Publish Preview and The Text file doesn't load where it's suppose to. I have the txt file in the same folder as the .fla file and it should work. I have also tried Ctrl+Enter to preview it and it still doesn't work. Is their something wrong with the ActionScript? Can someone please help me out here, Please post an actual working ActionScript for Flash MX Pro 2004. I would greatly appreciate it!
Thanks in advance.
Text Not Loading From "Scrolling Dynamically Loaded Text" Tutorial [renamed]
Hello!
I'm Having a problem with an ActionScript from one of Kirupa's Flash Tutorials, the tut is named "Scrolling Dynamically Loaded TexT". Well, I followed the tut exactly and when I click on File > Publish Preview and The Text file doesn't load where it's suppose to. I have the txt file in the same folder as the .fla file and it should work. I have also tried Ctrl+Enter to preview it and it still doesn't work. Is their something wrong with the ActionScript? Can someone please help me out here, Please post an actual working ActionScript for Flash MX Pro 2004. I would greatly appreciate it!
Thanks in advance.
Dynamic Text, Loading Text From Text File
I have a large text file, full of, believe it or not, alot of text. When it loads into the textbox in flash, it cuts off after a certain amount of lines. How many lines does it cutt off at and if I can, how do I increase this? THanks
URGENT Positioning Dynamic Text In Text Scrolling Window
Help!
I have a dynamic, scrolling text field, whose scroll is based on one of the tutorials on Flashkit. In the text I have some links which switch the content of the field via asfunction, but that's unimportant. I wanted to add a functionality similar to html "anchor", so when I switch the contents of the field (for example to read a CV of someone mentioned in the text), and remember windowTxt.scroll and windowTxt.maxscroll properties (where windowTxt is the variable name of the text field, after I finish reading the CV I click the special "back" button, and it loads the old text back and tries to set the windowTxt.scroll & windowTxt.maxscroll back to the state they were before entering the CV. I tried to do it like this:
Code:
_root.windowTxt.scroll = _root.pscroll; // pscroll => previous scroll
_root.windowTxt.maxscroll = _root.pmaxscroll; // previous max scroll
IT DOESN'T WORK! The variables ARE there in the path because trace shows the proper values for all of them, but! The scroll property won't even bother setting itself to the desired value... and the scroll using buttons and the syntax
_root.windowTxt.scroll--;
or
_root.windowTxt.scroll++;
WORKS...
Oh by the way - this is for the projector...
To sum it up - I need to push the dynamic text to a certain value after it's loaded - how to do that? I've no time for experimenting... I've deadline in a few hours and this is the last feature I've to implement, after that it's source merging with a source from a friend's work and betatesting... If I won't make it - I'm screwed. HEEEEEEEEEELP!!! THANKS IN ADVANCE...
Scrolling Large Text, Text Doesn't Display Completely...
I'm using this script for my scrollers, the main problem is when my movie have too much text content, it seems to stop displaying the text after a certain number of rows...
Anyone have an idea what could cause such limitation?
Quote:
// Jake Gelbman 11.14.01 slider script
// email: allforjake@yahoo.com
// site: allforjake.cjb.net
// ok here is the load event handler
// diff_y is the total amount that the scrollbar can movethe bound_box is a movie clip that surrounds everything. its just a clear box
// next line we set bounds to the bounding area of the bound_box clip getBounds() returns 4 variable yMin yMax xMin & xMax they are the bounding area that well use for a lot of stuff
// top is the highest amount the scrollbar can go
// bottom is the lowest
// updateScrollbar() is the function for setting the content clip to the right spot
// "scroller._y - top/diff_y" is a percent of the scroll bar's position we multiply it by the amount we can scroll of the content
// friction is how much the scrollbar should slow down by after throwing it
onClipEvent (load) {
diff_y = bound_box._height-scroller._height;
bounds = bound_box.getBounds(this);
top = bounds.yMin+(scroller._height/2);
bottom = bounds.yMax-(scroller._height/2);
function updateScrollbar () {
content._y = -(((scroller._y-top)/diff_y)*(content._height-bound_box._height));
}
friction = 0.10;
}
// this detects if you clicked on the scroller it starts a drag with the scroller to be from the "top" which we defined earlier to the "bottom"
// we then set scrolling to true
onClipEvent (mouseDown) {
if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
startDrag ("scroller", false, scroller._x, top, scroller._x, bottom);
scrolling = true;
}
}
// here we stop the drag and set scrolling to false
onClipEvent (mouseUp) {
stopDrag ();
scrolling = false;
}
// every frame it sees if your scrolling then it updates the scrollbar to the right place based on the y position of the scroller
// it also calculates the speed of your scrolling
onClipEvent (enterFrame) {
if (scrolling) {
updateScrollbar();
newY = scroller._y;
yspeed = (newY-oldY)*0.50;
oldY = newY;
done = false;
} else if (!done) {
// here it adds the speed to the y position of the scroller
// then it asks if the speed is at a number that you can see it moving if it is then it decreases the speed by multiplying it by a decimal
oldypos = scroller._y;
newypos = oldypos+yspeed;
if (yspeed<-0.2 || yspeed>0.2) {
yspeed *= friction;
} else {
yspeed = 0;
done = true;
}
// the next two if statements test if it hit the top or bottom if it had it makes the speed negative to what it is so itll change its direction - neat bounce effect to it
if (newypos<top) {
yspeed = -1*yspeed*friction;
newypos = top;
}
if (newypos>bottom) {
yspeed = -1*yspeed*friction;
newypos = bottom;
}
// here we set the scrollers y position to newyposition (the variable we are adding the speed to)
// it then sets the mc to whereever the scroller is
// then its going to keep on doing this enterFrame business untill speed has reduced itself to 0
scroller._y = newypos;
updateScrollbar();
}
}
Auto Scrolling Dynamic Text From External Text File
Hi guys,
I'm loading a text file into a dynamic text box using LoadVars, and I've got it to scroll using this code:
Code:
var myInterval = setInterval(scrollUp, 500);
function scrollUp() {
_root.text_mc.textbox.scroll += 1;
}
...but there are two problems. One, the client says it's too jerky (as it's doing it a line at a time, rather than a smooth scroll), and two, the client would like it to be like a news scroller, meaning it automatically scrolls to the bottom of the text, and then the start of the text appears underneath and keeps scrolling continuously. I hope I've explained myself reasonably well!
If someone could help me out with these two things, I'd really appreciate it - cheers!
Boog
Auto Scrolling Dynamic Text From External Text File
Hi guys,
I'm loading a text file into a dynamic text box using LoadVars, and I've got it to scroll using this code:
Code:
var myInterval = setInterval(scrollUp, 500);
function scrollUp() {
_root.text_mc.textbox.scroll += 1;
}
...but there are two problems. One, the client says it's too jerky (as it's doing it a line at a time, rather than a smooth scroll), and two, the client would like it to be like a news scroller, meaning it automatically scrolls to the bottom of the text, and then the start of the text appears underneath and keeps scrolling continuously. I hope I've explained myself reasonably well!
If someone could help me out with these two things, I'd really appreciate it - cheers!
Boog
Loading A Text Box And Scrolling
I have the code to scroll a text box:
//
// note : everything is dependent upon the size of the textfield on the stage
//
ST = mov_scroller.mov_thumb; // common path reference
//
init_scroll = function(){
// integers in here CAN be created dynamically. I was lazy. :]
with(mov_frame){
// put an arbitrary space around textfield
_x = txt_display._x-5;
_y = txt_display._y-5;
_height = txt_display._height+10;
_width = txt_display._width+10;
}
with(mov_scroller){
mov_thumb._height=mov_frame._height/7;
// one btn down=12
_y=mov_frame._y+12;
// half the dist of scroller=6
_x=mov_frame._x+mov_frame._width+6;
// up two btns=24
mov_down._y=mov_frame._height-24;
mov_track._height = btn_bg._height = mov_frame._height-24;
// get the max and min values so we know where to stop the scroller
// store them as a var within 'thumb'
mov_thumb.int_min=mov_thumb._y;
mov_thumb.int_max=Math.ceil(mov_track._height-mov_thumb._height);
}
// place load btns : purely aesthetic!
for(var i=0;i<=2;i++){
this['btn_'+i]._x=mov_frame._x;
this['btn_'+i]._y=mov_frame._y+(i*(this['btn_'+i]._height+5));
}
// used for scroll and drag
int_scrollDist = Math.ceil(mov_scroller.mov_track._height-ST._height);
};
// init
init_scroll();
// load function
loadText_old = function(toLoad){
loadVariables(toLoad, _root);
_root.gotoAndPlay('swonk');
ST._y = ST.int_min;
};
// set a var to check if the user clicked anywhere on the scroller
// other than the btns or the thumb for use with...
mov_scroller.btn_bg.onPress=function(){
boo_scrollClk=1;
};
mov_scroller.btn_bg.onRelease=mov_scroller.btn_bg. onReleaseOutside=function(){
boo_scrollClk=0;
};
// ...this
// track event handler: for click other than dragScroll or use of btns
mov_scroller.mov_track.onEnterFrame = function(){
// Subtraction and addition : when you click and hold,
// the thumb falls in the middle of the mouse click.
// take out '-(ST._height+(ST._height/2))' and see where it stops
point={y:_root._ymouse-(ST._height+(ST._height/2))};
if(boo_scrollClk){
globalToLocal(point.y);
/*>> bug fix : set zones <<*/
if(point.y<=ST._height && point.y>=ST.int_min){
// click is in the upper zone of track
var d = (ST.int_min)-ST._y;
}else if(point.y<=int_scrollDist){
// ...mid zone
var d = (point.y)-ST._y;
}else{
// ...lower zone
var d = (ST.int_max)-ST._y;
}
// update thumb
ST._y+=d/5;
// check so scroller can't keep dragging up if user holds down mouse
if(ST._y<=ST.int_min) boo_scrollClk=0;
}
};
//
// scroller event handler
mov_scroller.onEnterFrame = function() {
str_display.scroll = Math.round((this.mov_thumb._y/int_scrollDist)*str_display.maxscroll);
};
// hide hand from all buttons : optional
Button.prototype.useHandCursor=0;
//
and i have the code to load the text into a text box:
loadVariablesNum("http://tcbp.t35.com/tcbp/new/updates.txt", 0);
When i view the .swf file in the flash program (CTRL + ENTER) i can see the text, but once i upload it to my site (hosted at t35.com) the text is not there.
what is wrong??
Thanks
Loading A Text Box And Scrolling
I have the code to scroll a text box:
//
// note : everything is dependent upon the size of the textfield on the stage
//
ST = mov_scroller.mov_thumb; // common path reference
//
init_scroll = function(){
// integers in here CAN be created dynamically. I was lazy. :]
with(mov_frame){
// put an arbitrary space around textfield
_x = txt_display._x-5;
_y = txt_display._y-5;
_height = txt_display._height+10;
_width = txt_display._width+10;
}
with(mov_scroller){
mov_thumb._height=mov_frame._height/7;
// one btn down=12
_y=mov_frame._y+12;
// half the dist of scroller=6
_x=mov_frame._x+mov_frame._width+6;
// up two btns=24
mov_down._y=mov_frame._height-24;
mov_track._height = btn_bg._height = mov_frame._height-24;
// get the max and min values so we know where to stop the scroller
// store them as a var within 'thumb'
mov_thumb.int_min=mov_thumb._y;
mov_thumb.int_max=Math.ceil(mov_track._height-mov_thumb._height);
}
// place load btns : purely aesthetic!
for(var i=0;i<=2;i++){
this['btn_'+i]._x=mov_frame._x;
this['btn_'+i]._y=mov_frame._y+(i*(this['btn_'+i]._height+5));
}
// used for scroll and drag
int_scrollDist = Math.ceil(mov_scroller.mov_track._height-ST._height);
};
// init
init_scroll();
// load function
loadText_old = function(toLoad){
loadVariables(toLoad, _root);
_root.gotoAndPlay('swonk');
ST._y = ST.int_min;
};
// set a var to check if the user clicked anywhere on the scroller
// other than the btns or the thumb for use with...
mov_scroller.btn_bg.onPress=function(){
boo_scrollClk=1;
};
mov_scroller.btn_bg.onRelease=mov_scroller.btn_bg. onReleaseOutside=function(){
boo_scrollClk=0;
};
// ...this
// track event handler: for click other than dragScroll or use of btns
mov_scroller.mov_track.onEnterFrame = function(){
// Subtraction and addition : when you click and hold,
// the thumb falls in the middle of the mouse click.
// take out '-(ST._height+(ST._height/2))' and see where it stops
point={y:_root._ymouse-(ST._height+(ST._height/2))};
if(boo_scrollClk){
globalToLocal(point.y);
/*>> bug fix : set zones <<*/
if(point.y<=ST._height && point.y>=ST.int_min){
// click is in the upper zone of track
var d = (ST.int_min)-ST._y;
}else if(point.y<=int_scrollDist){
// ...mid zone
var d = (point.y)-ST._y;
}else{
// ...lower zone
var d = (ST.int_max)-ST._y;
}
// update thumb
ST._y+=d/5;
// check so scroller can't keep dragging up if user holds down mouse
if(ST._y<=ST.int_min) boo_scrollClk=0;
}
};
//
// scroller event handler
mov_scroller.onEnterFrame = function() {
str_display.scroll = Math.round((this.mov_thumb._y/int_scrollDist)*str_display.maxscroll);
};
// hide hand from all buttons : optional
Button.prototype.useHandCursor=0;
//
and i have the code to load the text into a text box:
loadVariablesNum("http://tcbp.t35.com/tcbp/new/updates.txt", 0);
When i view the .swf file in the flash program (CTRL + ENTER) i can see the text, but once i upload it to my site (hosted at t35.com) the text is not there.
what is wrong??
Thanks
Loading Ext .swf From Scrolling Text
Good Morning,
Can I load external .swf files from a scrolling textbox that is formatted to HTML by simply using the a href tag? I assume it's best to have the external .swf files in same folder as the .html?
Help Loading Scrolling Text
I have a .swf that I want to load into a second .swf. (I'll call 'em a.swf and b.swf.) a.swf has a scrolling text box that I dynamically load when the page loads. This works fine. What I need to have happen is - when b.swf loads inside of a.swf, I need the buttons in b.swf to be able to change the scrolling text box on a.swf. For some reason, this is proving difficult.
This is the code i'm using:
on (release) {
loadText = new LoadVars();
loadText.load("Draft.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
_root.maintext.scroller.text = 0;
}
}
Any help would be appreciated! Thanks!
Scrolling Text - Doesn't Scroll Using External Text
Okay, this is something I've got around using some fairly complex coding from these boards before, but I'm wondering if there's a much easier way.
I have a dynamic text box named "mainText", and am using buttons to scroll up or down with the following AS:
on (rollover, dragOver) {
_root.mainText.scroll -= 1; // change to += to go down
}
Now, this works fine if the txt is placed in the actual text box, but if I load external text it does not scroll.
Is there a simple way around this?
Cheers
Dave
Dynamic Text In Smooth Scrolling Text Field
here's links to the files.
http://www.anicespot.com/test/
http://www.anicespot.com/test/easing...roller-01.html
http://www.anicespot.com/test/easing...croller-01.swf
http://www.anicespot.com/test/easing...croller-01.fla
here's the problem:
1) when I have FlashMX open and select 'test movie' the text loads but is visible outside of the text field. (see .fla file)
2) when I publish and view locally the html or .swf file directly from the folder everything works fine.
3) when I place all files in the root folder and view from the web nothing works.
so can anyone help me out here?
this really has me puzzled.
james
Scrolling Text - Reset Position To Top Of Text Pane?
I need some help with this scrolling thing - can I make it so when you click on a button, it resets the text to be back at the top of the text-pane? I have tried EVERTHING, and it will seem to work, but if I press the up or down arrows, and THEN press the button to reset the position, it goes all wacko. Can someone help?
www.flashkit.com/jump.php?ID=4804&type=movies
Thank you so much!
Heather
Input Text To Scrolling Dynamic Text Field - Help
Greetings all:
I am attempting (with little success) to come up with a way to do the following:
1. Have user type input into an input field and have it display in another dynamic text field - Got that done.
2. I would like the display text field to scroll automatically across the screen (to the left). I can get it to scroll once user hits enter key, but no luck with the continuous scroll and still have the ability to add words to the field.
My code is below which works in so far as it goes, it scrolls up one word at a time. I am using Flash Mx and any help would be greatly appreciated.
Thanks in advance...
button_two.onPress = function() {
word();
rootup();
}
//show.text=_root.input.text
function word() {
show.text=_root.input.text
input.text=""
thing.gotoandstop(2);
example2.push(show.text);
preview2 = example2.join("<br>");
}
function rootup() {
_root.up = true;
scroll_words();
}
function scroll_words() {
if (_root.up) {
_root.preview2.scroll += 1;
}
else if (_root.down) {
_root.preview2.scroll -= 1;
}
}
How To Change Scrolling Text After A Few Seconds To Different Text And Then Back
Hi!
I have a scrolling text area in my flash app that needs to provide some user feedback when a person clicks or does something.
I'd like it to display the user feedback for say 5 seconds when a button is clicked and then go back to scrolling the original message. I'd like to do this directly in actionscript code.
Is there a good way to do this directly in actionscript? Conceptually, I'd like my function to change the text, then have actionscript wait/pause for 5 secs and then change it back to the original text.
I thought this would be easy, but OMFG! It's not. =) Any help is much appreciated. I've tried setInterval and setTimeout, but with no joy so far. In fact I tried them alot, being stubborn so I must be doing something wrong.
Thx ahead for any snippets or pointers,
-C
Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,
I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}
the text code is:
stop();
loadVariables("biosText.txt", this);
Thanks
Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,
I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}
the text code is:
stop();
loadVariables("biosText.txt", this);
Thanks
Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,
I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}
the text code is:
stop();
loadVariables("biosText.txt", this);
Thanks
Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,
I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}
the text code is:
stop();
loadVariables("biosText.txt", this);
Thanks
Load External Text Into Scrolling Text Frame?
Hi, it's my first post! I just did the Kirupa tutorials on using css styles in flash - perfect! I am having trouble applying it to my flash file though. Probably because I'm using a scrolling text layer to fit a thousand words or so.
This is based on actionscript.org script for scrolling text layers (I believe it was this one I used.
The button calls an .as file
#include "about.as"
which contains all the script for scrolling the chosen text file in your assigned text box. All I want to do is tell the chosen text file to use my actionscript
<http://www.magma.ie/client/flashprospectus/flash.css>
So do I have to add something in the .as file, or in my flash doc itself? What and where do I put it?
Many thanks
ps. Here are the related files:
flash moviekirupa load css
Multiple Scrolling Text Boxes From Text Files
Hello!
I have been trying to solve this problem long enough and need some help.
I am creating this in Flash 8.
I want to have a text area that has scrolling text. The text is brought in from a text file (one ending in .txt). Yes, there are a zillion tutorials that detail the steps. In fact, I have it working. The example that worked for me was one in which the scroll component was used and some action scripting. Works perfectly.
But not one that gives me a clue what to do if I want multiple text boxes using various external text files.
I have the timeline with the cells set-up so each cell is a new page (there is a script stop; to accomplish this along with keyframes).The idea is to navigate to a keyframe and it appears as if it is a new page. A box with a graphic in it changes, and a box for dynamic scrolling text exists. I got the first “page” with perfect scrolling text from an external text file.
Here’s the action script:
myVars = new LoadVars();
myVars.onLoad = function(){
textbox.text=this.Grun01;
};
myVars.load("scroll01.txt");
Now, if I do this same thing for the next page, all the pages stop working. The text files are different as are their first lines before the = signs. They are as such (in part):
File called scroll01.tx has a first line Grun01=
No html was used.
The text box’s properties were set to Dynamic, multipleline and an instance of textbox. The UIscrollBar instance was with parameters set to textbox.
I did the second text box (in the next cell) to load scroll02.txt, a first line of Grun02= and changed the action script to:
myVars = new LoadVars();
myVars.onLoad = function(){
textbox.text=this.Grun02;
};
myVars.load("scroll02.txt");
I also varied the text box’s properties to an instance of textbox02. The UIscrollBar instance was with parameters set to textbox02.
What do I need to do to be able to have each page with scrolling text loaded from an external file?
Thanks in advance,
Bill H.
Loading Text And Scrolling Buttons
Hey
I load up an external text document, and my menu buttons populate different pieces of it in a single text box i.e. about us, services etc. I have scroll buttons that move the text up and down. My problem is that if I have scrolled say half way down on one peice of text, the next piece of text loads in the same place i.e. half way down. I want each piece of text to load at the top of the scroll...I have attached the scroll text script below
onEnterFrame = function() {
if(down == 1) {
content_txt.scroll += 1;
}
if(up == 1) {
content_txt.scroll -= 1;
}
}
up_btn.onPress = function(){
up = 1;
}
up_btn.onRelease = function(){
up = 0;
}
down_btn.onPress = function(){
down = 1;
}
down_btn.onRelease = function(){
down = 0;
}
thanks...
Loading .txt Into A Dynamic Scrolling Text Box
I was able, using some tutorials , to set up text that loaded from a .txt file into a scrolling text box. It works great. I would like that text to change, however - when I click on one of my buttons. The scrolling text box is a mc with the instance name of maintext... I've tried to get it to work using my logic (probably not a good idea...) but now I'm stuck. Here's the code I came up with:
on (release) {
getText = new loadVars();
getText.load("News.txt");
maintext.scroller.text = this.News;
}
Any suggestsion would be great!
Thanks!
Loading Text Into Scrolling XML Gallery
Hi Everyone,
I found this script that includes a scrolling thumbnail gallery. I only want the thumbnail part and i can make that work but i want to load some text in between each image. Is there a way to this? (My last resort is to turn the text into an image and load it thru xml like the other images but i don't really want to do this.) Below is the script.
Thanks for your help!
/*Code for loading XML file. */
function loadXML(loaded) {
if (loaded) {
/* "xmlNode" is just a faster way of saying "this.firstChild". */
xmlNode = this.firstChild;
image = [];
head = [];
description = [];
thumbnails = [];
category = [];
cat = xmlNode.childNodes[0].firstChild.attributes.cid
/* Finds total number of child nodes (images w/captions to be displayed, in this case). */
total = xmlNode.childNodes[1].childNodes.length;
/* Extracts data from each child node, stopping when the total (defined above) is reached. */
for (i=0; i<total; i++) {
image[i] = "images/"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
head[i] = xmlNode.childNodes[1].childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[1].childNodes[i].childNodes[2].firstChild.nodeValue;
category[i] = xmlNode.childNodes[1].childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails[i] = "images/th_"+xmlNode.childNodes[1].childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
cat = 0;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("gt-data.xml");
/////////////////////////////////////
/* Lets the user scroll through with left and right arrow keys. */
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
/* Note the references to button instances previous_btn and next_btn here.*/
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
/* The movie begins, naturally, at the beginning--in XML, that's zero! */
p = 0;
/* Preloader for images. */
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader._visible = true;
} else {
/* Makes preloader invisible once the image starts to fade in. */
preloader._visible = false;
/* Fade in the image. (If the alpha is under 100, add 10.) */
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
/* Load & display the next image. It cleverly calculates whether you are at the end of the
images or not. If you are, the script doesn't run.*/
function nextImage() {
/* If it's less than the total (the last image), let's go ahead and load the next image. */
if (p<(total-1)) {
p++;
if (loaded == filesize) {
/* If it is loaded, set alpha to zero, so that the preloader can fade it in! */
picture._alpha = 0;
/* Put the image where it is supposed to go. */
picture.loadMovie(image[p], 1);
/* Load description into text box "desc_txt" */
desc_txt.text = description[p];
head_txt.text = head[p];
/* Activates the function down below, telling you what number picture you're viewing. */
picture_num();
}
}
}
/* Basically the same as nextImage(), but backwards. Fading and image/text insertion is the same. */
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
head_txt.text = head[p];
picture_num();
}
}
/* Automatically show the first image when the movie is loaded, fade-in and all. */
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
/* Use image[0] instead of image[p] since this only applies to the first image. */
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
head_txt.text = head[0];
picture_num();
}
}
/* Thumbnail list. */
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc._alpha = 50;
target_mc.onRollOver = function() {
this._alpha = 100;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 50;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
/* Displays current position and total number of pictures. */
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Loading A .swf With A Dynamic Scrolling Text Field
I have been fighting with this thing for the last two weeks, and I am getting no where. I really want to get my site finished before I leave for Japan next Wednesday, so I am in a bit of a hurry, and would appreciate any help you guys could give.
I have a movie that loads a .swf that loads a .txt document. The problem is, no matter what I do, I cannot get the bloody thing to scroll....
Scrolling Text (external File Loading)
I have 6 (identical) movie clip instances in the main movie timeline and a scroll text movie in the main timeline. I have enabled an external file to load in the text scroll movie clip based on an OnClip (mouse down) from the 6 identical clips . If the text scroll clip is scrolled and I load a different external file, the scroller does not go back to the top of the text file. The user will have to then scroll back up. It looks pretty sloppy. Suggestions? Thanks in advance.
-xample
Loading Dynamic Text In Smooth Scrolling MC.
Trying to get dynamic text to load in smooth scrolling text MC.
Tried a number of options and the closest I've gotten has loaded the text but ignored the text mask.
please view the .fla & .swf before answering; it will save time and make my
pre-coffee description clearer.
Thanks James/NYC.
http://www.anicespot.com/test/easing_textScroller.swf
http://www.anicespot.com/test/easing_textScroller.fla
Dynamicall Loading From PHP File Into Scrolling Text Box
Hi
I'm using Flash MX 2004 Professional on a Mac.
Ive got a scrolling text box made with the scroller being a Component. The textbox's instance is 'scroller'.
Ive got a php file with the variable 'headerVar" that i want to load into the text box.
My code is:
Code:
loadVarsText = new loadVars();
loadVarsText.load("http://mysecretdomainlocation/phptest01.php");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.text = this.headerVar;
} else {
trace("not loaded");
}
};
Many thanks
M
Dynamic Scrolling Text Loading On Different Levels
Hi,
I've done the tutorial for Dynamic Scrolling Text from http://www.kirupa.com/developer/mx/dynamic_scroller.htm but now I need to load it on the 3rd level. It doesn't show up.
What I need to know is what I have to do to get this text to show up, once its loaded on the third level.
this is the part of the code that i think I need to fix.
Code:
loadText = new loadVars();
loadText.load("kirupa.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.kirupatext;
};
any ideas?
Thanks
Loading Dynamic Text In Scrolling Textfield
Hi,
I have dynamic textfield inside a graphic, for animation. This graphic scrolls so text keeps continually scrolling.
It works ok with the text I entered manually in the textfield, but it shows nothing when I assign other text at runtime using ActionScript.
I associated a variable to the textfield, so I assign text to that variable. When I do that, textfield is blank.
I read that the font might need to be embeded, so I checked and there are 95 glyphs embedded. Enough for my testing text at least.
Any ideas ??? I have been searching the forum for hours before posting, but nothing solved the problem.
Thanks!!!
Loading External Text And Scrolling Problem
Hi There
Can somebody please help me I have been searching the internet for 2 days solid trying to solve this problem. I have a dynamic text box with a custom scrollbar using a mask, which works without any problems, I wish to load in an external txt file using the basic html commands, I have managed to get it to work but the text doesn't show until I scroll down. Once I have scrolled to the bottom, there is stiill more text waiting to appear.
The code I have used is as follows:
Code:
var myData:LoadVars = new LoadVars();
myData.load("info.txt");
myData.onLoad = function(success){
if (success) {
mc2.mc2.html=true;
mc2.mc2.htmlText=this.content;
} else {
mc2.text = "no variables loaded";
}
}
speed = .7;
mc2.setMask(mask);
createEmptyMovieClip("mc1", this.getNextHighestDepth());
setInterval(smoothscroll, 40);
function smoothscroll() {
mc1._y = speed*(mc1._y-(button._y+mc1._y*(button._height/mask._height)))+(button._y+mc1._y*(button._height/mask._height));
mc2._y = (1-mc2._height*mask._height)*mc1._y+mc2._height/2;
}
The code for the scroll bar is:
Code:
onClipEvent (load) {
_parent.mc2.mc2.autoSize=true;
_parent.mc2.mc2._y = -_parent.mc2.mc2._height/2;
this._x = Math.round(this._x);
a = this._x;
b = this._y;
}
on( rollover ){
scrolling = "down";
frameCounter = speedFactor;
}
on( release, releaseOutside ){
scrolling = 0;
}
on (press) {
this.startDrag(false, a, b, a, _parent.mask._height-this._height);
}
on (release) {
this.stopDrag();
}
on (releaseOutside) {
this.stopDrag();
}
Thanks
James
HOW?-- Text Link In A Scrolling Text Field
If you go to http://www.geneed.com, you can see an example of what I'm talking about. From the homepage, click the link "Molecular Biology" on the right side of the screen. In the movie, I'd like to replicate what is being done in the box called "CONTENTS"--I have the scrolling down, but how do I turn the text into links? Anyone? Anyone? Help? [I have Flash 4]
[Edited by meepmeep on 06-15-2001 at 09:42 AM]
HOW?-- Text Link In A Scrolling Text Field
If you go to http://www.geneed.com, you can see an example of what I'm talking about. From the homepage, click the link "Molecular Biology" on the right side of the screen. In the movie, I'd like to replicate what is being done in the box called "CONTENTS"--I have the scrolling down, but how do I turn the text into links? Anyone? I recently downloaded Flash 5, so the specific steps to walk through this would be extremely helpful, as I'm not quite sure what-the-world I'm doing when it comes to the new Flash format.
Scrolling Text Box Scales Text (Flash 5)
We have created a scrolling text box that pulls text from an external .txt document. I have been through many detailed tutorials (which have helped out greatly) and have everything working properly except that when the text box is at the size we want it (W:318, H:221) the text is scaled down (to microscopic levels) to fit within that text box. If I scale the text box to a much smaller height (like W:318, H:36) then the text holds on to the attributes set to it (_sans font, size: 10) and the scrolling variables are applied and everything works like a charm. Tried everyhting I can think of and a project deadline is creeping fast. Any ideas as to how we can make that text box hold the font size while at the larger deminsion would be greatly appreciated.
Icky Jaggy Text In My Scrolling Text Box... Help Me Fix?
In my scrolling text box, I've called information from an external text file. Everything works fine but the text inside of the box is all jaggy and nasty compared to the text I made specifically in Flash. Is there anyway to fix this or am I just gonna have to bust my copy of Flash 5 in the eye?
Thanks
Mitch
Scrolling Text Over Dynamic Text Field?
hi everyone.
i have created a dynamic text field and it is getting data from the server. every 5 seconds or so that data gets updated and more and more data gets displayed onto the dynamic text field until it doesn't fit. can anyone tell me of a way to make my text (data) scroll vertically up my dynamic text field? in a loop format i mean.
it should be something like stock symbol.
thankx alot.
Dynamic Text Boxes And Scrolling Text....
Ive been trying to get my brians around sorting this out and im getting there really slowly but im still stuck with two problems. Im using this code to link with text to another web site from a dynamic text box. Heres the code:
<a href="http://www.henrymiller.org/"><font color="#999999">(www.henrymiller.org)</font></a>
Now what i cant seem to work out is how can i have it so that just that text in a paragraph is underlined. Now the second problem is i want it to open the link in a new window so it doesnt lead u away from the main site is this possible also and if so how would i go about doing that ?? I need to work this out as the site im doing is late due to lack off contact with my client and i just wanna get it sorted and out off my way. Any help would be mostly appreciated.
Thanks
Mental
Formating Text In Scrolling Text Field
I'm using a basic scrolling text box, in Flash MX, not using the scrolling component. I'm loading the text through a variable. Below is my code. I'm looking for a way to format the text in the text box. Eg. paragraph breaks, line breaks, and am having trouble getting the trademark symbol (TM) to show up in the text even though it is in the code. I've chosen to embed all fonts (need to use Gill Sans). I don't want to fomat it in html. Any direction on how to accomplish this?
onClipEvent (load) {
logoTextBox = ("This is the location of the text I'm trying to format");
}
onClipEvent (enterFrame) {
if (scrolling == "up") {
logoTextBox.scroll--;
}
if (scrolling == "down") {
logoTextBox.scroll++;
}
}
External Text Loaded Into A Scrolling Text Box?
hi,
I am working on a way to load text from an external txt file into a dynamic text box. The text box holds about 30 lines of text. At times I may change the txt file's content to included several more lines of text.
I plan to apply a scrolling effect to the text box. Is there a way to tell flash to stop scrolling once the last line of text is visible? (to avoid allowing the user to scroll to infinity)
Also, Is there a way to tell flash to show scroll buttons I create only if the number of characters extend beyond the capacity of the text box?
cheers!
jen
Scrolling Text: From Text File With HREFs
Greetings,
I have a script that will let me import a plain-ole text file into a window within an swf. The text file then scrolls. For my next trick, I should like to attach URL's to some of the text so when it scrolls, the user can click on a link and go the URL.
RESTRICTIONS:
1. It needs to be a ".txt" file becuase I would like it in it's easiest form for editing. So someone who knows nothing about html editors can make simple edits.
2. Although I'm a senior member on this site, I'm a neophyte when it comes to Actionscripting so assume I know nothing. I tell you that now so I hopefully save you time having to explain things to me 5 times when I'm trying to understand what you're writing when if I had told you from the beginning, you'd be able to focus your writing a different way. Does that make sense?
SAMPLE:
You can see the scroll I'm trying to add the hypertext links to at:
http://www.edpead.com go through the intro movie page and you'll see it on the next page that opens on the right side next to the word "HEADLINES".
Mark
Dynamic Text Scrolling With Text Field
Hello,
I've created a textbox that's getting dynamic text, I've got a font size set, but I notice if I change the dimensions of the field, the font size scales as well.
I'd like to be able to change the dimensions of the field in the prop. inspector without scaling the actual text size. What am I missing here?
Thanks,
Z
Several Text Styles In One Scrolling Text Clip.
Alright...
Question. Why is it that when I create a dynamic scrolling text box, I'm not allowed to use more than one font style? I tried applying a different font in one part of the body of text i was working on and when I preview the file, the part I changed remains in the same font as the rest of the clip.
So...basically...is there any way to have more than one text style in a dynamic scrolling text box?
|