Categories

XML Flash. ¿Cómo activar soporte de RTL?

Chris Diaz marzo 14, 2012
No votes yet.
Please wait...

Este tutorial contiene instrucciones para convertir plantilla XML Flash a RTL.

1) Abra el fichero FLA y encuentre la configuración de File >> Publish (Fichero > Publicar) y elija la pestaña de Flash, a continuación, configure Flash Player a la versión 10 o superior.

2) En el fichero FLA en Flash CS5 o Flash CS 5.5 busque sus tipos de letra en la biblioteca, haga doble clic sobre ella y escoja la pestaña de acciones.

Usted encontrará varias casillas de verificación como “export for ActionScript” (exportar a ActionScript) y “export in frame”(exportación en frame) – hay que marcar ambas y elegir “TFL” en Outline Format (formato de esquema) en la parte superior de la pestaña de ActionScript.

Es muy importante hacer esto para todos los tipos de letra de la plantilla.

3) Abra su fichero “main.as” y agregue la siguiente función en la parte superior:

private function createTLF(_textField:TextField, _content:String):void
  {
  var TLF_Text:TLFTextField = new TLFTextField();
  var newTextFormat:TextFormat = new TextFormat ;
  newTextFormat = _textField.getTextFormat();
  TLF_Text.antiAliasType = _textField.antiAliasType;
  TLF_Text.embedFonts = _textField.embedFonts;
  TLF_Text.width = _textField.width;
  TLF_Text.x = _textField.x;
  TLF_Text.y = _textField.y;
  TLF_Text.rotation = _textField.rotation;
  if (_textField.multiline)
  {
  TLF_Text.height = _textField.textHeight + newTextFormat.size + newTextFormat.leading;
  }
  TLF_Text.setTextFormat(newTextFormat);
  TLF_Text.htmlText = _content;
  MovieClip(_textField.parent).addChild(TLF_Text);
  MovieClip(_textField.parent).removeChild(_textField);
}

3) Regularmente campos de texto tienen esta función en el fichero AS:

public function textContent(nameText:TextField, numText:Number)
  {
  nameText.htmlText = websiteXML.pages.titlePage[linkPage].texts.pageText[numText].text();
  nameText.addEventListener( TextEvent.LINK, textLinkClick );
  nameText.mouseWheelEnabled = false;
  nameText.condenseWhite = true;
  if (nameText.multiline)
  {
  var fmt:TextFormat = nameText.getTextFormat();
  nameText.height = nameText.textHeight + fmt.size + fmt.leading;
  }
  else
  {
  nameText.autoSize = TextFieldAutoSize.LEFT;
  }
}

Usted debe llamar a la función de TFL en el final y hacer que ella se muestre así:

public function textContent(nameText:TextField, numText:Number)
  {
  nameText.htmlText = websiteXML.pages.titlePage[linkPage].texts.pageText[numText].text();
  nameText.addEventListener( TextEvent.LINK, textLinkClick );
  nameText.mouseWheelEnabled = false;
  nameText.condenseWhite = true;
  if (nameText.multiline)
  {
  var fmt:TextFormat = nameText.getTextFormat();
  nameText.height = nameText.textHeight + fmt.size + fmt.leading;
  }
  else
  {
  nameText.autoSize = TextFieldAutoSize.LEFT;
  }
createTLF(nameText, nameText.htmlText);
}

Esto tiene la siguiente varibale que puede variar dependiendo del texto donde se puede ponerlo, nuestra variable de texto es: nameText, por lo que si tenemos “readmoreText”, entonces nuestra función puede tener este aspecto:

  createTLF(readmoreText, readmoreText.htmlText);
Esta entrada fue publicada el Trabajar con XML Flash y etiquetada flash, RTL, XML. Agregar enlace permanente a marcadores.

Submit a ticket

Si Usted todavía no puede encontrar un tutorial suficiente para arreglar su problema, por favor use el siguiente enlace para enviar un ticket a nuestro equipo de soporte técnico. Nosotros enviaremos nuestra respuesta dentro de próximas 24 horas: Enviar un ticket