Skip to main content
khaledgar
Known Participant
October 21, 2009
Question

textlayout dont work correctly with the browser

  • October 21, 2009
  • 5 replies
  • 1529 views

hello i finished my website and i publish it but when i open th HTML page the text in the textLayout component does not appear but if i run run the swf it work perfectely i dont know why . i am using flash CS4 the text is arabic it came from an external text file

thank you for your help

This topic has been closed for replies.

5 replies

khaledgar
khaledgarAuthor
Known Participant
November 11, 2009

//Load the arabic text

homePath = "home_ar.txt";
homeLoader.load(new URLRequest("home/" + homePath));

homeLoader.addEventListener(Event.COMPLETE, onComplete);

function onComplete(e:Event):void
{
str = e.target.data;
home_mc.home_txt.xmlText = str;
}

the content of the home_ar.txt file:

<?xml version="1.0" encoding="utf-8"?>
<flow:TextFlow paddingRight="5" paddingLeft="5" paddingBottom="5" paddingTop="5" whiteSpaceCollapse="preserve" xmlns:flow="http://ns.adobe.com/textLayout/2008">
<flow:p direction="rtl" textAlign="justify" marginLeft="10" marginRight="10" textIndent="20" textAlignLast="right">
<flow:span fontFamily="Arial" fontSize="30">بدون أقنعة....... و لا ستائر نتواصل معكم من بوابة    موقعنا.أهلا بكم ضيوفا بيننا.... فابحروا....فالجو مطمئن والطريق سالكة ......</flow:span></flow:p>
<flow:p direction="rtl" textAlign="justify" marginLeft="10" marginRight="10" textIndent="20" textAlignLast="right">
<flow:span fontFamily="Arial" fontSize="30">و نحن في إنتظاركم على ضفاف مسرح القطار</flow:span></flow:p>
</flow:TextFlow>

i load the content from a simple txt file then pass it into a String then pass it as the xmltext of text layout framework component.

because with the arabic caracter a had an error in the encoding it didn't load correctly but with this sollution it work in the swf but in the browser not working

khaledgar
khaledgarAuthor
Known Participant
October 28, 2009

but i test it and the swf works well , but in the browser not

Daniel 0_o
Known Participant
October 28, 2009

before we start speculate we'll need more info.

your troubleshoot: u tried other language?

some code sample can help

Daniel 0_o
Known Participant
October 24, 2009

hi,

I have similar issue.

the text is loaded from the XML however without the scrollBar, if i execute the SWF i see the scrollBar.

if your problem is related to the xml not loading properly, try to adding the next lines (to your code),

this way you can make sure the xml loaded fine or if its XML issue

//checking for loader error

loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);

//inform

function errorHandler(e:IOErrorEvent):void

{

myTextLayout.xmlText = "<?xml version=\"1.0\" encoding=\"utf-8\"?><flow:TextFlow xmlns:flow=\"http://ns.adobe.com/textLayout/2008\" fontSize=\"14\">" + IOErrorEvent(e).text + "</flow:TextFlow>";

stat.text = "fail";

}

another issue might be the font needed to be embedded.

Daniel

khaledgar
khaledgarAuthor
Known Participant
October 26, 2009

i wrote code for the IOError from the begginig swf work perfect but in the browser nop

Daniel 0_o
Known Participant
October 26, 2009

have u tried plain engilsh. to make sure its not a font issue.

is it XML file?

can u post the header of the text/xml file?

daniel

khaledgar
khaledgarAuthor
Known Participant
October 24, 2009

i try to run the swf and it work perfectly but in the browser the text don't apear i don't know why , where is the error

i will try to upload it in  the server

Adobe Employee
October 21, 2009

Might want to make sure your browser plugin is a FlashPlayer 10 plugin.

Richard

khaledgar
khaledgarAuthor
Known Participant
October 21, 2009

yes it is and i tested it in 3 browsers firefox IE8 and safari and the problem is the same

i ama sure the plugin is flash player 10

Adobe Employee
October 23, 2009

Haven't seen that happen before.   Is your external XML file failing to load?  Can't tell for sure.  Flash won't load local files unless the swf is trusted.  Have you tried to host the html and swf on a webserver?

RIchard