all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

passing dynamic text to a dynamically created MC


passing dynamic text to a dynamically created MC aidanRowe
2/1/2006 10:07:26 PM
flash actionscript:
dear answerer of questions,

I am dynamically attaching movie clips on the stage, these clips, one by one
dynamically appear on the stage, building up over time. I want to now add a
text field to each movie where I will pass some text into.

When I do this statically, ie. place the MC directly on the stage it works
fine.

I have placed this scripting on the launch button, and removed extra code from
the example below.

- firstURL2 is the name of the new MC being placed
- firstURLDynText.text is the name of the text box inside of the MC

----
launchButton.onRelease = function() {
this._parent.attachMovie("nodeLinkFirst", NodeFirst,
this._parent.getNextHighestDepth(), {_x:currentX, _y:currentY});
this._parent.attachMovie("firstURL", firstURL2,
this._parent.getNextHighestDepth(), {_x:currentX+10, _y:currentY});
this._parent.firstURL2.firstURLDynText.text = startURLBox;
};
----

Any thoughts?
Aidan
Re: passing dynamic text to a dynamically created MC unusedname
2/2/2006 10:43:35 PM
1. Does nodeLinkFirst MC contain a textfield named firstURLDynText?

Re: passing dynamic text to a dynamically created MC aidanRowe
2/5/2006 9:49:29 PM
Originally posted by: unusedname
1. Does nodeLinkFirst MC contain a textfield named firstURLDynText?

No, firstURL MC contains the textfield named firstURLDynText, that is where I
want the text to appear, not in nodeLink MC. Am I missing something here?

2. Have you defined the linkage identifier for the nodeLinkFirst MC?

I am not sure what you mean here, I have defined the linkage identifier for
nodeLInkFirst MC but that is not related to what I am doing - or at least I
don't think so. I have also defined the linkage for firstURL MC.

can you shed some more light on the scenario?

thanks,
Aidan


Re: passing dynamic text to a dynamically created MC unusedname
2/6/2006 2:13:13 PM
Try adding the following code to the first frame of the movie:

currentX=10;
currentY=10;
startURLBox="Some text";

launchButton.onRelease = function() {
this._parent.attachMovie("nodeLinkFirst", "NodeFirst",
this._parent.getNextHighestDepth(), {_x:currentX, _y:currentY});
this._parent.attachMovie("firstURL", "firstURL2",
this._parent.getNextHighestDepth(), {_x:currentX+10, _y:currentY});
this._parent.firstURL2.firstURLDynText.text = startURLBox;
};
AddThis Social Bookmark Button