Solved

Problem with createTextfield scope

Posted on 2003-11-05
2
181 Views
Last Modified: 2012-05-04
I'm having major problems controlling textFields (F7  publishing for F6 using AS1). The code below sits in a movie that is loaded (via loadMovieNum("IDInfo.swf", 111);). A button click from _level0 calls this function:
[code]
function ShowIdentityInfo(){
  this.createTextField("showText", ++depthCounter, 0, 0, 0, 0);      
  this.attachMovie("enterButton", "myError", ++depthCounter);
  trace("this from main = " + this); //returns _level111

  this.attachMovie("enterButton", "myError", ++depthCounter);

  myError.onRelease = function(){
  trace("this from main = " + this); //returns _level111.myError

   trace(_root.showText.htmlText);//returns the correct text.
   removeTextField(_root.showText);
   _root.removeTextField(showText);
   trace(_root.showText.htmlText);//still returns the correct text
//but why?
}
[/code]
The whole point here is to allow a button click to control the text field. The traces show that I'm scoping it correctly, doesn't it?
0
Comment
Question by:juststeve
2 Comments
 

Author Comment

by:juststeve
ID: 9690654
I should have made it clear that the 'removeTextfield' statement does _not_ remove the textfield.
0
 
LVL 27

Accepted Solution

by:
negatyve earned 250 total points
ID: 9691311
this, is the correct sintax...

_root.showText.removeTextField();
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now