flash actionscript:
Hey all, I'm trying to pass my variable from an input text field to another MC by copying the same input text field in an MC. I want the same info typed in to show up on another page of the main movie. I'm not getting anything when doing this. What am I doing wrong? Thanks!
try something like this... : myFirstInput.onChanged = function(){ _root.mySecondMC.mySecondInput.text = this.text; } that will make what appears in the text of one appear in the text of the other simultaneaously hth cheers,
Ok, but what if, after looking at my movie, the input text fields aren't within an MC, but on the main timeline, and in order to have the page that I want printed it has to be an MC with the previously inputted text fields. Would this still work?
If you are leaving one frame and going to another where there is to be some text displayed... then save the first as a variable... on whatever button/clip/function that moves to the printing movieClip myVar = myInputText.text; then on the printing movieClip myPrintText.text = myVar; does that make sense?
Ok, so the input text on the main timeline has a variable set (let's say I name it 40320A) and I go to an MC that will print this input text (because I'm making the field bigger so the user will be able to read all of their text) where exactly would I put the code to "remember" the variable from the timeline? Thanks and sorry I seem a little dense;)
Well for a start you won't name it 40320A... It is bad practice to begin any named instance with a number... Flash doesn't like it at all... What is going to take you to the print moveiClip? if it is a button, on(release){ var40320A = myInputField.text; // plus the actions that go to the print area } then on the other movieClip, you just use that variable for the text in the field
Don't see what you're looking for? Try a search.
|