• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Cursor Insert problem

This function won't work - Selection.setFocus("text1");

Using Flash MX 2004
text box properties = input
instance = emailx
var = email

Also, all the code underneath it executes fine and it doesn't work on other input boxes as well.

Any ideas?
0
Docjayman
Asked:
Docjayman
1 Solution
 
ZefferCommented:
the path ..("???")...is a literal string to the variable
it can be relative or absolute

so if the textfield is on the main timeline.. the code would be..

Selection.setFocus("email");  //relative

or

Selection.setFocus("_root.email");  //absolute

or if the field was in a clip called .. clipOne ..

Selection.setFocus("_root.clipOne.email");  //absolute

Z


0
 
DocjaymanAuthor Commented:
Yeah, I tried all of those but it still doesn't work.  I also tried using other text boxes but still nothing.  I am not sure what it could be because the code is so simple.
0
 
muso120999Commented:
Have you tried it without the quotes?  It seems to work equally well with or without!

Also try this before the setFocus, to check whether your path is correct:

trace(email);

and if you get "undefined" in the output window, try the other suggestions that Zeffer made ( i.e. trace(_root.email); ).  If it always comes up undefined then this is your problem, and you can use:

trace(this);

to give you the path you need.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
fixitbenCommented:
Just something else You won't see the cursor inside flash you will only see it once inserted into a webpage or just playing the swf by its self.  

Fixitben
0
 
fixitbenCommented:
Try this Place this in the Same frame with the text box

Selection.setFocus("emailx");  

You have to point to the instance not the Var. Duh


Fixitben

0
 
DocjaymanAuthor Commented:
If someone could email me at cr.c@lycos.com, I would be happy to attach the small file.  Maybe I am just missing something really dumb.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now