ActionScript 3.0 :: Using AIR Regex With Matching Dot Characters?

Mar 22, 2009

I'm having a problem with using regexp to validate form fields, everything is working fine as long as I don't explicitly try to match a dot(.) character. This fails on both email and the voorletters regex. I've tested both these regexes in RegExr and they are doing what they're supposed to there.

Code:
var regex_voorletters:RegExp = /^([A-Z.])+$/i;
var regex_email:RegExp= /^([w-.]+)@((?:[w]+.)+)([a-zA-Z]{2,4})$/i

[code]....

View 11 Replies


Similar Posts:


Regex :: Flex - Matching Strings That Begin And End With The Same Character

Oct 28, 2009

I need to match a string that begins and ends with the same character in flex...I know the long hand way (RE being - "a[^(a")]a" | "b[^(b")b" | etc...), but I'm positive this isn't what I'm required to do (midterm tomorrow!);

I need to do this in flex, but if you can think of a short regex for it, I may be able to convert it to flex notation.

What I was thinking of was something along the lines of -

%%
int firstChar;
%x string;
%%

[Code].....

But this bugs me in a few ways, first, having that variable makes this not a regular language; second, I don't know if you can even use a variable to in a pattern match; and third, I don't know how NOT to match it, if it's just a normal string. And third, I don't know how to return everything that's been matched while in 'string'

View 2 Replies

Regex :: Matching Parentheses In Flex To Save Life

Sep 3, 2010

For some reason I can't seem to match a parentheses in Flex using Regex to save my life. What's wrong with this?

var commandTxt:String = "switchview(adf)";
var switchViewArray:Array = commandTxt.match(new RegExp("switchview(", "i"));

I've tried dozens of things, but I can't seem to get a match the parentheses. What's the catch here?

View 1 Replies

Actionscript 3 :: RegEx - Get All Characters Before?

Jul 15, 2010

I have this regular expression to get urls:

(((ht|f)tp(s?))://)?(www.|[a-zA-Z].)[a-zA-Z0-9-.]+.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(:[0-9]+)*(/($|[a-zA-Z0-9.,;?'+&%$#=~_-]+))*

And I want to modify it so that when I call to make an array of the matched strings it will get everything before it as well.

View 1 Replies

Regex :: Check If First 2 Characters In A String Are Alphabets

Jun 10, 2011

I'm new to actionscript and i cant seem to get the regex syntax right in actionscript3. The task is straight forward, i want to make sure that the first two characters in a given string are alphabets and nothing else.[code]

View 2 Replies

Regex - Add Some Characters Near Number Contained Into A String?

Jan 14, 2012

I want to know if is possibile through regularexpression, count the numbers contained into a string and add a specified character near it.

For exemple, this is a string: Hello2all821abc13 This string contain 3 numbers: 2, 821 and 13 (note that the numbers contained into 821 and 13 are considered like an unique entity, not signle). I want to add near each of it the "-" symbol. Is it possible?

View 1 Replies

Regex :: Unicode Ranges For Hindi Accented Characters?

Mar 1, 2012

I'm trying to gather a Unicode list of all the 'o' like shapes in the Hindi character-set. In fact, a list of any characters (in any language) that makes uses of separate characters to indicate an accent would be better.I intend to use this unicode-list in a RegExp.I been trying to edit a list of character-ranges by outputting them in an Input TextField, but editing this text causes weird issues (the keyboard-cursor isn't place on the correct character, selections suddenly dissappear / incorrectly warps... in other words... HINDI HELL!)

I've tried this with Notepad++ too, but although it was more responsive, it eventually crapped out on me like it did in the Flash Player textfield. This seems to occur especially while removing the [] block (nulls?) characters. Some of them trigger odd behaviors.

View 3 Replies

Regex :: Replace Contiguous Line Feeds Or New Line Characters With A Single Newline In Flex

Dec 26, 2011

I need to replace multiple contiguous new line/line feed characters in flex with a single new line character.

Example:

The string

"My name is blah blah

My name is blah
"

Should be converted to

"My name is blah blah
My name is blah
"

Hope the example makes it easier to understand.

I am using a component to render it.

I guess using regex would be the easiest way to do this, but still it would be great if people can point me out to references/examples to get this done with ease.

I am using flex 4.5.

View 2 Replies

ActionScript 1/2 :: Handle Special Characters/han Or Chinese Characters?

Aug 17, 2009

I am having issue with my created flash, it can't handle chinese characters? is there some way i can handle this thru code? or should there be any font or language pack installed

View 3 Replies

ActionScript 3.0 :: Each Field In The Form Only Allows 3 Characters And No Special Characters

Aug 23, 2010

1) Each field in the form only allows 3 characters and no special characters such as @ _ ! . , etc... 2) When the user goes to the next field in the form, the previous field appears blank but the when clicking on that again, the original text appears. 3) When submitting the form, it just keeps saying "in progress" and never shows the confirmation text nor does the email get sent. There is an HTML file included with this form but I am not sure if I need to put that in as I have embedded this form into an SWF file so I don't think I need that code but let me know if I am wrong about this. I am posting both the AS code and PHP code below..

[Code]...

View 2 Replies

As3 :: PHP URLEncoding - All Accentuated Characters Are Displayed As Weird Iso Characters

May 30, 2010

My problem is that all my accentuated characters are displayed as weird iso characters. Example :© is displayed %E9 I send a string to my php file :

[Code]...

View 4 Replies

ActionScript 3.0 :: Matching GPS Points To Map?

Mar 24, 2009

I have a list of GPS points I would like to plot onto a map. But how should I go about matching the points to the map?

I could imagine that I would need some control points so I can calculate the scale and rotation of the map, but I'm really not sure.

View 4 Replies

ActionScript 3.0 :: E4X - Get Matching Nodes From A Given XML?

Nov 2, 2009

I am using e4x to get matching nodes from a given XML, It seems to work fine except one case.

[Code]...

View 2 Replies

ActionScript 3.0 :: Matching An Array To XML

Nov 30, 2009

I'm developing a flash application, and one of the things it has to do is take some user input, compare it to a number of possible matches in an XML file, and return the closest match. At the moment, I'm putting the user input into an array, looping through it, then looping through the XML and keeping track of how many nodes match in a separate array.That all sounds very confusing so here's an example:

The XML is structured like this:

[code]...

View 2 Replies

Flex :: Highlight Matching Text?

Aug 14, 2010

I have flex 4 and writing my own autocomplete component (based on the popupanchor) to search for different books. In the dropdown box, how can I highlight the text that matches? For instance, a user types in "ema" and the search returns "Pet Sematary"....I want to highlight the letters "ema" within "Pet Sematary"

View 1 Replies

Flash :: Logic For A Matching Game?

Feb 5, 2011

I was given a task to make a match making game in actionscript 2, problem is, i have very little knowledge about the language (well, and how matching works in as2, what are the important codes, code emplacements, and all I am new in AS2, and i really need a lot of help with our project. :)

I plan to match images. But.. I was planning to have a sort of "Compatibility" match-up game, like,..let's say we have two batteries, one has a 50v capacity(how do u measure batteries?) then the other has a 100v capacity, then there's this battery slot that only accepts a 50v battery, then you will have to match this 50v battery to that battery slot, that's my concept for the game, sir. I hope you got what i said, sir. :D

View 1 Replies

Actionscript :: Matching Traces Don't Actually Match

Sep 28, 2011

i'm itterating thru an array of text field objects and tracing the selected focus field when pressing tab, as well as each object.i'm trying to equate these object, but while they trace the exact same they are not.

m_InputFieldsArray = new Array(m_TitleTextInput, m_CommentsTextArea, m_EmailTextInput);
for (var i:Number = 0; i < m_InputFieldsArray.length; i++)
{
trace("Get Focus: " + Selection.getFocus());

[code]....

the first group traces the same, but apparently they do not match. Selection.getFocus() returns a string, while the array index is tracing the text field object. if i add toString() to the text field object it will trace as [Object object] how can i accomplish a match?

View 2 Replies

ActionScript 3.0 :: Matching TextInput Using Arrays

Jun 20, 2011

I'm trying to create a simulator for the HyperTerminal console. On my swf file, the user is supposed to start by typing in "configure terminal" into TextInput. So far I'm able to do so using this code:

HTML Code:
this.stop();
stage.focus = input_4;
import flash.ui.Keyboard;

[Code]....

View 6 Replies

ActionScript 2.0 :: Matching A Figure And Remove?

Feb 7, 2006

I am trying to create a game where random figures are revealed. These random figures relate to a list of monetary amounts on the same page. As a number is revealed the corrisponding amount on the page is then deleted, hopefully with a bit of fade, movement, jazzed up a little.I cannot work out a code in order to do it. The code below is how I randomise the hidden amounts via a button.

on (release) {
deck0 = "1p";
deck1 = "10p";
deck2 = "50p";

[code]....

The random amounts are hidden behind a button, when clicked reveals that amout.

View 1 Replies

IDE :: Matching Width To Screen Size?

Jun 2, 2009

I'm sure there are a million posts on this, but I cannot for the life of me figure out the wording under which they are classified.I am trying to get my site to scale so that the width is 100% the width of the screen, and the height, if there's more than can be viewed, is cut off. No scrolling. If I simply use the 100% width property, it seems to also give height at 100% value, so this way the whole site fits on the screen, but there is empty space on the right and left which is not what I want. Does this make sense how I've worded it?

View 5 Replies

ActionScript 3.0 :: Matching Items In Array

Apr 6, 2012

i don't understand arrays in functions, but how do you find the matching items given in an array? for example: var fruit:Array = ["apples", "oranges", "grapes", "oranges", "apples", "grapes"]; how can i get it to show only the number of apples in the array?

View 3 Replies

ActionScript 2.0 :: Matching CSS Background Image With Swf?

Oct 22, 2004

1) on this dude's site, Beyond the Pixel , he/she's got the style sheet repeating a trend gif. I created one myself and have got it working on my htm file. Problem is, I want to be able to get the htm repeated image to seamlessly blend into my swf file. How did BTP do it?

I assume I need to estimate the pixel distance (the repeated gif I'm using is 5x5 pixels) then absolute place the swf file using proper css placement code. Then I'd just start that same gif in flash on the movie's edge and repeat it across the movie (x and y). I think I'm right on the former, but feel that I'm being to simplistic in the latter. Ayuda, �gracias!

2) I followed this tutorial on preloaders. Got it to work, even managed to get it to load vertically and change the size of the loadBar. Problem, and it may not be on true publishing, but when I test the movie, the preloader does its deal but right before it goes to frame 3 to display a ND picture, a little green box pops up in the upper left of the frame. It does this every time. I'm using Flash MX '04 on a G5.

View 3 Replies

ActionScript 2.0 :: Creating A Word Matching Game

Jun 3, 2010

source or tutorial for creating a word matching game similar to the one found on this site? [URL]

View 1 Replies

ActionScript 3.0 :: Preloader Matching Stage.stageWidth ?

Oct 8, 2010

Experimenting with Flash as usual.Preloader's are always something that have caused me trouble.Here's what I typically use for a timeline based preloader in AS3:
 
 this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void {
var total:Number = this.stage.loaderInfo.bytesTotal;[code].......
 
I'm really interested in a preloader that loads right across the stage however - regardless of if the stage is resized.I should imagine it'll involve implementing = Math.round(stage.stageWidth); at some point?

View 9 Replies

Actionscript 3 :: Find The Matching Items Given In An Array?

Apr 7, 2012

i don't understand arrays in functions, but how do you find the matching items given in an array? for example:

var fruit:Array = ["apples", "oranges", "grapes", "oranges", "apples", "grapes"];

how can i get it to show only the number of apples in the array?

View 5 Replies

Actionscript 3 :: Overriding Method Without Matching Signature?

Oct 8, 2010

when extending a class, is it impossible to override a method without also matching the parameters?for example, i'd like to use the method's name, in this case it's a socket extension and the method i want to override is connect. however, i want to request additional parameters that the stock connect function does not request.

is the only alternative to create my own connect-like method with my own parameters, call super.connect from this function and override the stock connect function to throw an error if it's called?

View 2 Replies

ActionScript 2.0 :: Getting The Closest Matching Color In Bitmap?

Aug 18, 2009

I want to find a script that compares colors in a given region and gets the closest websafe color.I found the color sampler class that returns the average color. So now I just need to learn how to get the closest websafe color to the average color. how to compare color values and get the difference?

View 0 Replies

ActionScript 3.0 :: Compare Two Arrays For Matching Numbers?

Nov 16, 2009

how to compare two arrays for matching numbers? One array is called randomNumberArray and hold 7 numbers in it, and the other myArray_array which hold 6 numbers in it.

Once they have compared how do I then display messages depending on how many numbers have matched. so lets say less then 3 numbers are matches I'd want it to display on the interface 'Sorry you have not matched at least 3 numbers'.

View 1 Replies

ActionScript 3.0 :: Compare The Two Arrays For Matching Numbers?

Nov 29, 2009

my code.

ActionScript Code:
var _num:Number = 0;   
function chek_Arrays()
{

[code]....

Its intention is to compare the two arrays for matching numbers and depending on how many matches there are display a message.

But even though no error messages come up in the compiler error section, no messages displays on the stage where it should be.

In case it helps array 'numersChosen' is from another piece of script in this application, would I need to reference it?

Ok can anyone give me a hand ?

View 6 Replies

ActionScript 3.0 :: Comparing Two Arrays For Matching Numbers

Nov 30, 2009

I have this code that's meant to compare two arrays for matching numbers. Depending on how many matches there are, a certain message will be displayed in a dynamic text field. But for some reason it's not working, can anyone figure out why?

ActionScript Code:
var _num:Number = 0;
function compare_Arrays() {
for(var i = 0; i < numbersChosen.length; i++) {
for (var k = 0; k < randomArray.length; k++) {
if (numbersChosen[i] == randomArray[k]) {
[Code] .....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved