Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2006, 11:13 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default focus insertion point in flash movie

Ok, I have scripted everything (all scripting is in the Actions layer) but have one small glitch. It doesn't make any difference what you type in the User ID field as long as the Password field is correct. I need it to be so that both fields must be correct or it fails.

I don't think I have the "if" line coded right as the user = "red" is being ignored. See code below...


stop();
Selection.setFocus("user_id_txt");
login_btn.onRelease = function() {
if (user == "red", pass == "blue") {
getURL("http://www.microsoft.com");
myText.text = "Successful";
} else {
myText1_txt.text = "Login Failed";
gotoAndStop(1);

}
};
reset_btn.onPress = function() {
pass = "";
user = "";
myText1_txt.text = "";
myText.text = "";
gotoAndPlay(1);
};

Also, when I play it on my flash program, the insertion point focus works perfectly, but when I open on the Internet the focus does not flash unless I click the Reset button first.

I have tried calling it using .html and .swf but the focus does not work.

See it in action here: http://www.networkdriven.com/password.html

BTW, I am using Flash MX 6.000


Rudy
__________________
Rudy
 
Old January 4th, 2006, 11:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try adding && to the comparision statement

if (user == "red" && pass == "blue") {

I am not sure about the focus question.
 
Old January 4th, 2006, 11:53 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - that fixed that problem, now I just got to get the focus to work and I got it done...

Thanks

Quote:
quote:Originally posted by harpua
 Try adding && to the comparision statement

if (user == "red" && pass == "blue") {

I am not sure about the focus question.
Rudy
 
Old January 4th, 2006, 11:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found this, it might help.
http://www.webwasp.co.uk/tutorials/b35-Tab/index.php

mike
 
Old January 5th, 2006, 07:30 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, that URL had what I needed...

Thanks so much!!
:D

Quote:
quote:Originally posted by harpua
 I found this, it might help.
http://www.webwasp.co.uk/tutorials/b35-Tab/index.php

mike
Rudy





Similar Threads
Thread Thread Starter Forum Replies Last Post
flash movie not loading smys123 Flash (all versions) 1 July 17th, 2007 06:39 PM
Flash or swish movie in C# mua C# 0 March 6th, 2007 04:37 PM
flash movie kanoorani Beginning VB 6 0 September 3rd, 2006 08:18 AM
How to get insertion point to focus in textbox? larry Javascript How-To 2 April 30th, 2004 06:45 PM
How to focus the insertion point in a text box larry Javascript How-To 3 April 2nd, 2004 07:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.