Copy link to clipboard
Copied
hello guys, I would like to something about textbox in oop method.
the scenario is: I have a textbox inside the stage. I'm just wondering how will I control and access it using oop methodology.
Thank you in advance guys.
Copy link to clipboard
Copied
assign an instance name in the properties panel and use it to reference that textfield.
Copy link to clipboard
Copied
yes that is the method that I'm using when I'm doing a timeline base flash project. I'm just wondering how will I going to use it using class file.
Copy link to clipboard
Copied
are you asking how to create a textfield from a class file? if yes, use the following from a display list class
var tf:TextField = new TextField();
addChild(tf);
if you're asking how to reference an already created textfield from the parent display list class, assign an instance name in the properties panel and use it to reference that textfield.
Copy link to clipboard
Copied
what i'm trying to do is to reference a textfield from stage. I already tried to use instance name but it doesn't work
Copy link to clipboard
Copied
It depends on the scope of this class file.
If it's the Document Class, (set in the properties pane), or a classed linked through AS Linkage, then it's just a matter of referencing as kglad noted.
Otherwise, it will have to referenced via another method depending on the class.
How is this class being created?
Copy link to clipboard
Copied
again, if you're asking how to reference an already created textfield from the parent display list class, assign an instance name in the properties panel and use it to reference that textfield.
if you're trying to reference from some other class, you'll need to use the correct reference which depends on the relationship between your class'es scope and the textifield's parent movieclip.