{"id":15747,"date":"2012-03-14T07:08:47","date_gmt":"2012-03-14T11:08:47","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=15747"},"modified":"2015-09-18T07:09:13","modified_gmt":"2015-09-18T11:09:13","slug":"xml-flash-how-to-enable-rtl-support","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/xml-flash-how-to-enable-rtl-support.html","title":{"rendered":"XML Flash. How to enable RTL support"},"content":{"rendered":"<p>This tutorial shows how to convert XML Flash template to RTL. <\/p>\r\n<p>1) Open your FLA file and go to File &gt;&gt; Publish settings and select Flash tab, then set Flash player to version 10 or higher<\/p>\r\n<p>2) In the FLA file in Flash CS5 or Flash CS 5.5 and locate your fonts in the library, doubleclick it and select actions tab <\/p>\r\n\r\n<a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_1.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_1-300x187.jpg\" alt=\"\" title=\"img_1\" width=\"300\" height=\"187\" class=\"aligncenter size-medium wp-image-15749\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_1-300x187.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_1.jpg 916w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n  <p> you will be able to see several check boxes like \u201cexport for ActionScript\u201d and \u201cexport in frame 1? \u2013 you need to check both and select \u201cTFL\u201d in Outline Format at the top of the actionscript tab. <\/p>\r\n  \r\n<a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_2.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_2-300x188.jpg\" alt=\"\" title=\"img_2\" width=\"300\" height=\"188\" class=\"aligncenter size-medium wp-image-15748\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_2-300x188.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2012\/03\/img_2.jpg 918w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<p>It is very important to do this step for all the fonts in the template.<\/p>\r\n\r\n<p>3) Open you \u201cmain.as\u201d file and add the following function at the top:<\/p>\r\n\r\n<pre class=\"brush:as3\">\r\nprivate function createTLF(_textField:TextField, _content:String):void\r\n  {\r\n  var TLF_Text:TLFTextField = new TLFTextField();\r\n  var newTextFormat:TextFormat = new TextFormat ;\r\n  newTextFormat = _textField.getTextFormat();\r\n  TLF_Text.antiAliasType = _textField.antiAliasType;\r\n  TLF_Text.embedFonts = _textField.embedFonts;\r\n  TLF_Text.width = _textField.width;\r\n  TLF_Text.x = _textField.x;\r\n  TLF_Text.y = _textField.y;\r\n  TLF_Text.rotation = _textField.rotation;\r\n  if (_textField.multiline)\r\n  {\r\n  TLF_Text.height = _textField.textHeight + newTextFormat.size + newTextFormat.leading;\r\n  }\r\n  TLF_Text.setTextFormat(newTextFormat);\r\n  TLF_Text.htmlText = _content;\r\n  MovieClip(_textField.parent).addChild(TLF_Text);\r\n  MovieClip(_textField.parent).removeChild(_textField);\r\n}<\/pre>\r\n\r\n<p>3) Regularly text fields have such function in AS file:<\/p>\r\n\r\n<pre class=\"brush:as3\">\r\npublic function textContent(nameText:TextField, numText:Number)\r\n  {\r\n  nameText.htmlText = websiteXML.pages.titlePage[linkPage].texts.pageText[numText].text();\r\n  nameText.addEventListener( TextEvent.LINK, textLinkClick );\r\n  nameText.mouseWheelEnabled = false;\r\n  nameText.condenseWhite = true;\r\n  if (nameText.multiline)\r\n  {\r\n  var fmt:TextFormat = nameText.getTextFormat();\r\n  nameText.height = nameText.textHeight + fmt.size + fmt.leading;\r\n  }\r\n  else\r\n  {\r\n  nameText.autoSize = TextFieldAutoSize.LEFT;\r\n  }\r\n}<\/pre>\r\n\r\n<p>You should call TFL function at the end and make it look like:<\/p>\r\n\r\n<pre class=\"brush:as3\">\r\npublic function textContent(nameText:TextField, numText:Number)\r\n  {\r\n  nameText.htmlText = websiteXML.pages.titlePage[linkPage].texts.pageText[numText].text();\r\n  nameText.addEventListener( TextEvent.LINK, textLinkClick );\r\n  nameText.mouseWheelEnabled = false;\r\n  nameText.condenseWhite = true;\r\n  if (nameText.multiline)\r\n  {\r\n  var fmt:TextFormat = nameText.getTextFormat();\r\n  nameText.height = nameText.textHeight + fmt.size + fmt.leading;\r\n  }\r\n  else\r\n  {\r\n  nameText.autoSize = TextFieldAutoSize.LEFT;\r\n  }\r\ncreateTLF(nameText, nameText.htmlText);\r\n}<\/pre>\r\n\r\n<p>This like has the following varibale that may differ depending on the text you implement it, as you can see our currect text variable is: nameText, so if we have \u201creadmoreText\u201d, then our function would look like:\r\n\r\n<pre class=\"brush:as3\">  createTLF(readmoreText, readmoreText.htmlText);<\/pre>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to convert XML Flash template to RTL.<\/p>\n","protected":false},"author":2,"featured_media":15871,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[287],"tags":[486,1160,570],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/15747"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=15747"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/15747\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/15871"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=15747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=15747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=15747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}