Solved

Problem with createTextfield scope

Posted on 2003-11-05
2
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

737 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