Text problems


hello,

 

i'm working in director since 2 weeks , learn bit bit new parts.

now have 1 problem displaying text in sprite.

the situation follow:

i read data xml file (this necessary because text variable , need easy editable)

so read xml file in , process sprite.

the problem have special characters not recognized , mess total text.

 

some of code

 

on updateslidedata (me,data)

  member("t_slideoutputtext").text=""

  if voidp(data) exit

  body = "<html><body bgcolor="&quote&"#ffffff"&quote&"><font color="&quote&"#2c2f64"&quote&" size="&quote&"4"&quote&" face="&quote&"arial"&quote&">"

  lineheights =[]

  previousline =1

  txt = ""

  id = 1

  if voidp(data[#tcs])

    member("t_slideoutputtext").html = ""

    return data

  end if

  if data[#tcs] <> "" then

    repeat in data[#tcs]

      txtfromslide =  i[#data]

     

      case i[#type] of

         

        1,11:-- type 1 : normal title

          txt = txt&"<b>"&txtfromslide&"</b><br />"

        2,12:-- type 2 : -->

          txt = txt&"-> "&txtfromslide&"<br />"

        3,13:-- type 3 : vb

          txt = txt&" "&txtfromslide&"<br />"

        4,14:-- type4 : 4

          txt = txt&""&txtfromslide&"<br />"

        9:

          txt = txt&" "&"<br />"

      end case

      txt = me.cleantxt(txt)

      txt =  gstring.cleanrepeatedchar(txt)

      -- if txt[2] = true alert ("error" &txt)

      txt = txt[1]

 

on cleanrepeatedchar me,var

  if voidp(var) return ["",true]

  repaired = false

  return [var,repaired]

end

 

on cleantxt me,txt

  if not voidp(txt)

    if txt<>"" then

      txt = str_regreplace("&apos;","'",txt)

      txt = str_regreplace("&deg;","°",txt)

      txt = str_regreplace(return,"<br />",txt)

      txt = str_regreplace("\[br\]","<br />",txt)

      txt = str_regreplace("&amp;","&",txt)

      txt = str_regreplace("&apos;","'",txt)

      if myeditor=false then

        txt = gcdcontent.createtxthtml(txt)

      else

        return txt

      end if

      --     

      --      txt = str_regreplace("&amp;","&",txt)

      --      txt = str_regreplace("\[br\]","<br />",txt)

      --      txt = str_regreplace(return,"<br />",txt)

    end if

  end if

  return txt

end

 

in underlined code special characters become unreadable.

what solution problem ?

can provide example of goes in, comes out, , what's going wrong?



More discussions in Director Basics


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support