Use a variable to reference a text box in an instance

Hello

I have been enjoying the discussions on this forum and have learned much from them so far.

I have a question, but I don't know if I have that Word correctly, or I looking in the wrong place.

Let's say I have 3 Movie Clip symbols in my library: Movie0 Film1 and Movie2

Each film has a dynamic text box: "TextBox1".

I want to be able to write a function that can manipulate the alpha(or any attribute) of the TextBox1 in all three clips.

In my limited experience, I thought I could do something like the following:


for (var row: int = 0; line < dataArray.length; line ++)

{

Movie (row). TextBox1.alpha = 1;

}

I hope that this loop 3 times and the value of the TextBox1 alpha in all three movies at 1.

Is this possible? You can reference an instance with the use of a variable?

All advice is greatly appreciated.

See you soon!

You say that these clips are in your library, so no code can affect them while they are there, except for dynamically creating instances of them and place them on the stage.

So I guess you're saying that you have dataArray.length number of clips on the stage with the instance names following the naming scheme you have indicated:

for (var row: int = 0; line)< dataarray.length;="">
{
   This ["Movie" + String (Row)]. TextBox1.alpha = 1;
}

Tags: Adobe Animate

Similar Questions

  • Help, DG filtering using the combobox controls and the text box

    I have a DG populated an arrayCollection collection. I have a text input where I can type in my search criteria to filter the DG. I also have a combo box that contains a list of all the columns in my DG, so I can determine what column to apply the filter.

    I was able to make a filter text on a DG in the past, if I use a static data in my arraycollection collection name, but this time I want it to be dynamic using the drop-down list box.
    Here is an example of my configuration:
    DG contains columns A, B, C, D and E. The drop-down list box contains the choices A, B, C, D and E - including the label and the value of the data are the same in this case. If I select choices from the drop-down list box and start typing in my text entry, the DG should start to filter according to my entry that is contrary to the values of column D.

    Here's my code work for static column D filtering:
    private function filterColumn (): void {}
    sFilter = TextFilter.text;
    myAC.filterFunction = doFilter;
    myAC.refresh ();
    }
    private void doFilter(obj:Object):Boolean {}
    var result: Boolean = false;
    If (! obj.) D.Length | obj. D.toUpperCase () .indexOf (sFilter.toUpperCase ()) > = 0) {}
    result = true;
    }
    return the result;
    }

    This code will allow me to type in text and it will only filter the D column. The value of the combo box has no importance at this stage.

    I need the code to make what use the value combobox.selectedItem.data instead of D. However when I try this, he told me - TypeError: Error #1123: filter operator is not compatible with the Object type

    Using most of the above code, I just changed the IF statement to:
    If (! obj.) (cbx.selectedItem.data) .length | obj. ((cbx.selectedItem.data) .toUpperCase () .indexOf (sFilter.toUpperCase ()) > = 0)
    And which generates the above error.

    Can someone help me find a way to replace by a static column for the dynamic combobox value value? Any help is appreciated.

    I thought about it.

    If (! obj [cbx.selectedItem.data] .length: obj [cbx.selectedItem.data] .toUpperCase () .indexOf (sFilter.toUpperCase ()) > = 0)

    For anyone who wants to try it.

  • Using null values to change the text boxes

    Very simple question, I think.

    I have a form with rows of data.  All I want to do is say that if a given field in a line 'description1' is not Null, then fill another field with a specified value.

    jA

    If (descriptionFieldName.rawValue! = null) {}

    otherFieldName.rawValue = "value you want to give."

    }

    If there are multiple lines of information, you need to add the subform with expression, but also a number of occurrence so it wil know whoever you want. I will I use to specify the appearance:

    If (. descriptionFieldName.rawValue line (i)! = null) {}

    Line (i).otherFieldName.rawValue = "desired value tto give it."

    }

    Paul

  • I need to use a variable in place of the name of the instance

    I have a MC with sub of instance name that has a MC with instance name 9 in.

    I'm using AS3

    var itemNo: String;

    Sub.Item9.addEventListener (MouseEvent.ROLL_OVER, handleRollOver9);

    function handleRollOver9(e:MouseEvent):void {}
    itemNo = e.target.name;
    trace (itemNo);


    void. itemNo.removeEventListener (MouseEvent.ROLL_OVER, handleRollOver9);
    void. itemNo.gotoAndPlay ("s2");
    void. itemNo.addEventListener (MouseEvent.ROLL_OUT, handleRollOut9);
    }

    When I trace itemNo it returns 9 is what I want to spend in the last 3 lines.

    in the last 3 lines if I replace itemNo by 9, it works.

    This is what I get in the output window:

    9
    TypeError: Error #1010: a term is undefined and has no properties.
    at test1_fla::MainTimeline/handleRollOver9() [test1_fla. MainTimeline::frame1:25]

    also I tried to use e.currentTarget.name which did not help.

    Use the scoreboard operator to force the flash to fix ropes to objects.  but in your case, use:

    Sub.Item9.addEventListener (MouseEvent.ROLL_OVER, handleRollOver9);

    function handleRollOver9(e:MouseEvent):void {}
            itemNo = e.target.name;
            trace (itemNo);

    e.currentTarget.removeEventListener (MouseEvent.ROLL_OVER, handleRollOver9);
    e.currentTarget.gotoAndPlay ("s2");
    e.currentTarget.addEventListener (MouseEvent.ROLL_OUT, handleRollOut9);
    }

  • Link several text boxes to the same variable

    I make labels in Illustrator and want to automate the process somewhat by using variables. I have places date 4 on labels and would rather just change a variable 4.

    Is it possible to create 1 variable and link several text boxes to this variable?

    I tried selecting the boxes and pressing "making dynamic text." This creates several variables that appear to be linked – if I change the name of one, the name of any changes to variables.

    However, if I save variable library and try to change the value of the variable, I get a "the incoming variable library is invalid" error when I try to load it back in. This happens if each variable is bound to a single text box.

    Any ideas on how to make this work?

    Nope. You will need four variables, unless the design lends itself to a direct effect, such as the transformation of the copies. The symbols are not an answer: a text object linked as a variable cannot be stored as a symbol and still working its variable behavior.

    JET

  • Adding text or text box

    I use Acrobat X Pro.  I have a collection of some 30 pdf files that I need to mark as evidence in legal proceedings.  I need on the occasion of the first page of each (or all pages) with a text like "CaseName/room AA - 001," CaseName/room AA-002"and so on." I have some flexibility with the text and formatting.  What can recommend you as the best way to do this?  I'm looking for something a little better than just using the typewriter tool.  I remember well, sometimes using the headers and footers in earlier versions, but I can't find how to do in this version.  I want that some level of consistency and a professional look reasonably.  I've created PDFs.  They are all copies of letters, memos and other paper documents (scanned by others, a long time ago) for the 1950s, 60 and the lilke so I can't go back and review.  All looking for answers (a futile task, I must say) I've seen references to text boxes and videos that are no longer available.  I played a bit with a text box, but was able to change the font color from red to something else, like black.  In other words, I went through the motions of chaning the color line and the police (if I remember), but the police remains red.  Red is not acceptable, especially when all the available of thke printers and the documents themselves are in black and white only.  I'd appreciate any help!

    .

    Why not use a watermark?

  • Highlight the area of text disappearing when a variable is used in this text box

    Dear all

    I spent ages setting up a quiz in Captivate 8 allows partial scoring on several slides and then provides feedback to the accepting of a quiz on correct/incorrect responses.  Because the partial scoring options from Captivate are so limited, I had to make abundant use of the advanced Actions number of (a) the number of correct answers (assigned to a variable called "c1") and then (b) if some but not all the answers are correct, display a text box stating the number of correct answers.  The text in the text box is simply "You got $$ c1$ $ right." and results in the text box saying 'You're right' 2 If c1 is 2.

    However, for some reason any highlighting in the text box turns off if I put a variable in there.  For example, if the text box has the normal orange highlight given to partially correct captions, this nail does not appear if I include the variable, but it does not appear if I simply say "Partially correct.".  Does anyone know how I can fix this you problem?  I have searched previous questions on this site and on the internet but couldn't find anything.  I also tried to clear the cache of Captivate on my computer, but it does not help this problem.

    All the most popular thoughts.

    Simon

    Replacement of the legends of forms for SFH is only available since this version.

    The only interactive object that can be added to a question slide is the form button.

    Buttons on Question/Score of Captivate 6 slides? -Captivate Blog

  • Input record Input TextBox in variable, using in the text box on another frame

    Hello

    Have tried without success to save user input in an input text box, save in the variable and use this variable to fill in an area of dynamic text on another frame.

    First image:

    var a:String;
    var b:String;
    var c:String;
    aName1.addEventListener(Event.CHANGE, inputCapture1);
    function inputCapture1(e:Event):void{
    a = aName1.text;
    }
    bName1.addEventListener(Event.CHANGE, inputCapture2);
    function inputCapture2(e:Event):void{
    b = bName1.text;
    }
    cName1.addEventListener(Event.CHANGE, inputCapture3);
    function inputCapture3(e:Event):void{
    c = cName1.text;
    }
    
    

    Then on another frame (later)

    dynamictextbox1. Text = a;

    And so on, on the other images.

    So far crushed the overview of debugging. If I take the script on the first image and setting later, not crash.

    Any help appreciated.

    You must have the layer with the code above, extended until the frame later so that these variables are available here.

  • How to use the result of widget radio selection to 'show' a text box?

    Hello again,

    I have a question about widgets.

    What I want to do is to take the result of radio button widgets (in this case 1 2 rather long sentences that were available) and which will display a text box on another screen.

    Background: I have a series of slides where I ask the questions of the learner through Radio button widgets and so I get a number of variables (= penalty) they choose.

    The question I have is that I want to display all the choices they made on 1 page. Because the possible answers are relatively long I have run out of space if I simply inserts

    variables to shown as such and/or the police gets too small.

    So my idea is to use the answer that they choose to make a text box with a shorter version of the same appearo of sentence on this slide 'results '.

    So my idea is to have the learner to make their selection, then use a tip action to check what answer (= the option button), they clicked on.

    What I would do through "If XYZ variable ' 'contains (a keyword of the long sentence)' then 'show textbox YZ' etc.

    Question 1: Is this the most simple/more convenient way or I can save me time somwhow?

    2 "contain" a medium of action adv. the exact text or it may be just one of the words (out of the long sentence that could be selected)? I ask because then I have to use the same long exact phrase in the NOA that seems awkward.

    3. I need to create a separate fast action for each radio widget, I've used. Is this correct?

    4 if I then say 5 adv. actions for different questions, I asked what should trigger these advanc. action? The goal is just to shorten the long sentences in the selections made?

    If I use ' enter' for all the screen I just started one, I haven´t?

    Many probably incorrect assumptions, on my part, I guess...

    Any help is greatly appreciated!

    In my example the var who will get the short sentence is v_class. It's always the variable associated with the interaction of radio buttons. You have as much of these variables to be inserted on the last slide you have interactions button radio please never enter the variable to insert, but use the X button in the role of composition of the properties panel for the text container. Variables are case sensitive, in this way, you will avoid typos.

  • Using a little code on Master Page to fill the page names in the text box?

    I was wondering if Muse has any codes that you might put in a box of text on the main Page so that all pages using this master to have their name filled in automatically on this page (e.g. a Page title - about us, Contact, etc.) instead of manually add a text box on each page in a particular space. The short code would make reference in the name of the page on the Site Plan and fill in this text on the page.

    I tried searching using different formulations, but have not found solutions to this particular problem.

    Thanks in advance for your suggestions.

    You can use getfunction to pull up the page title and display it on the page, if it is only on display name of current page on the body of the page, insert this code into html master page properties:

    Thank you

    Sanjit

  • Acrobat 9 pro - how I made reference to the text in another text box on another page?

    Near the top of every page in my form, I have a text box that users enter their company name.  Unfortunately, there is the same information requested on each page in the form.  It's too far down to use a header, but I don't think that you can place a field in the header.

    I know that you can use the tab calculate to reference the numeric values in other areas, for the purpose of mathematics.  What I would do is: have other company name fields in the rest of the premiera reference document so that the user should only enter once.

    I was responsible for the search and search on Google without success, and I even checked the manual reference but not found in logical areas.  Is this possible with Acrobat 9 Pro?

    Thanks in advance for your help.

    Gregory

    Just give all the fields of the same name, and they will automatically have the same value.

  • Add up the scores in the text box with a variable

    Hello

    I create a quiz form that does not use the quiz slides (5,5) standard Adobe Captivate. I get the learner to mark themselves and enter the score into a text entry in a TextAreaWithVariable area. The scores are then displayed on the last page in the corresponding text box TextAreaWithVariable.

    I wish that Captivate to add up the scores on the last page. I've read somewhere that you use Actions in advance, so when the student enters the page it triggers the calculation by using the action of the Expression. The problem is that when you configure the action, it does not recognize the three TextAreaWithVariables on the page. They are all appointed, but the action does not pick up them.

    Could you get it someone please let me know where I am going wrong here.

    Thank you very much

    Nick

    Hi Nick,

    I've been blogging on the use of the text with Variables by Jim box:

    Extended features

    In the article referenced to in this post, you will find explanations in detail the advanced actions that I used.

    But I'm a little afraid that I need additional information:

    • you have a text box, with its variable partner on one page and this variable gets its value (20) by the user
    • How many of these slides you?
    • but then, you talk of multiple partitions that you want to summarize in a total variable to be displayed on another TextArea widget to the last slide.

    How you trigger the advanced actions to calculate the sum? I suggest that use you the action on enter each slide after the first question slide to temporary sum. Try to explain:

    1. Score of the first slide in question entered by the user and stored in the variable v_quest1
    2. Entering the second question slide create this advanced standard action triggered by action on enter on this slide
      • Expression v_sum = v_sum + v_quest1
      • Continue
    3. Entering the third question slide create a similar action with the score stored in v_quest2
      • Expression v_sum = v_sum + v_quest2
      • Continue
    4. When you enter the slide of score you the last of this breakthrough of similar actions to trigger and the final result will be in v_sum

    If you do not need to keep the individual from each question scores, you can even re - use only a single variable v_quest that would be associated with all widgets except on the slide to score and you can reuse the action advanced on each slide without having to edit.

    Lilybiri

  • Quiz variable not followed responses from text box

    Hi all

    I'm having a problem for the Captivate Quiz variable to track the right answers in a text box. I am using Captivate 5 and try to do a quiz where someone will enter data that will be validated and branch out of their responses. I've implemented several text boxes, turned on the validation, check the "Include in Quiz" and add it to the boxes of responses total and report. See the picture below:

    10-28-2011 4-16-44 PM.png

    I try to the branch with the help of a tip action that checks if the variable cpQuizInfoPointsscored and branches in function out of their score. But the variable still shows 0! (I put in place a text caption to display the variable I went for check.) Here's the weird part, I have the quiz results slide in the presentation, and IT shows precisely the results of the test boxes. But for some reason any Quiz Variable is not monitoring them! Any help?

    Hello and welcome to the forum,

    Your question, I know that you use CP5.0, correct? This "bug" has been fixed in Captivate 5.5. Has been one of the users who had insisted (in bug report) to have all system variables Quizzing updated after each question and not only once the quiz is completed, the score slide. now that you're bumping into this issue: the cpQuizInfoPointsscored score is tracked and must have the scores for text input areas or any other inventoried object (all appear in the Advanced Interaction Overview - F9) but only to the score slide.

    I had a work around in CP5 (described somewhere in an article or a blog post), using the variable Quizzing which IS updated after each question: cpQuizInfoLastSlidePointScored.

    If you want the functionality of CP5.5, you will need to follow the final score in a variable user in advanced actions. It of not really that hard, since you're already using advanced actions, step by step

    • Create a variable user v_currentscore
    • upon entering each slide of the question have this statement executed (if you do not already have a tip for this event Enter action, and it is the only statement, better add continue as second statement)
      • Expression v_currentscore = v_currentscore + cpQuizInfoLastSlidePointScored
    • Now you can use this variable user for your check instead of cpQuizInfoPointsscored, you understand that it is only updated on the slide after the slide where the question is answered? Let me know if there is a problem

    Lilybiri

  • Add a picture to the text in the text box to the location of the cursor through Actionscript and control its reference level

    If I want to add pictures to the location of the cursor in the text box, I need to use EditManager insertInlineGraphic. But insertInlineGraphic offers no parameter to control how an image is placed in the text, such as baselineShift.
    While InlineGraphicElement allows me to well control on image added how is placed in the text through properties such as baselineShift, but then there is no way to add this InlineGraphicElement object newly created as the location of the cursor in the text box!
    So, how do you overcome this limitation? How can I add an image to the text in the text box to the location of the cursor through Actionscript and control its reference level?

    Post edited by: DilipShah

    After you add the ILG, you can find the ILG element by textFlow.findLeaf (cursor location) as InlineGraphicElement and then change its attributes. Or you can just enjoy applyLeafFormat().

    FindLeaf is an important function for navigation in the TLF.

  • Several Variables in a text box or text field


    Is there a way to set different variables in a text area so that spacing between the line will be compatible?


    Or do I need to break the text box in separate text fields?

    (I searched the forum but have not found an answer.)

    It's really very simple. I wonder if there is a way to have more than one variable in a textframe?

    What do you mean by "variable"? Has Illustrator to an entire function defined in the user interface, called Variables. There are a range of Variables. If that's what you're talking about, then no, you can't bind multiple variables in a single text object. The so-called Variables data-driven are related to the object level.

    If you're talking about the generic term of 'variable' in the sense of a script language, then Yes, of course you can replace text different ranges within a single textFrame with the values of several variables - as long as the values of the variables in question are text. Or, you can use the text of text ranges in one or more frames of related as the values of several variables.

    Or should I abandon this script and write my own?

    Yet once, nothing more than a description very vague and General what exactly you're trying to do. So, Yes, given that the purpose of this script is to simply concatenate the contents of several frames of text bound in one alone, and it is quite complex, my guess would be that you need to write your own.

    Basically, if I have a list of addresses and hours of operation in a dataset. Currently, they are divided into separate, linked text frames.

    Again, you use a term (dataset) which implies that you do refers to the function of Variables in Illustrator. If you speak only attach the text of several frames of separate linked text in Illustrator into one, you can do this in the user interface without any manuscript at all: just copy multiple text objects, download the text and create a new text object and paste tool.

    If you need space, paragraph returns, or some other delimiter inserted at the beginning or end of objects separated prior to joining them through the normal in the user interface, you can take a look at the description of the scripts here named JET_ConcatenateTextAtEnd and JET_ConcatenateTextAtStart.

    JET

Maybe you are looking for