Text Field Focus

  • dhonsvick
  • Beginner
  • Beginner
  • dhonsvick
  • Posts: 49

Post 3+ Months Ago

Hello,

I have a simple forms application
I am trying to force focus to certian fields when I load a clip.

var the_form:MovieClip = my_card.PutClip(_root,"my_form",-500,125,280.1,186.9,225,125,"my_form","easeOutExpo");

This us a UDF that essentially "attaches" a movie clip to _root and animates it in.

In this case my Movie Clip Path is returned from my putClip function and is stored in the the_form variable.

This all works properly, my only issue seems to be getting the focus to be set period.

I am using the following syntax - perhaps it's incorrent.

Selection.setFocus(my_form.cool_text_field);

if I put it directly in the movie clip it works

Selection.setFocus("cool_text_field");
Honestly, I like to have all my code located in a central area, or class this doesnt feel right =)

Flash 8 AS 2.0, any thoughts how I can do this from my class? Could the issue be croppign up from using the attachMovieClip function?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • montyt
  • Proficient
  • Proficient
  • User avatar
  • Posts: 275

Post 3+ Months Ago

if u r looking for the setFcous and onKillFocus dan try this code

Code: [ Select ]
name_txt = "name";
txt1.onSetFocus = function (){
    if(name_txt == "name"){
        name_txt = "";
    }    
}
txt1.onKillFocus = function (){
    if(name_txt == ""){
        name_txt ="name";
    }
}
  1. name_txt = "name";
  2. txt1.onSetFocus = function (){
  3.     if(name_txt == "name"){
  4.         name_txt = "";
  5.     }    
  6. }
  7. txt1.onKillFocus = function (){
  8.     if(name_txt == ""){
  9.         name_txt ="name";
  10.     }
  11. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.