GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SWF::Builder::Character::EditText(3) User Contributed Perl Documentation SWF::Builder::Character::EditText(3)

SWF::Builder::Character::EditText - SWF dynamic editable text object

  my $text = $mc->new_dynamic_text( $font )
    ->size(10)
    ->color('000000')
    ->text('This is a text.');

  my $text_i = $text->place;

  my $field = $mc->new_input_field;
  $field->place;

This module creates dynamic editable text objects, which can be changed at playing time.

$etext = $mc->new_edit_text( [$font, $text] )
returns a new basic dynamic editable text object. It has interfaces to raw DefineEditText tag. $font is an SWF::Builder::Font object.
$etext->font( $font )
applies the font to the text. $font is an SWF::Builder::Font object. Unlike static text, the font is applied to the whole text. If the text will be changed in the playing time, you should add glyph data of all characters which will be used to the font by $font->add_glyph or turn off the embed flag of the font.
$etext->size( $size )
sets a font size to $size in pixel. Unlike static text, the font size of the whole text is changed.
$etext->color( $color )
sets color of the text. The color can take a six or eight-figure hexadecimal string, an array reference of R, G, B, and optional alpha value, an array reference of named parameters such as [Red => 255], and SWF::Element::RGB/RGBA object. Unlike static text, the color is applied to the whole text.
$etext->text( $string )
writes the $string.
$etext->leading( $leading )
sets the vertical distance between the lines in pixel.
$etext->box_size( $width, $height )
sets the bounding box of the text and stops auto-sizing the box. When either $width or $height is undef, it is unchanged. Fixing bounding box may cause unexpected text clipping. You should set DefineEditText flag Multiline and/or WordWrap. See SWF::Element.
$etext->draw_border
draws the border.
$etext->align( 'left' / 'right' / 'center' / 'justify' )
sets the text alignment.
$etext->methos for SWF::Element::Tag::DefineEditText
You can control details of the texts to call methods for DefineEditText tag. See SWF::Element.

The following objects are inheritants of the basic dynamic editable text. These are preset some proper flags of DefineEditText tag.
$dtext = $mc->new_dynamic_text( [$font, $text] )
returns a new dynamic text. It is read-only, multiline text enabled, and auto-sized its bounding box.
$htmltext = $mc->new_html_text( [$html] )
returns a new HTML text. It is read-only, multiline text enabled, and auto-sized its bounding box. The text is treated as a subset of HTML. Supported tags are <a>, <b>, <br>, <font>, <i>, <img>, <li>, <p>, <span>, <u>, and two special tags, <tab> and <textformat>. See Macromedia Flash File Format Specification and ActionScript Reference Guide for further information.
$htmltext->use_font( $font, ... )
tells $htmltext what fonts are used in the HTML. In general, upright, italic, bold, and bold italic font are in the different TrueType font files. You should prepare 2-4 fonts if you use <b> and <i> tags, like this:

 my $fp = $ENV{SYSTEMROOT}.'/fonts';  # for Windows.
 my $font = $m->new_font("$fp/arial.ttf");
 $font->add_glyph('a', 'z');
 my $fonti = $m->new_font("$fp/ariali.ttf");
 $fonti->add_glyph('a', 'z');
 my $ht = $m->new_html_text;
 $ht->text('<font face="arial">test <i>string</i></font>');
 $ht->use_font($font, $fonti);
    
$mc->new_text_area( $width, $height )
returns a new editable text area. It takes area width and height in pixel.
$mc->new_input_field( [$length] )
returns a new one-line input field. $length is a max length of input string.
$mc->new_password_field( [$length] )
returns a new one-line password field. $length is a max length of input string.

Copyright 2004 Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.