Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar stops working XML

Status
Not open for further replies.

katherinep

Programmer
Sep 18, 2003
49
AU
Hello,

Can anyone help me please!!??

I have got a application split into 2 swfs. In one swf I have 2 buttons and in the other I have a text box with a scroll bar. When you click on one of the buttons it reads the relevent information from the corresponding node in the XML and displays it in the text box. Only thing is the scrollbar stops working.

I understand this is to do with it dynamically loading the text and then the scroll bar doesn't know whether to be active or not. I have tried different ways like using a scrollPane, but the same happens, making my own scroll bar and also trying to get it to only show the scroll bars when the text exceeds the text box size, which again works but the scroll bar doesn't do anything! Has anyone got any ideas? It really needs to read it from the XML as there are attributes that need to go with the text.

Thanks in advance!

Katherine
 
Can you post your .fla and/or your code? Also what version of Flash are you using?

Wow JT that almost looked like you knew what you were doing!
 
Thanks for the quick reply! Won't be able to post my fla but its a simple bit of code, which is probably the problem! I’m using Flash MX.

Basically when the user presses a button it goes to the node and puts the value in the text box.

The textbox is named desctext and its in a swf previously loaded into level 40.

Code:
function update(newNode) {
	_level40.titletext = newNode.attributes.title;
	_level40.desctext = newNode.firstChild.nodeValue;
	
}

Any ideas, how I can get the scroll bar to see there is too much text and to activate?
 
When you drag the scollbar out of the library you have to drag it over the text box you want it to be attached to. Just out of curiosity... did you do that?

Wow JT that almost looked like you knew what you were doing!
 
yes I did do that, and I double checked in the properties that it the 'TargetTextField' is desctext.
 
if mx scrollbar will activate as long as something like this added (dont forget paths if needed)

my_bar.setScrollTarget(my_textfield);


sometimes aint enough just to set properties
 
Hi Katherine
I am a newbie to Flash, so I may be leading you on a wild goose-chase here, but we experienced a similar problem.

We have content that has been loaded into scrollpanes. The scrollpane was displaying, but the content within it was "missing".

The solution was in the player version and not in the code.
We found that the user must use player version 7.0 r19.

Hope this helps
 
Hi all I have the same problem I am using flash mx 2004 with an xml connector and scrollpane and wen I run the file it doesnt let me use the scrollbars, please help!

Thanks


W i K
 
OK I have solved my own problem! Thanks everyone for your help!

Heres what I did:

In the FLA to show the text:

I have a movieclip called 'infobox_mc' inside this movie clip I have a dynamic text box called 'content_txt' and a scroll bar that has 'content_txt' as its Target TextField.

In the first and only frame I have the following code
Code:
//set up the XML
my_xml = new XML();
my_xml.onLoad = startShow;
my_xml.load("xml/test.xml");
my_xml.ignoreWhite = true;

//this function loads text when the text box swf starts
function startShow(success) {
	if (success == true) {
        rootNode = my_xml.firstChild.firstChild.firstChild;
	update(rootNode);
	}
}

// go to the Node I want to pull the data from
//diplay it in the text box

function update(newNode) {
	the_text = newNode.firstChild.nodeValue;
	infobox_mc.content_txt.text = this.the_text;

}

//this is a function called from my other swf
//which goes to the node it wants the info from and then 
//runs the function 'update' with the Node I want

function general() {
  	theInfo = my_xml.firstChild.firstChild.firstChild;
	update(theInfo);
};

//this function is triggered by another button which goes to a different Nodes information

function next() {
	nextInfo = my_xml.firstChild.firstChild.nextSibling.firstChild;
		update(nextInfo);
};

In the FLA with the buttons (where the swf with the text box is on level 40:

Code:
top_wire.onRelease = function() {
	_level40.general();
};

I hope I have remembered anything, any questions leave a post and I will try to help!

Thanks,

Katherine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top