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
-
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: