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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text with HTML 1

Status
Not open for further replies.

saxy46

Technical User
May 19, 2005
9
US
Hey Everyone,

I am still learning the new advances of flash...I really havent messed around with flash since Flash 5 and lots changed!

Anyway, I am building a simple mp3 player that I found a tutorial on the web for. My problemn is that in the text for the information, I want to make the text render html so I can do italics, bold, etc. But I cant get it working.
Any ideas?

here is my code from the tutorials:
in the fla file:
*******************************************************
stop();
myData = new LoadVars();
myData.onLoad = function() {
s = new Sound();
s.loadSound(this.thesong,true);
songtitle.text = this.songtitle;
songartist.text =this.songartist;
songinfo.text =this.songinfo;
loadBar.loader._width=0;
setInterval(getTime,100);
setInterval(videoStatus,100);
};
function getTime(){
theposition=s.position / 1000;
theduration=s.duration / 1000;
amountLoaded=(s.getBytesLoaded() / s.getBytesTotal()) * 100;
totalLoaded.text=amountLoaded;
songtime.text=theposition;
totalduration.text=theduration;
loopme=myData.doloop;
if(loopme == "yes"){
if(theposition == theduration){
theposition=0;
s = new Sound();
s.loadSound(myData.thesong,true);
}
}
else if(loopme == "no"){
if(theposition == theduration){
s.start(0);
s.stop();
}
}
}
function videoStatus() {
amountLoaded2 = theposition / theduration;
loadBar.loader._width = amountLoaded2 * 75;
}
myData.load("rock1.text");
vol = 100;
laeuft = 0;
pulsar._visible = 0;
pulsar._xscale = vol + 15;
pulsar._yscale = vol + 15;
stopButton1.onPress = function() {
s.start(0);
s.stop();
laeuft = 0;
};
playButton1.onPress = function() {
if (laeuft == 0) {
stopAllSounds();
loadMovie("eq2.swf", "_level0.eq2");
_root.eq_off.gotoAndStop("off");
s.start(0);
laeuft = 1;
} // end if
};
volDown.onPress = function() {
vol = vol - 10;
if (vol<0) {
vol = 0;
} // end if
s.setVolume(vol);
};
volUp.onPress = function(){
vol = vol + 10;
if (vol > 100)
{
vol = 100;
} // end if
s.setVolume(vol);
};
I have 2 text boxs, both dynamic with render as html checked with the variables of songtitle and songinfo.

Then my text file, the code looks like:
&thesong=Song1.mp3&songtitle=<b>Song</b> Name&songinfo=<I>Artist</I>. Song Information&doloop=no

**********************************************
As you can expect, it just renders out the text with the <tags> instead of making them bold or italic. All of the coding works, just not the html part of it. Any ideas? Need any more information? I'm not sure if there is a simple solution like html=true type of thing without rewriting the entire thing.

Thanks for any help or suggestions!
 
Has to be htmlText. Example:

Code:
songTitle.htmlText = this.songTitle;

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanx Pxl!

That worked! Glad it was something simple!

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top