Giving 2 Different Action For " Enter Button " ?
Hi Guys,
I have in the main timeline 2 textfields called "to" and "message" where the user can write using the keyboard, my problem is I need get the " ENTER" button when the user click on it and check in which textfield the focus are in that moment and then make a action according to that focus.
I try create a dump Mc and I wrote the following code:
onClipEvent (keyUp) { if (Key.getCode() == Key.ENTER) { focus = Selection.getFocus(); if (focus == "to") { gotoAndPlay ("message"); Selection.setFocus("message"); } else if (focus =="message") { loadVariablesNum ("sendsms.asp", 0, "POST"); _root.to=""; _root.message=""; } } }
This is right ? probably NOT !!!! Someone can help me on this ?
Ultrashock Forums > Flash > Flash Newbie
Posted on: 2002-03-23
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[Help]giving Button Action
ok, so ive got my button and wat i want it to do but ive got no idea how to script it to do so
now what i want is wen i click on the button the buble will scroll in from the bottum right to a certain width & once the botton has been clicked it changes so wen i click it again the buble scrolls out
thanks in advance
Print Action Is Giving Me Some Problems?
I'm trying to use the print action but every time I go to print it resets my movie clip instances to there original position.
Does anyone know how to avoid having this happen?
thanks for all help
Jason
Prototype Giving Error In Action Script 2.0
Hi,
following prototype is running fine for action action script 1.0 but its giving error in action script 2.0......
Could anybody please tell me why I m having error......
Prototype is here:
Quote:
var str1 = new Array();
String.prototype.lettres = function() {
cOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (cOK.indexOf(this.substr(0, 1).toUpperCase()) != -1) {
str1[str1.length] = (this.substr(0, 1));
}
if (this.length>1) {
this.slice(1).lettres();
}
};
("a213213t3213u321313133l").lettres();
trace(str1);
[/quote]thanks in advance......
Hit ENTER To Have An Action
Hello,
For an input field - i need to have some action when user enters something in the input field and hit ENTER.
I am using this: but with this user can hit enter anywhere on the screen and get the action- i need to have it only when user selects the input field.
Code:
myNewObject = new Object();
myNewObject.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
trace("do something")
}
};
Key.addListener(myNewObject);
PLEASE HELP.
Take Action On <enter> Key
I have a textfield which I want the user to leave when he presses the enterbutton. How do I detect what key the user has pressed and which field has the input foucs at the moment.
Any help welcome.
Thanks Markus
How Do You Assign An Action To The ENTER Key?
hello!
i have a password text field, and besieds having a submit button, want the user to be able to press ENTER key and send them to a certain frame on time line (say frame 10)
how is this done??
thanks,
tm
Assign Action To Enter/pagedown Key
Is it possible to assign an action to the enter key in the keyboard.
I'm creating a presentation with flash, and I would like to have the "next frame" key to activate not just by clicking on it with the mouse but also by pressing "enter" key or "page down" key, similar to the way we work with Microsoft Power Point.
Is it possible?
Thank you.
Efrat.
Key.ENTER Performing Action In More Than One Layer
Ok in Layer (5) i have this relevant code:
Code:
//IF ENTER KEY...GO TO btnSend
k = new Object();
k.onKeyDown = function() {
if (Key.getCode() == Key.ENTER && txtSubmit.text != "") {
sendIt();
}
};
Key.addListener(k);
And on layer (10) i have the following:
Code:
//IF ENTER KEY...trace example
k2 = new Object();
k2.onKeyDown = function()
{
if (Key.getCode() == Key.ENTER && txtSubmit.text != "")
{
trace("working");
}
};
Key.addListener(k2);
When i hit ENTER on layer 10... the action sendIt() from layer (5) is performed...
What i may be doing wrong ?
Giving A Dynamic Button A Value ?
Is it possible to add a value to a button.
At the moment i have written an array of buttons dynamically to the screen
like this
Paul - Button Here
David - Button Here
Karl - Button Here
Rich - Button Here
When a button is pressed it will go to another frame and show an individuals results. So i need to give the button the individual ID.
note: there is a button inside the mc called 'Detials'
this is how i have created me buttons
for (i=0; i<OrgNameArray.length; i++) {
this.attachMovie("yourBut", "c"+i, i);
var q = this["c"+i];
q._x = 605.9;
q._y = 125 +(q._height*i);
q.textf.text = OrgNameArray[i];
}
Sound On/off Button Giving Problems Help
Hey, I'm new to the site and loving it!I recently used Dark_Slayer's tutorial on how to make a sound on/off button and it worked like a charm!, except for one thing that is (as always).
When i toggle between my buttons, sometimes the loop starts playing over itself multiple times until it turns into noise, and especially when i go back to the home page... this is weird because the intro for my site is like 35 frames long which means the homepage animation only starts at frame 35... the sound frames and scripting is in like frame 20, so it shouldn't play the whole start of the sound scripting over and over...
SO CONFUSED...
please help if you can!
Simple Button Giving Me A Problem
I'm making a video tutorial for a client. I'm using flash cs3 for the first time so please bare with me.
1. I have a layer called next-bttn
- on that layer i have a button with the instance name next_bttn
- all i want to happen is once the timeline hits the stop action, for you to hit the next button (next_bttn) and go to next frame ("s2").
This is the error i'm getting.
1120: Access of undefined property next_bttn.
This is the action script i'm using is as follows:
import flash.events.MouseEvent;
next_bttn.addEventListener(MouseEvent.CLICK, nextframe);
function nextframe(event:MouseEvent):void
{
gotoAndPlay("s2");
}
again i'm new to flash and i'm sure its something simple i'm over looking. Thanks in advance
Giving A Button Multiple Functions
I'm painfully new to actionscript, and having a hard time finding basic information on get Property and set Property, and I'm not even fully sure either of these variable controllers are what I need...
I have five scenes that relate to a basic menu (Home, About, Menu, etc) , and want an image to fade in and out of the background each time the appropriate page/scene opens. I've set up each image fading in as their own movie clip, and same for each image fading out.
I have no problem in fading the image in (I've set the 'image in' movie clip on the first frame of the destination scene), but have no idea how to fade the image out when I hit a button to go somewhere else. Basically, I don't know how to set a button with both a goTo action AND the needed play action for the 'image out' movie clip to play. And I don't know what that 'needed play action' is either.
I hope this makes sense! Any suggestions are appreciated - I've been hitting my head on the wall for a while now!
Giving Rollout Effect For Button But In Scrollbar...........
hi all,
sorry to disturb you.
but i am stuck.......
I have a main scene which as a main file as level 0 & i have a movie clip on a layer which as my scrollbar effect & buttons...i want to give rollout for the button how can i give it.......i tried doing on the movie clip but than it stays at one positin bcoz of the scrollbar......can u please help me?? can i give a roll out effect in button symbol it self............or whats the solution...........
thanks a lot.....
amrapali
Giving Movie Clip Button Properties
Hey guys,
I ran into some problems when I created a symbol as a movie clip but I gave it button properties. How can you give a straight movie clip button properties without using that drop down thing in the property inspector? Thanks a bunch
Don
Enter Button Help
Enter Button Help
Hey
I have made a intro but don’t know haw to make it so when some one clicks on the enter text they go to my main site
Ps I am a nooby so pleas explain it simply J
How To Do An Enter Button?
How do i make it so ppl can click on a word that says "enter" and they go to a desired page?
Thanks.
Nate
Enter Button Help
Can you please look at my .fla and tell me what I am doing wrong!
I want the "intro" scene to stop on its last frame.
And I want users to be able to move to the "dougland" scene when they click the enter button.
it was too big for this page w/o zipping it. but try to right click this and "save target as"
http://www.angelfire.com/retro/team...ndprototype.fla
THANKS SO MUCH FOR YOUR HELP!
-Doug
Using ENTER Instead Of A Button...
I have a set up now where a user enters something in an input field and then hits a button to submit their answer. On the buttonClip is all the actionScripting. Is there a way to set it up so that in addition to using the button, a user can also just input their answer and then hit ENTER for the script to run?....
Enter Button
I need to beable to turn the enter button off... so that I can force it not to play the complete movie when pressed... anyway to do this??
I have a very long and tedious swf... that utilizes next buttons and when someone presses enter they screw everything up..
I am attempting to make this web-app as simple and non-end user breakable as possible.
I have flash MX 2004 pro.
Please Help Thanks a Bunch,
Carlos
[F8] Hit Enter Instead Of Using Button
I'm using the password gate found here:
http://www.flashkit.com/movies/Scrip...7689/index.php
I'd like to be able to hit the enter key after typing the password rather than having to click the button. Anybody know how to do this?
Enter Or Hit Button
I would like a button to act in the same way whether the user clicks it or if the user presses enter. I can't seem to get it to do both. Can anyone give me a suggestion with code example? Thanks
An Enter Button
I think I must be missing something here (well probably quite a lot).
I am wanting to have a button which activates a flash intro, I guess like an enter button. The flash needs to be static until the user clicks the button.
I know it should be simple but I guess I need a bit more practice at this.
Enter Here Button
I am trying to do a enter here button with flash mx 2004.
Thanks!
Ebbie
Enter With Button
hey,
I have a chat working with flash, and everything runs like it should. However, I want to make it so that when you press enter it sends the message, instead of having to actually click on the send button. For some reason this does not work. I put this code in:
ActionScript Code:
on(keyPress "<Enter>"){
//the code
}
The same code works when it's on release. The button simply doesn't response when you press enter. I think this has something to do with the fact that the user's focus is on the text box of the chat.
Anyone know how to fix this? Would realy apreciate it
Thanks in advanced
Enter Button From HTML
URL: http://www.markbunch.com/
How do I make the ENTER button on my html splash page a visible rollover? Right now it is a javascript that opens my flash file in the exact size I want it. I am a newbie and cannot figure this out in GoLive. Whenever I make an image map over the button the ENTER button will not open the flash movie. Any help will be appreciated. thanks!!!
Here is my html:
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
onMouseDown="MM_openBrWindow('http://www.markbunch.com/portfolio.html','Portfolio','width=685,height=555' )">
Enter As Submit Button
How I can do something like this:
---
if enter in key board is down then
txt = _root.input.text;
loadVariablesNum("script.php", 0, "POST");
then emty the 'input' value
end if
---
Does someone know how to solve this?
How To Check The Enter Button
Hi,
i'm working on learning arrays and some other stuff. In my excercise (a simple one) i have an array and a search function defined on a frame as follows:
//array defined
userName = ["Erik", "David", "Laurie", "Tanis", "Myk", "Lisa", "Debbie", "Kate", "Terri", "Rayann"];
//focus on the login text field
Selection.setFocus(_root.login);
//define a function to search the array
function searchArray(whichArray, searchElement){
for (var i=0; i<whichArray.length; i++) {
if (whichArray[i] == searchElement) {
return i;
}
}
return null;
}
//initialize variables
login = "";
welcome = "";
the movie is simple. It contains an input text box named "login" with a variable name of the same. Below is a dynamic text box named "welcome" and there is a button
that i can press after i type something into the login box. here is the script on the button:
on (release) {
if (searchArray(userName, login) == null) {
welcome = "You are not authorized";
}else{
welcome = "Welcome, " + login;
}
updateAfterEvent();
}
my question (finally) is this:
how can i make the same script i put on the button run if the user presses "Enter" after typing in the login box? I tried using on(keyPress"<Enter>") on an empty movie clip, but cant seem to get it to work..
thanks in advance,
-myk
Enter Button Does Not Work
Sup everyone,
If anyone can help with my problem that would be lovely. For some reason, in Flash MX, I made an enter button that links perfectly to the site. I post it on Dreamweaver and it works fine internally, but when i post the enter button on the web it does not work. It won't go anywhere
The URL is at the following linkTrotter
Please e-mail me at steveawsm@aol.com
Using Enter Key With Button Callbacks...
Hi Everyone,
Does anyone know whether it is possible to write a button callback function that checks for enter key presses?
An ordinary button callback might look like this:
buttonObject.onRelease = function(){
}
Can it be activated by pressing the Enter key as well?
Thanks!
- Dandylion_13
Enter Button Mischeif
Hey if you check out www.megastarconcerts.com you'll be greeted by an intro i just made up. Here's the deal, when i press enter the first time everything is ok. The old site, with the content, opens in a new window. Just peachie till this point. However, say i close the new window, and press enter again, the flash intro stops and a new window doesn't open up.
Anyone know what's going on?
Or how to get it to open in the same window, replacing the intro, just so they don't encounter the problem.
Thanks, I have more questions, i'm almost done putting the new site togther for a friend of mine, i'm sure i'll have questions regarding small things.
Thanks,
The New Flash Guy
Enter Button And Scenes
Hello eveyone, this is my first post.
Anyways, I am programming a game right now and I found a horrible problem. When I press the "enter" key it switches to the next scene. Now I have tried commands like, if key down do something else.... it just does whatever I told it to do...and still goes to the next scene. Is there some way to negate this effect, or make the enter key unusable? Any help would be great, gotta finish coding this thing by tommorow O_O!! haha, I find the worst bugs till its to late...
From a desperate student,
Ken
Button To Enter A Site
I have a button to enter a site. It's within a movie clip and I cannot get it to "goto" fram 1 of another scene outside the movie clip. Any suggestions???
Enter Key As Trigger For Button ?
I'm doing a flashtop for an online shop, and the search function for the merchandise is located on the flashtop.
I have the search function working, through an input textfield and a button that posts the content from the input textfield as a search.
BUT..... how do I get the input textfield, or the button, to trigger by pressing the <Enter> button ???
Any help would be greatly appreciated.
Stop Enter Button
how do i stop the enter button working in my flash website. I dont want the user to be able press enter when entering a comment.
cheers
hope you can help
Is It Possible To Make A Button Work With The Enter Key?
I REALLY would like some help on this, or at least a professional/expert telling me if it's possible or not.
I have 2 text input fields, and then a submit button which collects the data (username & pw) and sends it like this to an asp file which validates the login. here is the actionscript for layer1,frame1:
function onClick(btn) {
if (btn == submit_btn) {
getResults();
getURL("http://www.mypage.com/validate.asp", "_blank", "POST");
}
}
Now that works, but you HAVE to click on the submit button with the mouse. normally on a login box, you can type the name, tab to password type that in, and hit enter (or at least tab to the submit button and hit enter). right now, you CAN tab to the sumbit button and it appears highlighted, but hitting enter does nothing, so you must mouse click it. is there ANY way to make it where you can submit it from the keyboard?
Simple 'Enter Button' Question
I am making a webpage that has 2 scenes so far.
I have the first scene end with a button that says "enter" that pops up.
I want users to be able to click this button so that they get sent to the next scene.
How would I do this?
Thanks for your help!
-Doug
Enter Button Wont Work
ok we typed in code for enter button to route towards private site after flash ends as such button.onrelease.geturl;(http://www.sitename.com
and heres our error we get
**Error** Scene=Scene 2, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
Enter.onrelease.geturl;(http://www.avidgamers.com/xanarchy/)
Total ActionScript Errors: 1 Reported Errors: 1
please help us asap
enter=button
Press Enter Or Click Button
Hello,
I have this box where users may enter a search word. Next to this box, I have a button that loads what the user typed in in another MC. Everything works except I would like for the user to be able to either press the RETURN button or the search button?. How do you do that?
Thanks,
Luke
Press Enter Key Instead Of Button Click...
Hey all,
Any help would be much appreciated..
I have an application where a search is done on a members table from a database! The User enters in a person they are looking for but then they have to click on the button adjacent to the textarea! I am looking for some code to have the "Search" button highlighted so that when the user presses enter after inputting their search criteria the query is done and the expected results are returned..
I am using Flash MX 2004 Pro with Actionscript 2!!
Thanks again for having a look at my problem..
Kinnego
Disable Enter Button So It's Set For My Functions
Hi!
I have written a code where the space button goes to the next keyframe and I want to use the
enter button to go to previous keyframe. The PROBLEM is that when I use the enter button the
application changes scenes!
Is there any way I can disable that so that I can use the enter button for what I want to do (I want to load the previous frame)?
Is the enter button a standard funtion in Flash MX (2004) and is there anyway I can change that?
Thanks!
Clickable Enter Button In Flash
Hi There;
Still new, still learning.
I created a flash intro page for a website, it is beautiful thanks to the help from Ted_Meister and Lem.
Now my last layer has a button on it that comes from the bottom of the screen and travels to the center under everything else. I want to be able to make this button so the visitor can click on it once it ends its travel. Then when clicked on it will take you to the next page of the website like index2.html. Does anyone know how I can accomplish this?
Pressing Enter Instead Of Clicking A Button
Hi
Can a bit of code be used to do the job of a button when enter is pressed?
Users have to input a number in a box in my movie and then click 'CHECK' button. Can they just press enter and it might do the same job as the button?
Pressing Enter Instead Of Clicking A Button
Is there any way that someone could press enter after typing in an input text box which will double as clicking a 'CHECK' button.
This is the code that is on my 'CHECK' button - and that is what I want to have happen when you press enter instead!
Anyway of doin it?!
I am working in FLASH 5.
on (release) {
if (Number(num6)==Number(num4)*Number(num7)) {
mouse.gotoAndPlay(mouse._currentframe-120);
yessound.play();
num4 = Math.ceil(Math.random()*12);
num7 = Math.ceil(Math.random()*12);
num6 = "";
num2 = Number(num2)+1;
num1 = Number(num1)+1;
Selection.setFocus("num6");
} else {
nosound.play();
num6 = "";
num3 = Number(num3)+1;
num1 = Number(num1)+1;
Selection.setFocus("num6");
}
}
[F8] Hit Enter Instead Of Button On Password Gate
I'm using the password gate found here:
http://www.flashkit.com/movies/Scrip...7689/index.php
I'd like to be able to hit the enter key after typing the password rather than having to click the button. Anybody know how to do this?
GotoAndPlay Next Stage With Enter Button
Can anyone please explain to me how I would use the "Enter" or "Return" button on my keyboard to advance to the next Stage or next Frame within a flash presentation?
I would like to do away with any buttons on the stage. Thank you very much in advance.
Glenn
[F8] GotoAndPlay Next Stage With Enter Button
Can anyone please explain to me how I would use the "Enter" or "Return" button on my keyboard to advance to the next Stage or next Frame within a flash presentation?
I would like to do away with any buttons on the stage. Thank you very much in advance.
Glenn
[F8] Button Release OR Enter Keypress
I'm making a simplistic flash RPG, and we have included some quiz elements.
When you enter this frame, the focus is in the dynamic text box, the user enters the correct number, and then clicks the "answerBtn".
answerBtn.onRelease = function() {switch case here}
But I want the option to either click the "answerBtn", or simply hit the enter button. I know the enter btn code is something like:
on(release, keyPress "<Enter>") { codegoeshere }
But how do I put this into an OR statement?
Something like:
((answerBtn.onRelease) || (release, keyPress "<Enter>)) { codegoeshere }
(The code it runs is on the same frame, and all actionscript is in one layer.)
Can anyone help me out?
Thanks in advance
|