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!
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!