#1 (permalink)  
Old 08-15-2008, 09:31 PM
Junior Member
 
Join Date: Aug 2008
Posts: 4
Default Turn on/off description

Hi, guys! First off, I must say this is the great product!!! Thank you.
I have a question - is it possible to turn on/off description in Viewer according to the presence of it in XML file? Basically, if I have a detail desc (CDATA) entered in XML it will show in Viewer otherwise no description shape.

Tank you!
Reply With Quote
  #2 (permalink)  
Old 08-17-2008, 05:36 AM
Junior Member
 
Join Date: Aug 2008
Posts: 4
Default Solved it

Maybe not in perfect way for I'm not familiar with AS at all, but it works somehow :-)

in TextBox.as -> setData ->

insert

Code:
this._visible = true;
if (BodyTf.htmlText=="") { 
this._visible=false; 
}
Reply With Quote
  #3 (permalink)  
Old 08-17-2008, 06:17 AM
Junior Member
 
Join Date: Aug 2008
Posts: 7
Default

You could do this so you don't see any "undefined" showing up in the text fields but you can leave either the title or description blank if you feel like it. Also if the title and description are both blank the box will not show.

Code:
function gf() {
	with (this._parent) {
		//TitleTf.htmlText = node.attributes.name;
		if(node.attributes.name) {
			TitleTf.htmlText = node.attributes.name;
		}
		else {
			TitleTf.htmlText = "";
		}
		if(node.firstChild.nodeValue) {
			BodyTf.htmlText = node.firstChild.nodeValue;
		}
		else {
			BodyTf.htmlText = "";
		}
		BodyMc._y = FTop._y+fh;
		checkSlider();
	}
}
if (TitleMc._alpha>0) {
	Tweener.addTween(TitleMc, {_alpha:0, transition:"easeOutSine", time:wait});
	Tweener.addTween(BodyMc, {_alpha:0, transition:"easeOutSine", time:wait, onComplete:gf});
} else {
	//TitleTf.htmlText = node.attributes.name;
	if(node.attributes.name) {
		TitleTf.htmlText = node.attributes.name;
	}
	else {
		TitleTf.htmlText = "";
	}
	//BodyTf.htmlText = node.firstChild.nodeValue;
	if(node.firstChild.nodeValue) {
		BodyTf.htmlText = node.firstChild.nodeValue;
	}
	else {
		BodyTf.htmlText = "";
	}
	BodyMc._y = FTop._y+fh;
	checkSlider();
	wait = 0;
}
this._visible = true;
if (TitleTf.htmlText == "" && BodyTf.htmlText == "") { 
	this._visible = false; 
}
-scottyFlasher
Reply With Quote
  #4 (permalink)  
Old 08-23-2008, 02:50 AM
Junior Member
 
Join Date: Aug 2008
Posts: 4
Default

Thank you!
Reply With Quote
Reply

Tags
cdata, description, turn off, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.