Avatar billede m-a-r-s Nybegynder
05. november 2003 - 14:41 Der er 2 kommentarer

component / UTF-8 problem

Jeg har fundet en component - et tekstbanner der importerer en extern txtfil og denne banner-component virker præcist som jeg har brug for ....

MEN .....
jeg har dog brug for at teksten unicodes for at æ,ø og å også skal kunne ses på en mac, men det "vil" banneret ikke "oversætte" - se eksempel her :  http://www.westend.dk/testen/bazooka/Headlab_Newsflasher_V1_1_2_TEST_2.swf

Ifølge "Klark kent" (www.klarkkent.de) som har lavet componenten skulle der ikke være nogle problemer med UTF-8 tekst, men det er der desværre :-(

NewsFlasher componenten kan hentes her:
http://www.flashcomponents.net/component.cfm?nav=2&id=81

Kan nogen hjælpe ??

På forhånd tak ;-)

Herunder er componentens koden - som er MEGET lang:

//Mars


/*  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
Avatar billede hoejrup Nybegynder
05. november 2003 - 15:19 #1
Måske kan du bruge informationen her: http://www.flashfaq.dk/spg.asp?faq=196

/per
Avatar billede m-a-r-s Nybegynder
16. april 2005 - 02:41 #2
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester