ActionScript 2.0 :: Restricting To Upper Case Text
May 24, 2005
I've got a few text boxes address1, address2 etc which I've restricted using
address1.restrict = "A-Z 0-9";
All seems well if you input your address manually, but also there is an automatic feature on the web catalogue I'm working on, where you can enter your postcode and the relavent addresses will be generated in a scrollable list box. You can select an entry from this list box and click OK to confirm this is your address, which will then conveniently fill in all your address1, address2 etc input text fields.
But, when the addresses are generated in the list box they are not displayed in caps for example 92 Green Lane, Moston, Manchester. Like this... and so when you confirm your address each text box is filled in the same case, NOT in Uppercase like I've specified. Anyway to correct this once it passes the address variables into the text fields?
Is there a way to convert the display of the TextInput to upper case? Like this: type h ===> displays H type e ===> displays HE type l ===> displays HEL type l ===> displays HELL type o ===> displays HELLO
I tried using the following, it traces but it doesn't display Code: keyListener = new Object(); keyListener.onKeyUp = function() { // var myText = mainTXT.text; myText.toUpperCase(); trace(myText.toUpperCase()); }
I have some trouble with the conversion applied by BlazeDS to the name of the properties when this name begins with a lower-case letter followed by a capital letter. I have an ActionScript class similar to this:
How can I change the first letter of an input textField so that it is always in upper case ? For instance if my_txt.text= "hello", it would become my_txt.text = "Hello".
Obviously you can do it with a string - toUpperCase() or toLowerCase() - but can you dynamically make a text field upper or lower case? I can't find anything online that has to do with text fields, only strings.
If it's possible to restrict hard returns in text input fields? I've tried something like this: my_txt.restrict="^u0013", and a bunch of variations thereof, but nothing seems to keep the Enter key from doing it's thing. Second best would be to traverse through a string a user has entered and replace hard returns with a space or dash, but again I've had no luck looking for or I've tried entering text and hard returns into a dynamic textfield set to input, but when I try this: var n:Number = my_txt.indexOf(" ")... trace("n: "+n) //traces "n: -1"
it's possible to restrict hard returns in text input fields? I've tried something like this:my_txt.restrict="^u0013", and a bunch of variations thereof, but nothing seems to keep the Enter key from doing it's thing. Second best would be to traverse through a string a user has entered and replace hard returns with a space or dash, but again I've had no luck looking for or . I've tried entering text and hard returns into a dynamic textfield set to input, but when I try this:
var n:Number = my_txt.indexOf(" ")... trace("n: "+n) //traces "n: -1"
I just got Flash CS4 yesterday. This is the first time I have ever used Flash. I watched some tutorials and now I'm trying to do something on my own. I want some text against a white background to start out white in the lower-left corner. During the animation I want the text to move to the upper-right corner and turn black gradually as it goes. What I did was this:
created an actionscript 3 file
Made some white text at the bottom-left
Right clicked at the 90th frame on the timeline and clickedInsert KeyFrame
Right clicked between the 1st and 90th frames and clicked Create Classic Tween.
At the 90th frame I moved the text to the upper right. Then I clicked on proprties and set the text effect to brightness and set the brightness to 0 so the text would be black.When I hit enter to go through the timeline it shows me exactly what I expected: The text moves from lower left to upper right and gets darker as it goes.
When I hit Ctrl+Enter to preview it as a published movie the text stays white the whole time until it gets to the upper right. There it turms black. So all I see is nothing for a few seconds and then a flash of the black text.Also, if I click at each frame in the timeline I can see the text is in a different place and getting brighter gradually.I'd like it to play once rather than looping. Under the effects I clicked on a thing that says play once but it still loops. Where do you control this?
I'm trying to figure out the best way to make the text in the upper right hand corner of my photos page linkable URL...Here's the action script that's in the action layer of the file for that spirt: function loadGallery(directory, images)[code]
I think this can be really easy however i'm not reaching the answer of this question. i have text inputs .......and i want to restrict the input to only Numbers...mytextbox.restrict = "0-9"; now when i try entering the values it works fine.....but but.....i doesn't accept any special characters.and i want it to atleast accept '.' because i want to accept decimal values
If the counter reaches 350 and I move my mouse down now it hops on over to 250. I just want it to start counting down. I.e. 349, 348, 347 and so on. What do I need to change?
//Function function countUp(e:TimerEvent):void{ if (mouseY < 180) {
[code]...
EDIT: What do I need to write in AS3 to make a dynamic text field increase in increments of 1 if the user hovers at the upper half of the screen, and decrease in increments of 1 if the user hovers at the lower half of the screen?Purpose, it isn't a game.
What I have right now isn't actually doing any of those things, I've just been mucking about trying to get all the masks working and they finally are.
I've included the code to offer as much information as possible about my specific project. There is also a few more lines that changes the colour of the dial when the user rolls over the specific coloured bars. I can post that as well if it helps.
To clarify the scene, the arrow part of the dial tracks the user's mouse. Always pointing towards it. The bars, when rolled over changes the colour of said dial. The "73M" is static, as well is "POINTS" but the 380 value is dynamic. It is that string I need to affect.
If anything is unclear please feel free to ask, I've been at this all night so there is a chance I'm so into it that I can't see straight.
I need to replace some text - it's actually a bunch of textInput area data captured and placed together {inputArea1.text}{inputArea2.text} style - and have it placed in an mx:Text text="{inputArea1.text}{inputArea2.text}".So I have the smart idea to pull a switch case, where the case condition is the id of the canvas and it's pulling from the textInput areas.My output from the aforementioned string into my text just yields: Code:function Function() {}I complete this, I can sleep.
I'm making a glossary. The glossary terms and definitions are in an xml file. I have read the terms (the words to be defined) into an array. I have included a search field, such that when I enter a term in the search field, a function loops through the array of terms and if the string I entered in the search field matches an item in the array, Flash traces out "match" (in this early part of coding).Here is my problem: If one of the terms in the glossary is "India Pale Ale", with capital letters, then a search on "india pale ale" turns up no matches.How do I remove case sensitivity in this scenario?
What I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:
Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.
I have been trying to implement the Round Up Power Of 2 algorithm outlined in the following link in AS3.
[Code]...
The algorithm works great for most of the values I've tested. It is mentioned that this will return 0 when given an input value of 0 which is technically incorrect but I'm ok with that output. What I'm not ok with is when given an input of 1 I get and output of 1. I'm thinking that this must be a caveat of AS3 and its wonky uint implementation but I can't seem to figure it out. I have also tried using the >>> logical shift operator to the same result. My C is a little rusty, but I'm not sure how this would even return 2 in C. Can someone explain to me whats going wrong here? I assume if an input of 1 was a special case it would have been mentioned in the above link.
Do you usually set the registration point in the upper-left corner ?I usually have always troubles with the registration point in the center.. or is maybe useful in any situation ?
I have two layers in my flash cs4. Lower layer contains pink color random brush strokes. The upper layer contains black rectangle. I am able to see the pink color brush strokes through my black rectangle as if I have reduced the alpha of the rectangle?
I have a flash menu (125 px x 600 px) on the left of a webpage. It consists of (15) buttons each of them havin' a onMouseOver-->getURL. When the mouse enters the flash movie (that is the menu) there is a mask button that moves along the y axis and when you move to a button in the menu the mask moves to that point. When you click on it it opens the URL in your browser. Now the problem is that when you leave the flash movie (menu) I want the mask to go to the upper part of the movie (menu).How can I do that?
I'm reading a AS-book for a week now, and now it's about fscommands. But I noticed they use both lowercase & uppercase to start the boolean values (true/True & false/False).
I have a situation where my main SWF file loads many external SWF files. However, those external SWF files are just sitting in the public folder of the web server. Is it possible to restrict the SWF visibility to only my main SWF file (the one that loads the external SWFs). In the current state, any user who knows where to look can just type in the URL and get to the SWFs, not to mention rogue bots that don't follow robots.txt.The reason for this is very simple. Users user a username/password to log into the main Flash application and the main Flash application in turn loads the SWF files and ONLY then they are available to the user. Also, depending on who the logged in user is, some SWF files are restricted and not loaded.