newsFlasher component / utf-8 problem

Hi

Here on kirupa I found a newsFlasher component tutorial (http://www.kirupa.com/developer/mx/newsflasher.htm ) and the component works quit well … BUT I need to import the external text as unicoded (UTF-8) because of some special danish characters (æ, ø, å) and I cant make the component “translate” the unicoded text.

I hope I make my self clear ?!

Can anyone help me. please??

Greetings from Lars, Copenhagen, www.westend.dk

  1. Make sure you save the text file as UTF-8 format, that can be easily done in Notepad.
  2. Make sure you select a font which supports unicode for your dynamic text area. Arial, Times, Courier New are standard ones.

Hi Phat7

The font (Verdana) supports unicode and the text is generated af UTF-8 by a PHP-script ( utf8_decode($string); )

Is it possible that the AS makes it impossible ??

Here is the LONG code:
/* Headlab NewsFlasher V1.1 (updated 6/12/2002)
Author: Mario “Klark Kent” Laugell
contact: kent@klarkkent.de
URL/Business: http://www.headlab.de
URL/Private: http://www.klarkkent.de
/
// -----------------------------------------------------
#initclip
// initialize the NewsTickerClass----------->
NewsTickerClass = function () {
this.init();
};
// register the Object-Class with the Movieclip------------->
Object.registerClass(“hlnewsticker”, NewsTickerClass);
// define INITialisation-function------------------->
NewsTickerClass.prototype.init = function() {
// get rid of the cross that helped positioning —>
this.crossMC._visible = false;
// setting up a counter ---------------------------------->
this.count = 0;
// dynamic Textfield-Properties ------------------------>
this.myTextTarget = this._parent[this._targetInstanceName];
this.outerxPos1 = (this.aniRangeX/2)+(this.myTextTarget._x+this.myTextTarget._width);
this.outerxPos2 = (this.aniRangeX/2)-(this.myTextTarget._x+this.myTextTarget._width);
this.outeryPos1 = (this.aniRangeY/2)+(this.myTextTarget._y+this.myTextTarget._height);
this.outeryPos2 = (-this.aniRangeY/2)-(this.myTextTarget._y-this.myTextTarget._height);
this.centerYpos = this.myTextTarget._y;
this.centerXpos = this.myTextTarget._x;
this.animType = 0;
//check the types of animation for the ‘ifs’ in the function theMoveOut -->
if (this.xAnim == true) {
this.animType += 1;
}
if (this.yAnim == true) {
this.animType += 2;
}
// Animation-Properties -------------------------------->
this.brakespeed = 5;
this.myTime = 0;
this.beginLoad();
};
// function to load the textfile and check if loaded ----->
NewsTickerClass.prototype.beginLoad = function() {
loadVariables(this.targetFile, this);
this.onData = function() {
if (this.content != “”) {
this.splitArray();
delete this.onData;
}
};
};
// function to split the Textfile into an Array ----->
NewsTickerClass.prototype.splitArray = function() {
//create an array that will hold the single texlines.---->
this.myArray = new Array();
//splits the text sepparated by “,” -->
this.myArray = this.content.split(“XXX”);// |
this.setTextfield();
};
// function to set the Textfield and ----->
NewsTickerClass.prototype.setTextfield = function() {
if (this.myTextTarget.html == true){
this.myTextTarget.htmlText = this.myArray[this.count];
}else{
this.myTextTarget.text = this.myArray[this.count];
}
if (this.yAnim == true) {
this.myTextTarget._y = this.outeryPos1;
}
if (this.xAnim == true) {
this.myTextTarget._x = this.outerxPos1;
}
// reset accelspeed -->
this.accelspeed = 0;
this.theMoveIn();
};
// function for the Move-In Animation ----->
NewsTickerClass.prototype.theMoveIn = function() {
this.onEnterFrame = function() {
if (this.yAnim == true && this.centerYpos<this.myTextTarget._y) {
this.myTextTarget._y += ((this.centerYpos-this.myTextTarget._y)/this.brakespeed)/this.brake;
}
if (this.xAnim == true && this.centerXpos<this.myTextTarget._x) {
this.myTextTarget._x += ((this.centerXpos-this.myTextTarget._x)/this.brakespeed)/this.brake;
updateAfterEvent();
}
if (this.centerYpos>=this.myTextTarget._y-0.5 && this.centerXpos>=this.myTextTarget._x-0.5) {
delete this.onEnterFrame;
this.theStopInterval();
}
};
};
// function that lets the Text stand still for the amount of Time in seconds,
// that a user defined in “stopTime” ----->
NewsTickerClass.prototype.theStopInterval = function() {
delete this.onEnterFrame;
this.intervalHandle = setInterval(this, “onInterval”, 1000
this.stopTime);
};
NewsTickerClass.prototype.onInterval = function() {
clearInterval(this.intervalHandle);
this.theMoveOut();
};
// function for the Move-Out Animation ----->
NewsTickerClass.prototype.theMoveOut = function() {
this.onEnterFrame = function() {
this.accelspeed += this.acceleration;
if (this.xAnim == true) {
this.myTextTarget._x -= this.accelspeed;
}
if (this.yAnim == true) {
this.myTextTarget._y -= this.accelspeed;
}
switch (this.animType) {
case 1 :
if (this.outerxPos2>this.myTextTarget._x) {
this.count++;
if (this.count>=this.myArray.length) {
this.count = 0;
}
delete this.onEnterFrame;
// call the setTextfield function again
// this is where the whole thing starts looping
this.setTextfield();
}
break;
case 2 :
if (this.outeryPos2>this.myTextTarget._y) {
this.count++;
if (this.count>=this.myArray.length) {
this.count = 0;
}
delete this.onEnterFrame;
// call the setTextfield function again
// this is where the whole thing starts looping
this.setTextfield();
}
break;
case 3 :
if (this.outeryPos2>this.myTextTarget._y && this.outerxPos2>this.myTextTarget._x) {
this.count++;
if (this.count>=this.myArray.length) {
this.count = 0;
}
// call the setTextfield function again
// this is where the whole thing starts looping
delete this.onEnterFrame;
this.setTextfield();
}
break;
}
};
};
#endinitclip