Solved

Cursor Insert problem

Posted on 2004-09-20
6
155 Views
Last Modified: 2010-04-03
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
Comment
Question by:Docjayman
6 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 12107336
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
 

Author Comment

by:Docjayman
ID: 12119702
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
 
LVL 10

Expert Comment

by:muso120999
ID: 12120360
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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 7

Expert Comment

by:fixitben
ID: 12128918
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
 
LVL 7

Accepted Solution

by:
fixitben earned 125 total points
ID: 12128933
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
 

Author Comment

by:Docjayman
ID: 12183449
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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 what frame rate is, how to control it and what effect it has on the video.

776 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