ActionScript 3.0 :: Checking If Textinput Is Empty?
Nov 18, 2009
How do I check if a textInput.text value is empty? I have typed the value as a Number, so when I check if it's =="" it tells me " 1067: Implicit coercion of a value of type String to an unrelated type Number."
How else can I test if a number textInput is empty?
here is my code.
ActionScript Code:
var userAge = Number(ageInputBox.text);
if(userAge="")
{
I'm working with a window scroller component, where the dynamically loaded scrolling content has buttons that load attach mc's to a clip holder in front of the window scroller. To do this I use this bit of code, which works fine:
The "this.enabled=false" is to deactivate the button in the scroll content, otherwise it will still be active in the background. So far so good.
What I need to do, once the "close" button on the attached mc is clicked, is re-enable the button. I'm thinking the way is to check if the attached mc has been unloaded, which I'm trying to do with this:
Code: if (!_level0.slideHolder_mc.content) this.calendarPagesBtn_mc.enabled = true;
I am using a s:TextInput in Flex 4.5. It shows it's prompt text if the underlying text value is null or empty String. Does anybody know if I can make either don't show the prompt on empty String or even show a different prompt?
I have a list of 99 item (something like a phone book) and I will like to sort them in different method. Part of the 99 item might be empty, so the requirement is to move the empty field behind the sorted data in every sorting behavior, here the code we have so far:
Firstly, I have searched the forum for related topics and found 2. I have tried to make sense of the code involved to make it work with my current project but nothing works.
As the title says, I require a string to be given the value from a textinput. As this was not working in my main project I created another simple AS3 file.
The user should just type in their name in scene 1. By pressing a button I trace the variable as a test and on scene 2 I should see the users name, but no.
I have been developing an application for the past couple of weeks and as of yesterday all of the textinputs have become uneditable. It seems like when you click on one it switches between the focusIn state and then back to the focusOut state.
If I drag a textInput from a component and drop it near the end of the another component, the textInput goes outside of the dropZone. <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="[URL]" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="150" height="500" xmlns:components="components.*" > [Code] .....
I have a login form with various textInputs and a submit button. If you submit proper login credentials the system unloads the login view and loads the app view. Pretty standard. Unfortunately I've noticed this weird bug where if you hover over one of the textInput boxes with the mouse, then fill the form using only the keyboard (and leave the mouse parked on top of the textInput), and then tab to the submit button and press the space bar, i.e. login via keyboard, the mouse cursor will remain a caret in the new view, no matter what you do (move, click), until you find another textInput to undo the cursor state. I've tried to do all sorts of stuff via CursorManager but nothing seems to do the trick. I've tried dispatching events ROLL_OUT or MOUSE_OUT events to the textInput but that doesn't do the trick either.
I have migrated my app from Flex 4.5.1 to Flex 4.6 and the TextInput click event was broken so I do this « skinClass="spark.skins.mobile.TextInputSkin" » (like was suggest here [URL]..and all seems work (tested in my Android and seems ok) but one user with iOS 5.1 complained that now the keyboard dont popup ?
Also complained for the TextArea that I dont have code in my extended component but also use the skin spark.skins.mobile.TextAreaSkin so the layout became similiar in my textinputs.
I have an as3 class, and a flash movie with various things on it. I'm trying access a TextInput called poem_line. This is laid out on a frame (named 'gameroom') inside my scene.It accessible from certain functions inside the class. Working function:
Code: public function onPublicMessageEvent( e:PublicMessageEvent ):void {
When a person writes his/hers name in a textinput, I want to have a script in the "on (focusOut)" that selects the initials of the person and puts them in the variable "initials".Is it do-able? Let's say the person is called "John Doe". Then the value of "initials" would be "JD".It must also work on names like "John von Doe" (the initials would still be JD and not JvD).
I use TextInput component to capture user's info for my contact form and invoke an asp file to send out the mail. But value entered in the TextInput somehow is not passed to ASP. The following is my code:
on(click){ var LastName = this._parent.txtLastName.text; trace(LastName); this._parent.loadVariables("email.asp", "POST"); }
I'm trying to get the height of a TextInput box (or any component for that matter) that is nested with in MC.When trace the height of the TextInput directly, it comes out at 22, great! But when I trace the height of the MC it's 100pixels
I have a movie that has been working fine until FP10 (3 years plus ). The issue is that a textinput field only gets focus on the first load of the movie. Subsequent loads none of the text input fields get focus, even when stepping through the movie focus is not automatically set. Unless the cache is cleared and the movie reloaded from our website.
I can reproduce it over and over, by clearing the cache movie works, all loads afterwards textinput boxes do not get focus.
Same results in IE 8, FF3 and Chrome. All using the latest flash player 10,1,53,64
It suggests a timingcode loadexecute issue ... introduced in FP10, but how to get around it ?
I am just embarking on a rewrite in Flex but that is some way off yet and something as simple as setting focus to the next field to be filled in affects the user experience.
When a person writes his/hers name in a textinput, I want to have a script in the "on (focusOut)" that selects the initials of the person and puts them in the variable "initials".
Is it do-able? Let's say the person is called "John Doe". Then the value of "initials" would be "JD". It must also work on names like "John von Doe" (the initials would still be JD and not JvD).
I've already tried a lot, but there was no way I could change the color of my textInput. Adobe Livedocs couldn't help me and there was no working piece of code I could find in other messageboards.
I have a TextInput component on my stage with instance name 'enteredNumber. And button with instance name 'guessBtn'. After enter some number to my TextInput i want get this number, but can not cause its a text maybe? How i can do it?
var numberToGuess:int=5; guessBtn.addEventListener(MouseEvent.CLICK, checkAnswer); function checkAnswer(event:MouseEvent):void {
I am using Adobe Flash CS5 and Action Script 3, but I am struggling to do something really simple (which means I am looking in the wrong place probably), I have 5 TextInput fields, I have added to the stage via the 'Components' option, but after discovering how to change the colour of the fields, I now want to change the font which appears when you type directly into the fields when the Flash movie is playing, however I can't seems to find this function. I found a tutorial which mentioned going to the properties panel and then clicking 'Character, then 'Embed Font', but this maybe in CS4?
I am writing a application who runs in a browser and want it to run in fullscreen, i have read that Textinput do not work in fullscreen, so my application decrease in quality
AS3: I created a form, which works fine in Firefox. However, when I want to enter text in a textfield or textinput in Safari (Mac), I cannot enter any text. I never experienced that so far.