Does anyone know if its possible to access children elements in a SWC? I have created some MC's and inside of some of these MC's I have some dynamic textFields. I export the content to a SWC and load it into my Flex project. No problem loading it or accessing the parent elements, they display fine. But I want to access the textfields nestes in the MC's and modify the text. When I debug the app, I can see the textfields as child elements. It's typed as a TextField and the Instance Name is the same as input in the Flash IDE but I cannot access it. When Flex compiles it throws an error saying it doesn't recognize the method. I've tried to insert actionscript on the timeline, linked external 开发者_JAVA技巧classes and nothing can be accessed. Does anyone know of a way to do this?
It's hard to say since you're not showing your code that fails, but I suspect you're doing:
import myswc.*;
myswc.Symbol1.myTextField.text = "Foo"
instead of
var clip:MovieClip = new myswc.Symbol1();
clip.myTextField.text = "Foo"
I just bumped into this as well, and am curious as to why you're suggesting he's NOT using the instance name since myTextField is obviously an instance name for the TextField he's using....
精彩评论