1////////////////////////////////////////////////////////////////////////////////
2//
3//  ADOBE SYSTEMS INCORPORATED
4//  Copyright 2005-2007 Adobe Systems Incorporated
5//  All Rights Reserved.
6//
7//  NOTICE: Adobe permits you to use, modify, and distribute this file
8//  in accordance with the terms of the license agreement accompanying it.
9//
10////////////////////////////////////////////////////////////////////////////////
11
12package mx.core
13{
14
15/**
16 *  TextFieldAsset is a subclass of the flash.text.TextField class
17 *  which represents TextField symbols that you embed in a Flex
18 *  application from a SWF file produced by Flash.
19 *  It implements the IFlexDisplayObject interface, which makes it
20 *  possible for a TextFieldAsset to be displayed in an Image control,
21 *  or to be used as a container background or a component skin.
22 *
23 *  <p>This class is included in Flex for completeness, so that any kind
24 *  of symbol in a SWF file produced by Flash can be embedded
25 *  in a Flex application.
26 *  However, Flex applications do not typically use embedded TextFields.
27 *  Refer to more commonly-used asset classes such as BitmapAsset
28 *  for more information about how embedded assets work in Flex.</p>
29 */
30public class TextFieldAsset extends FlexTextField
31                            implements IFlexAsset, IFlexDisplayObject
32{
33    include "../core/Version.as";
34
35    //--------------------------------------------------------------------------
36    //
37    //  Constructor
38    //
39    //--------------------------------------------------------------------------
40
41    /**
42     *  Constructor.
43     */
44    public function TextFieldAsset()
45    {
46        super();
47
48        // Remember initial size as our measured size.
49        _measuredWidth = width;
50        _measuredHeight = height;
51    }
52
53    //--------------------------------------------------------------------------
54    //
55    //  Properties
56    //
57    //--------------------------------------------------------------------------
58
59    //----------------------------------
60    //  measuredHeight
61    //----------------------------------
62
63    /**
64     *  @private
65     *  Storage for the measuredHeight property.
66     */
67    private var _measuredHeight:Number;
68
69    /**
70     *  @inheritDoc
71     */
72    public function get measuredHeight():Number
73    {
74        return _measuredHeight;
75    }
76
77    //----------------------------------
78    //  measuredWidth
79    //----------------------------------
80
81    /**
82     *  @private
83     *  Storage for the measuredWidth property.
84     */
85    private var _measuredWidth:Number;
86
87    /**
88     *  @inheritDoc
89     */
90    public function get measuredWidth():Number
91    {
92        return _measuredWidth;
93    }
94
95    //--------------------------------------------------------------------------
96    //
97    //  Methods
98    //
99    //--------------------------------------------------------------------------
100
101    /**
102     *  @inheritDoc
103     */
104    public function move(x:Number, y:Number):void
105    {
106        this.x = x;
107        this.y = y;
108    }
109
110    /**
111     *  @inheritDoc
112     */
113    public function setActualSize(newWidth:Number, newHeight:Number):void
114    {
115        width = newWidth;
116        height = newHeight;
117    }
118}
119
120}
121