Change a text field on the timeline from a class

Hi,
I need some help in changing the content of text fields that are on the stage of the main timeline from within an external class. I have created a countdown timer which is called from the Document Class. I think it is a problem with the scope of the variable but I can't work it out.
Main Document Class:
package
    import flash.display.*;
    import flash.events.*;
    import count_timer;
    import RectangleButton;
    public class main extends MovieClip
        public function main()
          [create a Start Btn]
            var startBtn_mc:MovieClip = new MovieClip  ;
            addChild(startBtn_mc);
            var startBtn:RectangleButton = new RectangleButton("Start",90,25,18,0xCC0000,0x000000);
            startBtn_mc.x = 105;
            startBtn_mc.y = 200;
            startBtn_mc.addChild(startBtn);
            startBtn_mc.addEventListener(MouseEvent.CLICK,onClickStartBtn);
            function onClickStartBtn(event:MouseEvent):void
                var inputDay1:String = dayInputtxt.text;[these are input fields on the stage]
                var inputHr1:String = hrInputtxt.text;
                var inputMin1:String = minInputtxt.text;
                var inputSec1:String = secInputtxt.text;
                var counter:count_timer = new count_timer(inputDay1,inputHr1,inputMin1,inputSec1);
Countdown Timer:
package
    import flash.display.*;
    import flash.utils.Timer;
    import flash.events.*;
    import flash.text.*;
    import RectangleButton;
    public class count_timer extends MovieClip
//not sure this is correct
public var daytxt:TextField;
public var hrtxt:TextField;
public var mintxt:TextField;
public var sectxt:TextField;
        public function count_timer(inputDay1,inputHr1,inputMin1,inputSec1)
            var inputDay = inputDay1;
            var inputHr = inputHr1;
            var inputMin = inputMin1;
            var inputSec = inputSec1;
            var msinputDay:Number = Number(inputDay);
            var msinputHr:Number = Number(inputHr);
            var msinputMin:Number = Number(inputMin);
            var msinputSec:Number = Number(inputSec);
            var ms:Number = Number(msinputDay);
//convert input to milliseconds
            ms = ms + msinputDay * 24 * 60 * 60 * 1000;
            ms = ms + msinputHr * 60 * 60 * 1000;
            ms = ms + msinputMin * 60 * 1000;
            ms = ms + msinputSec * 1000;
            addEventListener(Event.ENTER_FRAME, loop);
            function loop(e:Event):void
                ms = ms - 1000;
                var sec:Number = Math.floor(ms / 1000);
                var min:Number = Math.floor(sec / 60);
                var hr:Number = Math.floor(min / 60);
                var day:Number = Math.floor(hr / 24);
                sec = sec % 60;
                min = min % 60;
                hr = hr % 24;
                daytxt.text = day.toString();[everything appears to work to these variables. I think it should be root.]
                hrtxt.text=(hr<10)?"0"+hr.toString():hr.toString();
                mintxt.text=(min<10)?"0"+min.toString():min.toString();
                sectxt.text=(sec<10)?"0"+sec.toString():sec.toString();
           if (ms <= 0)
                    removeEventListener(Event.ENTER_FRAME, loop);
                    gotoAndPlay("TimesUp");
Many thanks in advance.

Your code is not going to work as you show it. First, you should not be putting your class methods inside the constructors... And yes - scope. You make your new count_timer as a local variable inside a function that is called on click. Essentially, the timer is gone just as fast as it's created. If you want the timer available to the other methods in the class it should be declared as a private var in the class definition.
And I agree with kokorito - have your timer extend EventDispatcher and then it can do like: dispatchEvent(new Event("myTimerEvent")); and you can then add an eventListener to it when you create it in your main class. You just listen for "myTimerEvent" or whatever string you use, and call whatever function you want - just like using any other listener.

Similar Messages

  • I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    See this thread:
    http://answers.acrobatusers.com/Is-add-instructional-text-text-field-disappear-clicked-q19 5078.aspx

  • How to copy text from Excel to a text field in the form?

    Hi All,
    I want to copy a text from Excel or Word file and paste it in a text field in the form, How?
    I tried to use ctrl+c for copy and ctrl+v for paste but it doesn't work!

    hi, i've seen this problem before but can't remember what the solution was...
    but just by searching on this forum resulted in this link
    Re: Copy and Paste
    hope it helps

  • Change the position of the text field in the report region

    Hi,
    I am having a report region in whch there are 2 buttons which are in the Region Template position #Create# and a
    text field. I added a text field in the same region. I tried to change the position of the text field near the buttons. I
    tried to change "label-Horizontal/vertical alignment" and "Element horizontal vertical alignment". But the postion of the
    text field is not changing. Plz help,
    Thanks,
    TJ

    Hi Andy,
    Sorry to ask this questions.
    1.Where exactly i need to change the HTML code(By uisng the view source?)
    2.My taskname part html code when viewing the source is given below
    tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" />
    </a><tr></td><td nowrap align="left">
    <label for="P1_TASK_NAME" tabindex="999">
    <a class="t16OptionalLabelwithHelp" href="javascript:popupFieldHelp('5853137628393530415','676839962625525')"
    tabindex="999">Task Name</a></label></td>
    <td  colspan="1" rowspan="1" align="left" valign="top"><input type="hidden" name="p_arg_names"
    value="5853137628393530415" /><input type="text" name="p_t06" size="10" maxlength="20" value=""
    id="P1_TASK_NAME"  /><a class="eLink" title="Edit" href="javascript:popupURL('f?
    p=4000:371:676839962625525::::P371_ID,FB_FLOW_ID,FB_FLOW_PAGE_ID:5853137628393530415,107,1');" 
    tabindex="999"><img src="/i/e.gif" alt="Edit" class="eLink" /></a></td></table>
    <table summary="" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="right"><table
    cellpadding="0" cellspacing="0" border="0" summary="" class="t16Button">please suggest what changes i need in this code to change the alignment of the task_name text field,
    Thanks,
    TJ

  • Text created in Premiere showing other text files in the timeline and exports.

    Hi,
    I'm creating slates with text generated in Premiere. For each new slate I am duplicating a text layer, Option + Dragging the duplicate file over the text I'd like to replace, then opening the new text layer in the text editor and updating the information.
    Things seem fine at first and then randomly text layers in the timeline will show text from other files in the timeline. If I open the text file up in the text editor I see the correct info but not in the timeline.
    The only fix I have found is to delete render files, move the text layer around in the timeline, quit and re-open. But still, sometimes when I export, the export preview window will show the wrong text and when I export the file I create shows the wrong text as well.
    It seems like Premiere is getting confused by multiple text files in the timeline and is pointing to the wrong cache files.
    Thoughts would be a huge help!

    Thanks for the tip Kevin. Anything I can do to avoid this in the future?
    I've had this happen on a number of projects. My media and project files are on a SAN, cache and previews are local.
    Thanks,
    Mike Brown
    P: (401) 743-7452

  • How to use the separate symbol in the text field in the adobe form.

    Hi,experts,
    I don’t know how to use the separate symbol to make a paragraph separate into several lines correctly in the text field in the adobe form.
    Action:
    1. config the ADS successfully.
    2. create the adobe form with a mult-line textfield(binding the 'remark' context in the interface of the form) using sfp.
    3. create a WDA for invoke the form and transfer the 'remark' context data.
    I use the following codes to display the paragraph in the PDF document:
    CONCATENATE
    '1&#12289;aaaaaaaaaaa&#65307;'
    '2&#12289;bbbbbbbbb '
    '3&#12289;ccccccccccc'
    '4&#12289;ddddddddd'
    INTO remark .
    lo_nd_z_hr_php_payslip->set_attribute(
    EXPORTING
    name = `REMARK`
    value = remark ).
    But I found all the content aren't paragraph separate correctly in the text field in the adobe form when I run the WDA.
    Could you please give me some hints to make the paragraph separate correctly in PDF document? Thanks a lot in advance!
    My email is : [email protected]
    Best regards,
    Tao
    Edited by: wang tao on Apr 8, 2008 1:58 AM

    Hi,
    If it is just a one word value then you could use this in the exist event;
    this.rawValue    
    = util.printx(">?<*",this.rawValue);
    This changes the first character (represented by the ?) to uppercase (represented by the >) and all trailing characters (represented by the *) to lowercase (represented by the <).
    If you wanted something more general ... if they could also enter a middle name then you could call a function like;
    function        toTitleCase(textValue)
      return  textValue.toLowerCase().replace(/\b[a-z]/g, function replacer(match) { return match.toUpperCase(); });
    This uses a regex to change all lowercase letters following a word boundary to uppercase.
    Bruce

  • Trying to add a flowable/expandable text field to the end of a form

    I have created a form in LiveCycle Designer.  At the end of that form, I would like a Summary text box that expands to allow the person who is filling out the form to type as much information as is necessary and it will all be visible/print when they are done.  I have the field to the point where it will expand (finally!) but I have requested that the field allow page breaks (including all subforms it is contained within) but when it expands, it all carries over to the next page and doesn't allow us to go beyond one page of typing.  Is there anyway to remedy this situation so the text will actually "flow" from one page to another instead of just carrying it over?

    I appreciate you replying to my post and maybe this is just that I have never used the forum before but your reply said that you hoped the sample document would help me and I don't see a sample document attached to the reply.  Am I missing something?
    Date: Wed, 24 Nov 2010 18:32:12 -0700
    From: [email protected]
    To: [email protected]
    Subject: Trying to add a flowable/expandable text field to the end of a form
    I hope this sample file solve your issue too.
    >

  • Mass Change of TEXT field

    Hi
    I wanted to carry out Mass change of Text field in 2000 Financial documents, Can anyone give the best way to do the same?
    Thanks

    Hi,
    Execute the FBL3N report by selecting the Documents using Dynamic selection mention
    a) Document no's
    b) Fiscal year
    mention company code and execute the report and use mass change option to make changes.
    The following accounts may not appear in the listing
    a) Recon accounts in case these are not line item managed.
    b) If any of the documents have been archived.
    If you are on ECC6.0 or higher then you can use the report FAGLL03 report this would list the line items in the documents even if the Recon accounts are not line item managed.
    You can also record a SECATT/LSMW to do this for you in case you want different text for each of the line item.
    Regards
    K.R

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How to place two text fields on the same line in adobe

    I am trying to create a form on adobe and I would like to have two unique text fields on the same line. Is this posible? 

    If you are using FormsCentral it is, the fields can be placed "side by side" in a row.  There is a "+" sign on the right side of the field that brings up a toolbar to add a field adjacent.  You can also right click on a field and select "Insert beside", or you can "drag and drop" fields next to one another or to a new row.
    Thanks,
    Josh
    PS - One note, if you are using the "desktop" application of FormsCentral that comes with Acroat Pro XI make sure the application is up to date by either using the "Help" - "Check for updates" menu item or by signing into the application so that you have the latest features including the side by side layout.

  • How to read two text files using the Read from spreadsheet.vi and then plot it

    I need to read two text files using the read from spreadsheet function and then plot these files over time.
    The file with the .res extention is the RMS values (dt and df) and the second file contains the amplitude of a frequency spectrum.
    I really appreciate any help..thanks
    Attachments:
    RMS.txt ‏1 KB
    FREQUENCY.txt ‏1 KB

    From NI Example Finder:
    Write to Text File.vi
    Read from Text File.vi
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp

  • Is it mandatory to bind each & every CONTEXT element to a text field on the form?

    Hello,
    I am developing an Adobe Interactive Form, i have Designer 8.1 and Reader 9.0 in my Windows 7 Laptop. When i checked the menu EDIT-->form properties --> Compatability, its Adobe XML form File (XDP)
    I have 3 elements (say, 1_Name, 2_Street and 3_City) in the CONTEXT and drawn ONLY 2 input enabled TEXT fields (for items - Name and Street of conetext) and then, BINDED them.
    I did not put any associate text field for CITY and no chance of binding!
    Pls. let me know that, Now can i utilize this CITY (of context) element containign data in the Java script? is this CITY is VISIBLE in the java script, even though it did not get BINDED with any text field on the form?
    THank you

    Thank you.
    If it got BINDED, i knew how to point/get/visible the CITY element (of CONTEXT) containming data by using the below java script,
    (this.rawValue == "A") or i can also get it with script of VISITOR.Page3.Subform11.CITY.rawvalue = "A"
    If i do NOT bind CITY to any TEXT FIELD of FORM, then, how i can retrieve/get/visible/point CITY content?

  • Is it possible to NOT have the white text field on the bottom of the mini b

    Is it possible to NOT have the white text field on the bottom of the mini book? I'm trying what I can, and have searched the web including the third-party sites and can't find anything. Would rather design my own thing for it and have the image bleed to the bottom.

    Richard,
    You are a gentleman, AND a scholar! Thanks! Just really want to do something different, though I was almost ready to shoot something against white just to make it work. Much appreciated.

  • Moving the timeline from a loaded swf file

    Hi,
    I have been at this problem for awhile now.
    I have a two swf files, whic are loaded using ths code as an example:
    stop();
    var req:URLRequest = new URLRequest("Enchilada_A.swf");
    var loader:Loader = new Loader();
    function imageLoaded(event:Event):void {
        ldContainerB.addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
    loader.load(req);
    The first one is triggerrd by a MC button that is on the timeline.
    That first swf loads fine.
    At the end of that file(which is short animation)
    I have code that says:
    MovieClip(parent).gotoAndStop("frameThree");
    I have also tried:
    MovieClip(root) and
    if (movie Clip is parent) {
    MovieClip(parent).gotoAndStop("frameThree");
    and/MovieClip(parent).nextFrame();
    I have also tried placing this. or root. into the code.
    I am not talking to the timeline from this swf file.
    Once the timeline moves to the next Frame the new swf file can load.
    My solution was to combine both swf files into one, which loads from the timeline button.
    It works and I can gt by but I really woud like to learn how to load a swf and talk to the timeline fro more flexibilty.
    I'm out of strategies.
    Is my code in the wrong place(at the last frame of the animation?
    Should it be written on the timeline by creating a new var that has a function once the animation is completed.
    Any suggestions and/or commens would be greatly appreciated.
    Thanks.

    Thanks,
    I finally had a chance to get back to this project and used your suggestions, whichare definitiley helpful. I also, created a new and very basic version of the project so I could easily see what was happening.
    This is the code that works:
    stop();
    MovieClip(parent.parent).nextFrame();
    trace(container_mc);
    I'm still trying to understand how the child parent relationship is working but this will get me going in the right direction.

  • Accessing the ServletContext from a class that is not a Servlet?

    Is there any way of accessing the ServletContext from a class that is not a
              Servlet? The class is being used as part of a Web Application.
              Thanks.
              

    http://www.mozilla.org/mirrors.html
    Mozilla has download mirrors around the globe. If it is on the list, it is trustworthy.

Maybe you are looking for

  • SO_NEW_DOCUMENT_ATT_SEND_API1 and txt file problem

    Hi I'm using FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending a txt file attachment, but the format of data is wrong. U s e r   :   T F R A N C O  D a t e   :   1 8 / 0 5 / 2 0 1 0 clear objpack-transf_bin.   objpack-transf_bin = 'X'.   objpack-head_star

  • How do I set TB's default startup view to show e-mail message list instead of only the latest opened message?

    Hi, I just now installed Thunderbird 24.3 and am using Thunderbird for the first time ever. From having had Outlook Express before, I am used to the app opening to my full list of mail boxes (Inbox, Sent, Car, Cat, etc.) upon clicking the app's progr

  • Error on starting GUI  710 after installing SAP ABAP Trial Version

    I installed the SAP NetWeaver 2004s ABAP Trial Version that came with the book and CD. I set up the server properties as stated in the CD. System Connection Parameters: Description: NSP local Application Server: localhost System Number: 00 System ID:

  • Suppress Printing

    How could I suppress exporting report if no records are loaded using sdk? If setting options in report to suppress i get blank page in pdf when exporting, is there a way to evaluate if fields have data or not? Is there a way to retrieve sql statement

  • How to configure Test System

    Hello Guys, I want to some guidelines to install and configure the SAP NWCE as Test System. Any link or documentation would be encouraged. Regards, Naeem