The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 3 of 3

Thread: Control TextField

  1. #1

    Control TextField

    Good day;

    I have been hammering at this for some time now, and it is getting a little frustrating.

    1. I have a document class that adds a TextField.

    2. The Doc class then adds another custom class (MovieClip).

    3. Inside that custom class (MovieClip) is a button with an addEventListener that needs to update the TextField on the main stage (or root).

    I have tried so many possible solutions that I am not going to list them here, I am sure I must be doing something fundamentally wrong...

  2. #2
    if you post your code that would be clearer, one of the methods to call the function from a helper class is sending the function name as a parameter to the helper class
    say you have a class constructor function

    public function MenuClass(str:String='menu.xml', __btnMoveSpeed:Number = 3 , __func:Function = null )

    __func paramater sends the function to the externall class so you could simply call it from the class

    hope this helps
    My Current Projects, a language school.
    İngilizce Kursu Istanbul

    hummer limo London

  3. #3



    import flash.text.TextField;
    import flash.display.MovieClip;

    public class DocClass extends MovieClip
    public var TF:TextField = new TextField();
    public var Holder:MovieClip = new MovieClip();
    public var CM:CustomMC = new CustomMC();

    function docClass():void
    TF.text = "cup"

    addChild(Holder); //Blank MC used for resizing//


    //CUSTOM MC//

    import flash.text.TextField;
    import flash.display.MovieClip;

    public class CustomMC extends MovieClip;

    public var Page:MovieClip = new MovieClip();
    public var Cancel:TextField = new TextField();

    function CustomMC():void

    Cancel.addEventListener(MouseEvent.CLICK, CloseWindow);
    function CloseWindow():void
    root.TF.text = "coffee"; //Option One - No Joy//
    stage.TF.text = "coffee"; //Option Two - No Joy//
    trace(Cancel.parent.parent.parent); // No Joy //
    MovieClip(root).TF.text = "coffee"; // No Joy //


    This is the basic structure, that hopefully clears up the question. I am not sure if I am missing something simple, or if you just can access an absolute path of the entire movie.

    I pulled this off the top off my head, so if there are small obvious issues, please ignore them, as they are likely a typo, and please focus on the structure and the means of communication between the custom class and the root (absolute path).

    Thanks in advance.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012