|
-
Access Text Field On Stage
I have a text field mainLoadText placed on the stage at authoring time. How do I access it, from the timeline?
If I use stage.mainLoadText I get
1119: Access of possibly undefined property mainLoadText through a reference with static type Class.
and If I use just mainLoadText I get
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Package: ocument/Package::frame1()
-
hippie hater
click it, go in propertys, give it an instance name and use that name
-
Besides it being common sense, I have already given it an instance name of mainLoadText, but I cannot access it.
-
Senior Member
There should be no problem accessing the textfield when it is harcopy on the stage. You cannot use Stage (see error). How do you place it on the stage?
- The right of the People to create Flash movies shall not be infringed. -
-
I just made a new dynamic text field on the stage and named it mainLoadText.
Here is my frame 1 code
mainLoadText.text = "Hello"
-
Senior Member
Works for me. Do you have CS3?
- The right of the People to create Flash movies shall not be infringed. -
-
half as fun, double the price
and the textfield is on the same frame as the code, right? You will get #1009 if not. #1119 is a result of trying to access a variable/instance name from an instance that doesnt have that variable defined for it. The stage object cannot have any variables defined for it outside of its own default definition (plus all objects on the main timeline are in the root instance and the root instance is sitting in stage).
-
I see, that was the problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|