OnChange function in a TextField

Hi,
Whenever a value is entered in a text field, we can use onChange function to make perform desired operations. When different values are entered, the function is called. But, what if a same value is entered again and again ? this does not call onChange function. How can we call the function, if same value is entered again and again.
Thanks,
Ravikiran

Hi Ravi kiran,
Did you try liveChange (oControlEvent) event?
Regards,
Madhumahesh.

Similar Messages

  • OnChanged function - Simplify?

    Is there a way to simplify this:
    r1_8.onChanged = function() {
    this.text = this.text.toLowerCase();
    _hint7._visible = false;
    Selection.setFocus(r1_9);
    r1_9.onChanged = function() {
    this.text = this.text.toLowerCase();
    _hint8._visible = false;
    Selection.setFocus(r1_10);
    r1_10.onChanged = function() {
    this.text = this.text.toLowerCase();
    _hint9._visible = false;
    a1a();
    Selection.setFocus(parking);
    This is used in a word game and I am hoping that there is a
    way to simplify this rather than having to do this for each
    individual input textfield as I am having to do now.
    Any assistance will be appreciated.

    Maybe something like this (I haven't tried to test it). It
    may be even better if you got actionscript to create the textfields
    dynamically as well.

  • How to fire javascript Onchange function AUTOMATICALLY

    Hi,
    I have following 2 items both is having an Onchange javascript function.
    P1_SELECT_LIST1 (javascript - Onchange1)
    P1_SELECT_LIST2 (javascript - Onchange2)
    I want to execute Onchange2 automatically whenever Onchange1 is executed.
    I mean whenever Onchange1 is executed...I want Onchange2 javascript to fire automatocally..
    Thanks,
    Deepak

    Deepak,
    I didn't get what you are trying to here?
    P1_SELECT_LIST1 - HTML Form Element Attributes
    onchange="javascript:f1(this);"
    function f1(pThis)
    $x_Value('P1_YYYY','XX');
    }So on change of SL1, f1 will fire and you are passing the object to f1. But you are not using it? So whats the use of passing it?
    In your initial post..
    I want to execute Onchange2 automatically whenever Onchange1 is >executed.But you are doing it in reverse?
    However you may try..
    P1_SELECT_LIST1 - HTML Form Element Attributes
    onchange="javascript:f1();"P1_SELECT_LIST2 - HTML Form Element Attributes
    onchange="javascript:f2(this);"Page - HTML Header
    <script type="text/javascript">
    function f2(pThis)
    //pThis is an OBJECT not item name
       if (pThis.value == 'C')
    // set P1_XXXX to null
         $x('P1_XXXX').value = '';
       else if (pThis.value == 'E')
    // whats the use of doing this?
         var v1 = $v('P1_SELECT_LIST1');
         <!-- alert (v1);  -->
         f1();  // -- No need to pass parameters
    function f1()
    // set P1_YYYY with value XX
    // XX is Constant?
      $x_Value('P1_YYYY','XX');
    </script>Regards,
    Hari

  • Form with onchange function

    I want to give option like pay by credit card or check.
    If one select credit card in select option it opens credit card related form inputs/Check than check related form inputs before submiting form.
    I would start like
    <cfform action"" method=""Post>
    <cfselect name="paymenttype" query="test" display="paymenttype" value="paymenttype">
    <option value ="other">Other</>
    </select>
    <cfif form.paymenttype = "Credit Card">
    <cfinput type="Test" name="creditcomp">
    <cfelseif form.paymenttype = "check">
    <cfinput type="text" name="bankinfo">
    </cfif>
    <input type="submit" value="Submit"></cfform>
    I belive I need to use Java script onChange event but I never did Java script before, can any one help me on it?
    I have been using cfcase and submiting form at each and than made session variable to generate appropriate result but now I wanrt to do some change.

    For learning js, I recommend the book, Teach Yourself Javascript in 24 Hours.  It's how I learned.  There are also tutorials on webmonkey.
    For what you are trying to do specifcally, I would put the credit card and bank stuff in separate divs and use js to show and hide them.  Google "javascript show hide"  to find code samples.

  • Function formats textfields

    hi there,
    MY IDEA:
    every textfield in my form shall behave in the same way.
    For example background color is changing if the field is entered.
    I don' t want to script the whole batch of javascript-commands for every single textfield.
    Instead I' d like to put one function in a script objekt called SO containing all necessary commands.
    Then I' d like to start this function from each textfield.
    MY PROBLEM:
    I don`t manage to put the name of my textfields in a parameter of my function in a way javascript makes it run.
    EXAMPLE:
    /* this is a function in the script objekt called SO */
    function fu_form_mark (P_TEXTFIELD){
    xfa.form.myform1.P_TEXTFIELD.border.presence="visible";
    xfa.form.myform1.P_TEXTFIELD.border.fill.color.value="100,50,100";
    /* this is a textfield in my form */
    ----- myform1.#subform[0].TXT_1::exit - (JavaScript, client) ----------
    var V_MARK_FIELD = SO.fu_form_mark("TXT_1");
    QUESTION:
    How do I have to script this example to make it work ?

    try recode your program by using
    "createTextField" Method it may help you out .

  • Having problem with setting variable on a textfield

    I'm using createTextField to create a textfield. I have also created a input textfield with a variable called textline1 (I don't create the inputfield with as).
    I want to display the letters in the created textfiled that I'm typing in the input field. So this in my AS coed:
    _root.createTextField("text1",1,100,100,300,100);
    text1.variable = textline1;
    format1 = new TextFormat();
    format1.color = 0xff0000;
    format1.size = 50;
    format1.bullet = false;
    text1.setTextFormat(format1);
    but it doesn't work. So anyone see the problem?
    (sorry for bad english)

    i think you're going to have more problems if you continue using textfield variables.  you should not use them.  just use the text property of the textfield to reference its contents.
    but, if you want to continue, use:
    var tl:MovieClip=this;
    fontsize=20;
    myInputText_txt.onChanged = function(text1:TextField) {
    _root.myText_mc.createTextField("text_txt",1,100,100, 100,100);
    _root.myText_mc.text_txt.variable = tl["text2"];
    text2=text1.text;
    format1 = new TextFormat();
    format1.color = 0xff0000;
    format1.size = fontsize;
    format1.bullet = false;
    text_txt.setTextFormat(format1);
    p.s.  please mark this thread as answered.

  • Combine the concat value in a single textfield.

    hi there,
    How to make the concat function, combining the multiple textfield into a single textfield
    It doesnt work when i'm inserting the data in the last of textfield.It should appear when i have finished inserting the data.. should i put the onChange function to make it appear..
    and what is the diferent between concat and bufferString...
    below is my example program which is not function...
    <input type="text" name="neg" size="35" value=''>
    <input type="text" name="dae" size="35" value=''>
    <input type="text" name="jdhm" size="35" value=''>
    <input type="text" name="mbp" size="35" value=''>
    <input type="text" name="notkt" size="35" value=''>
    <input type="text" name="noptk" size="35" value=''>
    <input type="text" name="nobgn" size="35" value=''>
    <input type="text" name="nodhm" size="35" value=''>
    <% String hak1="",hak2="",hak3="",hak4="",hak5="",hak6="",hak7="",
    tempNOPTK=request.getParameter("NOPTK"),
    tempNOTKT=request.getParameter("NOTKT"),
    tempNOBGN=request.getParameter("NOBGN"),
    tempNODHM=request.getParameter("NODHM"),
    tempJHM=request.getParameter("jdhm"),
    tempMBP=request.getParameter("mbp"),
    tempDAE=request.getParameter("dae"),
    tempNEG=request.getParameter("neg");
    if (tempNEG !=null && tempJHM !=null && tempMBP !=null && tempDAE !=null && tempNODHM !=null && tempNOBGN !=null && tempNOTKT !=null && tempNOPTK !=null)
    hak1=tempNEG.concat(tempDAE);
    hak2=hak1.concat(tempMBP);
    hak3=hak2.concat(tempJHM);
    hak4=hak3.concat(tempNODHM);
    hak5=hak4.concat(tempNOBGN);
    hak6=hak5.concat(tempNOTKT);
    hak7=hak6.concat(tempNOPTK);
    System.out.println(hak7);}
    %>
    <input type="text" name="id hakmilik" size="35" value='<%=hak7%>'>
    i want the id hakmilik textfield to appear the result..

    if (tempNEG !=null && tempJHM !=null && tempMBP !=null
    && tempDAE !=null && tempNODHM !=null && tempNOBGN
    !=null && tempNOTKT !=null && tempNOPTK !=null)
    {What happens if one of them is a null? That is why you are getting '""' displayed in the 'id hakmilik' field.
    One more point, try to avoid spaces in field names.(id hakmilik).
    Sudha

  • How to pass values from one function to another

    Hi,
    I am a middle school teacher and a newbie in Flash Actionscript. I am trying to create a countdown timer for use in my class during tests. The start and pause functions work as required, but not the pause button. When I click on the pause button, the timer is reset to 0:00:00. Please help. Here is the code I had written so far:
    var Subject1timeLeftHr;
    var Subject1timeLeftMin;
    var Subject1timeLeftSec;
    Subject1start_btn._visible = true;
    Subject1pause_btn._visible = false;
    Subject1rotor_mc.gotoAndStop(1);
    Subject1rotor_mc._visible = false;
    Subject1durationHr_txt.text = "0";
    Subject1durationMin_txt.text = "00";
    Subject1durationSec_txt.text = "00";
    Selection.setFocus(Subject1durationHr_txt);
    function SubjectdurationHr(SubjectxdurationHr_txt, SubjectxdurationMin_txt)
    if (SubjectxdurationHr_txt.length == 1)
    Selection.setFocus(SubjectxdurationMin_txt);
    function SubjectdurationMin(SubjectxdurationMin_txt, SubjectxdurationSec_txt)
    if (SubjectxdurationMin_txt.length == 2)
    Selection.setFocus(SubjectxdurationSec_txt);
    function SubjectdurationSec(SubjectxdurationSec_txt, SubjectxdurationHr_txt)
    if (SubjectxdurationSec_txt.length == 2)
    Selection.setFocus(SubjectxdurationHr_txt);
    Subject1durationHr_txt.onChanged = function()
    SubjectdurationHr(Subject1durationHr_txt,Subject1durationMin_txt);
    Subject1durationMin_txt.onChanged = function()
    SubjectdurationMin(Subject1durationMin_txt,Subject1durationSec_txt);
    Subject1durationSec_txt.onChanged = function()
    SubjectdurationSec(Subject1durationSec_txt,Subject1durationHr_txt);
    function startcountdown(SubjectxdurationLeft, SubjectxdurationHr, SubjectxdurationHr_txt, SubjectxdurationMin, SubjectxdurationMin_txt, SubjectxdurationSec, SubjectxdurationSec_txt, Subjectxduration, SubjectxstartTime, SubjectxendTime, Subjectxtimer_mc, Subjectxpause_btn, Subjectxstart_btn, Subjectxrotor_mc, SubjectxtimeLeft, SubjectxtimeLeftHr, SubjectxtimeLeftMin, SubjectxtimeLeftSec, SubjectxtimeLeftHr_txt, SubjectxtimeLeftMin_txt, SubjectxtimeLeftSec_txt)
    delete SubjectxdurationLeft;
    delete SubjectxdurationHr;
    delete SubjectxdurationMin;
    delete SubjectxdurationSec;
    delete Subjectxduration;
    delete SubjectxdurationHr_txt.text;
    delete SubjectxdurationMin_txt.text;
    delete SubjectxdurationSec_txt.text;
    SubjectxstartTime = getTimer();
    Subjectxtimer_mc.onEnterFrame = function()
    if (SubjectxdurationHr_txt.text == Nan || SubjectxdurationMin_txt.text == Nan || SubjectxdurationSec_txt.text == Nan)
    else
    SubjectxdurationHr = 60 * 60 * 1000 * Number(SubjectxdurationHr_txt.text);
    SubjectxdurationMin = 60 * 1000 * Number(SubjectxdurationMin_txt.text);
    SubjectxdurationSec = 1000 * Number(SubjectxdurationSec_txt.text);
    Subjectxduration = SubjectxdurationHr + SubjectxdurationMin + SubjectxdurationSec;
    SubjectxendTime = SubjectxstartTime + Subjectxduration;
    SubjectxdurationLeft = SubjectxendTime - getTimer();
    if (SubjectxdurationLeft > 0)
    SubjectxdurationHr_txt._visible = false;
    SubjectxdurationMin_txt._visible = false;
    SubjectxdurationSec_txt._visible = false;
    Subjectxpause_btn._visible = true;
    Subjectxstart_btn._visible = false;
    Subjectxrotor_mc._visible = true;
    Subjectxrotor_mc.play();
    SubjectxtimeLeft = SubjectxdurationLeft / (1000 * 60 * 60);
    SubjectxtimeLeftHr = Math.floor(SubjectxtimeLeft);
    SubjectxtimeLeftMin = Math.floor((SubjectxtimeLeft - SubjectxtimeLeftHr) * 60);
    SubjectxtimeLeftSec = Math.floor(((SubjectxtimeLeft - SubjectxtimeLeftHr) * 60 - SubjectxtimeLeftMin) * 60);
    SubjectxtimeLeftHr_txt.text = String(SubjectxtimeLeftHr);
    if (SubjectxtimeLeftHr_txt.length < 1)
    SubjectxtimeLeftHr_txt.text = "0" + SubjectxtimeLeftHr_txt.text;
    SubjectxtimeLeftMin_txt.text = String(SubjectxtimeLeftMin);
    if (SubjectxtimeLeftMin_txt.length < 2)
    SubjectxtimeLeftMin_txt.text = "0" + SubjectxtimeLeftMin_txt.text;
    SubjectxtimeLeftSec_txt.text = String(SubjectxtimeLeftSec);
    if (SubjectxtimeLeftSec_txt.length < 2)
    SubjectxtimeLeftSec_txt.text = "0" + SubjectxtimeLeftSec_txt.text;
    else
    delete Subjectxtimer_mc.onEnterFrame;
    SubjectxtimeLeftHr_txt.text = "";
    SubjectxtimeLeftMin_txt.text = "";
    SubjectxtimeLeftSec_txt.text = "";
    SubjectxdurationHr_txt._visible = true;
    SubjectxdurationMin_txt._visible = true;
    SubjectxdurationSec_txt._visible = true;
    Subjectxrotor_mc.gotoAndStop(1);
    Subjectxrotor_mc._visible = false;
    SubjectxdurationHr_txt.text = "0";
    SubjectxdurationMin_txt.text = "00";
    SubjectxdurationSec_txt.text = "00";
    Subjectxpause_btn._visible = false;
    Subjectxstart_btn._visible = true;
    Selection.setFocus(SubjectxdurationHr_txt);
    function pausecountdown(SubjectxdurationHr_txt, SubjectxtimeLeftHr, SubjectxdurationMin_txt, SubjectxtimeLeftMin, SubjectxdurationSec_txt, SubjectxtimeLeftSec, Subjectxstart_btn, Subjectxpause_btn, Subjectxrotor_mc)
    delete Subjectxtimer_mc.onEnterFrame;
    SubjectxdurationHr_txt.text = String(SubjectxtimeLeftHr);
    SubjectxdurationMin_txt.text = String(SubjectxtimeLeftMin);
    SubjectxdurationSec_txt.text = String(SubjectxtimeLeftSec);
    Subjectxstart_btn._visible = true;
    Subjectxpause_btn._visible = false;
    Subjectxrotor_mc.stop();
    Subject1pause_btn.onRelease = function()
    pausecountdown(Subject1durationHr_txt,Subject1timeLeftHr,Subject1durationMin_txt,Subject1t imeLeftMin,Subject1durationSec_txt,Subject1timeLeftSec,Subject1start_btn,Subject1pause_btn ,Subject1rotor_mc);
    Subject1start_btn.onRelease = function()
    startcountdown(Subject1durationLeft,Subject1durationHr,Subject1durationHr_txt,Subject1dura tionMin,Subject1durationMin_txt,Subject1durationSec,Subject1durationSec_txt,Subject1durati on,Subject1startTime,Subject1endTime,Subject1timer_mc,Subject1pause_btn,Subject1start_btn, Subject1rotor_mc,Subject1timeLeft,Subject1timeLeftHr,Subject1timeLeftMin,Subject1timeLeftS ec,Subject1timeLeftHr_txt,Subject1timeLeftMin_txt,Subject1timeLeftSec_txt);
    Subject1cancel_btn.onRelease = function()
    Subject1timeLeftHr_txt.text = "";
    Subject1timeLeftMin_txt.text = "";
    Subject1timeLeftSec_txt.text = "";
    Subject1durationHr_txt._visible = true;
    Subject1durationMin_txt._visible = true;
    Subject1durationSec_txt._visible = true;
    Subject1durationHr_txt.text = "0";
    Subject1durationMin_txt.text = "00";
    Subject1durationSec_txt.text = "00";
    Subject1timeLeftHr_txt._visible = true;
    Subject1timeLeftMin_txt._visible = true;
    Subject1timeLeftSec_txt._visible = true;
    Subject1pause_btn._visible = false;
    Subject1start_btn._visible = true;
    Subject1rotor_mc._visible = false;
    Subject1rotor_mc.gotoAndStop(1);
    delete Subject1timer_mc.onEnterFrame;
    delete Subject1durationLeft;
    delete Subject1duration;
    delete Subject1durationHr_txt.text;
    delete Subject1durationMin_txt.text;
    delete Subject1durationSec_txt.text;

    I think you need to spend some time reducing your code to practical levels.  You seem to be passing everything in the book to every function and I would guess that probably none of it is necessary.  If you declared those variables at the beginning, then you don't need to pass them into any function because they are gobally available to any of the code/functions that follows them.  Similarly, if you have textfields on the stage, you do not need to pass those into any functions for the same reason.
    I see you making overuse of "delete" (and possibly errant use as well).  Probably the only thing you might want/need to use is...
    delete Subjectxtimer_mc.onEnterFrame;
    Which stops the enterframe activity from firing off, which I will guess is being used to update the textfields that indicate the time.
    And that conditional that uses == Nan isn't likely to do anything except wonder what an Nan is.  Textfields hold strings, which are quoted.  SO unless you have a variable named Nan somewhere that has a String value assigned to it, that conditional won't be doing anything for you.  You probably won't need it at all if you get this working properly.

  • How to pass tabular report col reference in the onChange event of Txtfield

    Hi there
    I need to have Onchange event on Textfield Item.
    Whenever i change the text field value, the new value should go to particular column in my
    tabular report.
    So in the onchange event, i have to pass the tabular report column (target field) along with textfield value (this.value)
    something like this:
    onChange="javascript:changeColVal(this,rowid);"
    I have no clue how to pass row id / particular column of tabular report in textfield.
    Any pointers on this would be of great help.
    Thanks
    Vijay

    Hi Andy
    Thanks a ton for your reply.
    The above solution would work fine when we refer Text field within that tabular report.
    but if we refer text field Item from separate HTML region?
    I'm sorry, its my mistake for not providing OTN application for reference.
    I've come up with dummy application which shows you exact requirement.
    Please follow url: http://apex.oracle.com/pls/otn/f?p=47869:21
    login credentials:
    workspace: vsanthanam
    user: vijay
    pswd: apex_demo
    Application highlights the row whenever we move up/down or click the row.
    Here, i've NOTES in tabular report and Comments "text field" in separate HTML region.
    Whenever i type/update comments in textfeild, it should goto Notes column in Tabular report.
    so that when we move up/down the tabular report rows, it should show corresponding Notes in Comments text field.
    Approach i've took:
    1) Created a function hiliterow, that highlights the row clicked/move up or down and
    also displays the Notes Column of Tabular report into Comments Textfield.
    (this is to display Notes if already avail to that particular row, otherwise Null)
    2) Function passValues would assign the value we type in Comments Text field to
    Notes column of Tabular Report. (as of now, this is happening only when we click on that particular row after key-in the value in Comments txtfield,
    but this should happen when onChange event on comment textfield)
    3) In MoveupDown function, i'm refering the current row in var r. so i tought to have global var to hold current row, so that i can
    refer the same row in Onchange Event of Textfield. But this fails (please refer NotesToRow function)
    My requirement is to pass the Comments text field value to Tabular report when onChange event on Comments Text feild happens.
    I'm helpless in passing row reference to onChange function.
    Any pointer on this would be of immense help.
    Thanks
    vijay

  • TextField Listener

    Hi there!
    How could I buil an efficient TextField Listener?
    I unsuccessfully tried different solutions based on
    onScroller and onChanged...
    Flash Help is not very newbie friendly...
    onScroller seems to be the best solution because it can be
    triggered by AS but the Listener I built isn't working.
    Many thanks in advance for your help.
    Best regards,
    Gerry

    use the onChanged handler and watch function (for the
    textfield's text property). the first detects changes to input
    textfields via user interaction and the 2nd detects changes due to
    a.s.

  • Why is getLineMetrics inaccurate when using device fonts* or immediately after resizing a TextField?

    1.  We need getLineMetrics to return correct values immediately after changing a TextField's width/height or any property that would affect the layout metrics, withouth having to alter other properties like setting the text to itself (p1.text = p1.text).  Currently, if you change the width of a text field to match the stage width for example, getLineMetrics will not return correct values until the next frame.... UNLESS you set the text property.
    2.  We also need some kind of "stage scaled" event in addition to the "stage resize" event (which only fires when stage scale mode is no_scale), because stage scaling affects the rendered size of device fonts so dramatically that we must call getLineMetrics again.  This is not the case for fonts antialiased for readability, since their size is relatively stable with scaling, as demonstrated by drawing a box around the first line once and then scaling the stage.
    So those are the problems.  The asterisk in the title of this post is there because it seem that TextField.getLineMetrics is accurate with device fonts, but I cannot take advantage of that accuracy without a way to detect when the player is scaled.  I can only confirm its accuracy at a 1:1 scale, since there is no way to recalculate the size of the line rectangle once the player is scaled, aside from setting a timer of some sort which is a real hack not to mention horribly inefficient with no way to detect when the stage has actually be scaled.
    I use device fonts because embedded fonts look terrible and blurred compared to device font rendering.  The "use device font" setting matches the appearance of text in web browsers exactly.  The only way to get embedded/advanced antialiased text in flash to approximate that of the device font look is to primarily set gridFitType to PIXEL instead of SUBPIXEL, and secondly set autokerning to true to fix problems caused by the PIXEL grid fit type.  That ensure strokes are fitted solidly to the nearest pixel, however it still lacks the "ClearType" rendering that device fonts use, which has notable color offset to improve appearance on LCD monitors, rather than the purely grayscale text that flash uses in its subpixel rendering.  Frankly, failure to use device fonts because of API issues, is the only reason why Flash sometimes doesn't look as good as HTML text and why people say text in Flash "looks blurry".  I'm tired of hearing it.  If the player simply dispatched an event when scaled and updated the metrics immediately when any property of the text field that would affect the metrics is changed, then we could all happily use device fonts and Flash text would look great.  As is stands, because of the two problems I mentioned in the opening paragraph, we're stuck dealing with these problems.
    If you create two text fields named "p1" and "p2" for paragraph 1 and 2, populate them with an identical line of text and set one to "use device fonts" and the other to "antialias for readability", then use this code to draw boxes around the first line of text in each of them:
    import flash.text.TextField;import flash.text.TextLineMetrics;graphics.clear();drawBoxAroundLine( p1, 0 );drawBoxAroundLine( p2, 0 );function drawBoxAroundLine( tf:TextField, line_index:int ):void{          var gutter:Number = 2;          var tlm:TextLineMetrics = tf.getLineMetrics( line_index );          graphics.lineStyle( 0, 0x0000ff );          graphics.drawRect( tf.x + gutter, tf.y + gutter, tlm.width, tlm.height );}
    The box surrounding the line of text in the "use device fonts" box is way off at first.  Scaling the player demonstrates that the text width of the device font field fluctuates wildly, while the "antialias for readability" field scales with the originally drawn rectangle perfectly.  That much is fine, but again to clarify the problems I mentioned at the top of this post:
    Since the text width fluctuates wildly upon player resize, assuming that getLineMetrics actually works on device fonts (and that's an assumption at this point), you'd have to detect the player resize and redraw the text.  Unfortunately, Flash does not fire the player resize event unless the stage scale mode is set to NO_SCALE.  That's problem #1.  And if that's by design, then they should definitely add a SCALE event, because changes in player scale dramatically affect device font layout, which requires recalculation of text metrics.  It's a real issue for fluid layouts.
    The second problem is that even when handling the resize event, and for example setting the text field width's to match the Stage.stageWidth property, when the text line wraps, it's not updated until the next frame.  In other words, at the exact resize event that causes a word to wrap, calling getLineMetrics in this handler reports the previous line length before the last word on the line wrapped.  So it's delayed a frame.  The only way to get the correct metrics immediately is basically to set the text property to itself like "p1.text = p1.text".  That seems to force an update of the metrics.  Otherwise, it's delayed, and useles.  I wrote about this in an answer over a year ago, showing how sensitive the text field property order is: http://stackoverflow.com/a/9558597/88409

    As I've noted several times, setting the text property to its own current value should not be necessary to update the metrics, and in some subclasses of text field, setting a property to its own value is ignored as the property is not actually changing and processing such a change would cause unnecessary work which could impact application performance.  Metrics should be current upon calling getLineMetrics.  They are not.  That's the problem.
    From a programming perspective, having to set the text property (really "htmlText" to preserve formatting) to itself to update metrics is almost unmanagable, and doesn't even make sense considering "htmlText" is just one of a dozen properties and methods on a TextField that could invalidate the layout metrics (alignment, setTextFormat, width, height, antiAliasMode, type, etc.), and I would have to override every one of those properties so that I could set htmlText = htmlText.  Using such a subclass isn't even possible if I want to use the Flash IDE to add text fields to the stage.  I would have to iterate over the display list and replace all existing fields with my subclass, which also isn't a good workaround because there's no way to update any and all variable references that may have been made to those instances.
    Frome what I've read, the invalide+render event system is unreliable.  My layout framework is similar to that of Windows Forms, and performs layout immediately, with dozens of docking modes and uses suspend and resume layout calls for efficiently resizing multiple child objects in a component.  Certain calculations cannot be aggregated for a render event, because some containers are semi-reflexive, meaning they can expand to fit the child contents while also contraining the child size, depending on whether the contain was resized or the child component was resized, so as a matter of correctness the resizing calcultation must occur immediately when the child resizes, otherwise a top-down pass on the display hierarchy for resizing will not be sufficient.
    As far as waiting until the next frame, no that is not possible, as it will cause one frame to be completely wrong.  If I was dragging the browser window to resize it, it would look terrible as virtually every single frame during the resizing operation would be incorrect.  Also, in the case where a user clicks the maximize or restore button of the web browser, the resizing event will occur exactly once, so if the metrics are not correct when that occurs, there is no recalculation occuring on the next frame, it will just be wrong and sit there looking wrong indefinitely.
    In case it's not obvious by now, this is a web application.  It uses the NO_SCALE stage scaling option, so notification of the event is not actually an issue for me personally.  I was just pointing out that for anyone not using the NO_SCALE option, there is no event in Flash to detect player scale.  What you're suggesting is using a JavaScript event and using the ExternalInterface bridge to send a message, which there is no guarantee whether it will be processed in a timely matter by the player and introduces possible platform inconsistancies, depending on whether the browser has actually resized the Flash interface at that point or what state Flash is in when it tries to recalculate the size of the text.  The browser may send that event to flash before the player is actually resized, so it will be processing incorrect sizes and then resized after the fact.  That's not a good solution.  Flash needs a scale event in addition to a resize event.  I'm really surprised it doesn't have one.  At the very least, the existing resize event should be dispatched reguardless of the stage scale mode, rather than occuring exclusively in the NO_SCALE mode.
    Bottom line is that getLineMetrics needs to return correct values every time it is called, without having to set the "text" property immediately before calling it.  If such a requirement exists, which seems to be the case, then that needs documented in the getLineMetrics method.

  • How to add a hand tool (grab the page and drag) function on Chrome and firefox pdf viewer?

    To clarify, hand tool is a function for user click on the pdf and dragging around , that is used to replace the scroll bar navigating .
    The problem is, by default the Chrome and firefox pdf viewer do not have that function and I would like allow the user to drag the page.
    A workaround is to use a jquery plugin (grab to pan https://github.com/Rob--W/grab-to-pan.js in my case) with an embed object (pdf viewer). When I maximum the size of the pdf and user drag the embed object.
    The problem I have encounter is
    1) When using chrome/ firefox, the pdf content do not fit to the page but auto resize by default even I have set the adobe pdf open parameter , using iframe.
    2) The jquery seems conflict with the firefox pdf viewer, it works smoothly on Chrome but not firefox.
    Here is the source code, you may download the plugin from the link mention above and have a look. Don't forget to put a '1.pdf' along with the source file. Thanks
        <!DOCTYPE html>
        <head>
        <meta charset="utf-8">
        <title>Grab-to-pan.js demo</title>
        <link rel="stylesheet" href="grab-to-pan.css" type="text/css">
        <style>
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        .scrollable {
            overflow: auto;
            width: 100%;
            height: 100%;
            background-color: #EEE;
        #zoomPage {
                  overflow:visible;
            width: 100%;
            height: 150%;
        </style>
        </head>
        <body>
        <label><input type="checkbox" id="activate-g2p" checked> Activate Grab to Pan</label>
        <div class="scrollable" id="scrollable-container">
        <object id = 'zoomPage' type='application/pdf' data= '1.pdf#zoom=page-fit'><p>The PDF can not display</p></object>
        </div>
        <script src="grab-to-pan.js"></script>
        <script>
        document.getElementById('activate-g2p').onchange = function() {
            if (this.checked) g2p.activate();
            else g2p.deactivate();
        var scrollableContainer = document.getElementById('scrollable-container');
        var g2p = new GrabToPan({
            element: scrollableContainer
        g2p.activate();
        </script>
        </body>
        </html>

    This is forum sponsored by Adobe make of Acrobat and Reader. Since Chrome and FireFox web browser have chosen to use their own viewer you might get more help in their forums or customer support.

  • Right click context menu does not appear only for Java 1.7, AWT TextField

    I have been debugging some issues that an application has been having with Java 1.7 versus older versions. A new problem I have encountered is that the right click context menu does not function in any TextField. It works fine when running/compiling it with any previous version of Java. I have tried coding a simple test with a Frame, Panel and TextField to see if it might be something else in the more complex application that was causing it, but the simple test class has the same problem.
    I have searched for other people having the same issue, but I have not found anything comparable. This seems like a huge change from one version to the next and I am surprised that I am not finding this mentioned anywhere else. Can someone point me to anything that discusses this issue that I am having? Does 1.7 require I implement my own context menu? I realize AWT is old technology, but this is an old, fairly complex application that doesn't use swing, and that is not going to change at this point.
    My simple test:
    import java.awt.*; 
    import java.awt.event.*; 
    import java.util.*; 
    class testF3 extends Panel 
      public static void main(String args[]) 
        Frame f = new Frame(); 
        Panel p = new Panel(); 
        f.setLayout(new BorderLayout()); 
        f.add("North", p); 
        TextField tf1 = new TextField("", 20); 
        p.add(tf1); 
        Dimension medm = f.getSize(); 
        medm.height = 100; 
        medm.width = 200; 
        f.setSize(medm); 
        f.setVisible(true); 

    In the past few days since upgrading to 4.0.4, the entire right-click context menu for links is gone and replaced with one item: "Copy Link" The "Open In New Tab" item, along with some other context items, is no longer there.
    That's actually a problem with your particular installation of Safari, b. I've got all the contextual menu entries with my 4.0.4.
    I helped fix one of these recently here at the forum. Try the procedure from the following post (it got back Tho's missing contextual menu entries):
    http://discussions.apple.com/thread.jspa?messageID=10598385&#10598385

  • AutoSize not working properly in TextField when using non-zero line spacing

    When using non-zero line spacing, the autoSize property is not functioning as expected, causing text fields to scroll that shouldn't.  Also, when using device fonts, the sizes of the TextFields are wrong in the Flash IDE.
    I have a TextField whose height is supposed to be dynamic, depending the width of the TextField.  wordWrap is true, the text is left aligned, and the autoSize value is flash.text.TextFieldAutoSize.LEFT.
    When the TextField's width is adjusted, the height increases or decreases as expected, but when I scroll the mouse wheel over the TextField, it allows a single line to scroll out of view.  This should not be happening.  The autoSize property should ensure the TextField is large enough to neither require nor allow scrolling.
    Has anyone else encountered this issue or know how to fix it?
    Update: Been a problem since at least 2006! > http://blog.nthsense.net/?p=46
    http://www.kirupa.com/forum/showthread.php?288955-Disabling-textfield-scrolling   Bug is caused by using a line height ("line spacing" in Flash) larger than zero, for example 1.0pt.  It looks like when I reduce the line spacing of the text field to zero, the issue goes away.  There doesn't seem to be anything wrong with how autoSize is calculating the required height of the text (i.e. it is exactly textHeight + 4 pixel gutter, and drawing the rectangle (2,2,textWidth,textHeight) aligns visually with the text), so it must have to do with how the TextField is deciding whether it needs to scroll or not, and that separate calculation is being thrown off by the non-zero line spacing.  The additional non-zero spacing at the end of the last line could be making the TextField think it needs to scroll, even though it's hight is sufficient at "textHeight + 4".  Apparently the problem manifests when using a non-zero leading value as well.
    In fact, it has to be related to the leading value exactly, since the following code stops the textfield from scrolling.
    //body is TextField
    var tlm:TextLineMetrics = body.getLineMetrics(body.numLines - 1);
    trace(tlm.leading); //traces "1" here.  traces zero when line spacing is zero, and traces larger values with larger line spacing values
    body.autoSize = flash.text.TextFieldAutoSize.NONE; //turn off autosize so the height can be set manually
    body.height += tlm.leading; //increase height of textfield by leading value of last line to cause scrolling to be turned off.
    Honestly, this is pretty unacceptable bug.  First of all, scrolling should not be sensitive to trailing line spacing, because autoSize and textHeight do not include it. It need to be consistent, and I think textHeight and autoSize setting height = textHeight + 4 is correct.  Vertical scrolling should use textHeight as it's guage for whether scrolling is necessary, but instead, it's obviously involving the leading values of the last line.  At the very least, vertical scrolling should simply be disabled when autoSize is turned on and wordWrap is true, because the TextField should be big enough to fit all the text.  The workaround of manually adjusting the height is also no good, since turning autoSize back on will immediately change the size back and trigger scrolling again.  I also shouldn't have to set line spacing to zero just to use the autoSize feature, since the scrolling calculations are wrong in this way.

    No, lol.  Luckly, I replace most of my TextFields on the display list with my subclass TextFieldEx.  I just call a clone method that accepts a TextField and returns a TextFieldEx with identical properties.
    I corrected the problem via modifying the subclass to behave differently when autoSize is not NONE and wordWrap is true.  Under those conditions, the maxScrollV and scrollV property values are fixed at 1, and the class listens for its own SCROLL event and sets scrollV to 1 when it occurs.  That allows me to leave everything else alone, including text selection, and use whatever line spacing I want.
    The modification seems to work fine so far.
    For anyone interested in doing something similar, here is a clone method that will copy a TextField.
    public static function clone( t:TextField ):TextFieldEx
                                  var te:TextFieldEx = create( "", t.width, t.type, t.multiline, t.wordWrap, t.selectable, t.embedFonts, t.defaultTextFormat );
                                  te.alpha = t.alpha;
                                  te.alwaysShowSelection = t.alwaysShowSelection;
                                  te.antiAliasType = t.antiAliasType;
                                  te.autoSize = t.autoSize;
                                  te.background = t.background;
                                  te.backgroundColor = t.backgroundColor;
                                  te.blendMode = t.blendMode;
                                  //te.blendShader = t.blendShader;
                                  te.border = t.border;
                                  te.borderColor = t.borderColor;
                                  te.cacheAsBitmap = t.cacheAsBitmap;
                                  te.condenseWhite = t.condenseWhite;
                                  te.displayAsPassword = t.displayAsPassword;
                                  //te.embedFonts = t.embedFonts;
                                  te.filters = t.filters;
                                  te.gridFitType = t.gridFitType;
                                  te.height = t.height;
                                  te.opaqueBackground = t.opaqueBackground;
                                  te.restrict = t.restrict;
                                  //te.selectable = t.selectable;
                                  te.sharpness = t.sharpness;
                                  te.thickness = t.thickness;
                                  te.transform = t.transform;
                                  //te.type = t.type;
                                  te.useRichTextClipboard = t.useRichTextClipboard;
                                  //te.wordWrap = t.wordWrap;
                                  //Assign text last
                                  te.htmlText = t.htmlText;
                                  return te;
    //And the create method it uses
    public static function create( text:String = "", width:Number = NaN, type:String = null, multiline:Boolean = false, wordWrap:Boolean = false, selectable:Boolean = true, embedFonts:Boolean = false, font_or_textformat:*=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null ):TextFieldEx
                                  var tf:TextFieldEx = new TextFieldEx();
                                  tf.width = isNaN(width) ? 100 : width;
                                  tf.defaultTextFormat = (font_or_textformat is TextFormat) ? (font_or_textformat as TextFormat) : new TextFormat( font_or_textformat as String, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading );
                                  tf.embedFonts = embedFonts;
                                  tf.multiline = multiline;
                                  tf.wordWrap = wordWrap;
                                  tf.selectable = selectable;
                                  tf.type = type;
                                  tf.text = text; //setting text last ensures the text line metrics returns correct values
                                  //Initialize the TextField's size to fit the text.
                                  if (!multiline)
                                            //When in single-line mode and no specific width is given,
                                            //expand width to entire line.
                                            if (isNaN(width))
                                                      tf.width = tf.textWidth + 4; //match width of text
                                  //Height is always automatically adjusted to fit the text by default.
                                  //It's better than the arbitrary 100px default height.
                                  var minimum_height = tf.getLineMetrics( 0 ).height;
                                  var h:Number = tf.textHeight;
                                  tf.height = (h < minimum_height) ? (minimum_height + 4) : (h + 4); //match height of text, ensuring height is at least enough to display one line, even if there is no text
                                  return tf;

  • Function in a rawValue

    The below script allows me to place a date from mm-dd-yyyy format e.g. 05-17-2004 into Month Day, Year format, e.g. May 17, 2004. I used a Script Object function to convert the date. However how do I run the function inside the textfield.rawValue =  without the script giving me an "undefined".
    //Letter References Content
    form1.Textfield.rawValue = "(a) Your previous Letter, RA-XX dated " + SOdateConverter.fxdateconverter(form1.Submissiondate.rawValue,LONGDATE) + LONGDATE.value + "\n\n" + "(b) GPA LOA " + form1.loaTrackingnumber.rawValue + ", GPA Letter Number 10B-XX dated " + SOdateConverter.fxdateconverter(form1.loaDate.rawValue,LONGDATE) + LONGDATE.value + ".";
    Better said this script outputs the folloowing
    (a) Letter RA-XX-XXXX dated undefinedApril19, 2010
    (b) GPA LOA N129EDPO, GPA Letter Number 104B-XX-XXXX dated undefinedMay 22, 2010
    I want to remove the undefineds. I tried placing the function in brackets
    {SOdateConverter.fxdateconverter(form1.Submissiondate.rawValue,LONGDATE)}
    did not work.
    Any ideas?

    Any chance you can post a link to the form (letter) using something like dropbox or acrobat.com - I'd be happy to solve it for you.
    cheers
    techtaketwo

Maybe you are looking for

  • Why can't I markup text in PDF-A in Acrobat X?

    I am using Acrobat Pro X. I have a PDF file (Version 1.4, Acrobat 5.x, created Dec. 2009). When I open the file, I see the message, "The file you have opened complies with the PDF/A standard and has been opened read-only to prevent modification." I w

  • How I generate index markers using Applescript and tagged text!

    One of the challenges I've faced in automating the book making process using Applescript with inDesign is that there don't seem to be any AS commands for making new index markers (anyone please correct me I if I'm wrong about this). I've tried variou

  • WMI Query to SCCM 2012 results zero results in c#

    In 2007 this works without issues, however in 2012 when attempting the 2nd query it returns zero results.  However if I do this manually I can produce results...Here is my code: using (WqlConnectionManager connection = Connect(getServer))    string q

  • Find errors in jsp

    Hi! Following problem: I have a large jsp File. During execution of this File the server generates a html File which will be displayed, if there are no errors. But if an error occurs it will be displayed which the line number of the generated file. B

  • Web Product Doesn't Cut It

    The user interface for this WISIWIG product is kinda clunky, and despite the effort, I'm not sure it even meets the needs of a cottage user. First, I would recommend taking a look at Googlesites. It is easy to use, but it also has some challenges I d