A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Question about referencing objects in the frame, and controlling them in AS2

  1. #1
    Junior Member
    Join Date
    Apr 2024

    Question about referencing objects in the frame, and controlling them in AS2

    So I made a text object and set its type to Dynamic in its properties. I now can give it 2 different names (both of which can be set in the object's properties) that can theoretically be used to reference the object for doing things like setting the text via AS2 code.

    First, I can set its Var name (to something like MyVar). This allows it (or at least its text content) to be treated like a simple variable. This seems to be the easiest way. For example I can do this in the main code of frame-1:
    MyVar = "ABCD"
    Secondly, it looks like I can set a property called Instance Name. For example, I can set it to something like MyTextBox. However, I do not have any idea how to reference this in the AS2 code. I suspect I can use this to do all kinds of things, not just setting its text content, such as resizing or moving the text box. Can someone help me with this?

  2. #2
    Junior Member
    Join Date
    Feb 2022
    instance name for textbox is treated almost the same as instance name for Movieclip.
    Only properties are different.
    if you want to change the contents of textbox, you should type:

    myTextbox.text = "my text".

    complete list of properties can be found here.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center