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'
I want to do something like this:"3*4".replace(/([0-9]+)[*]([0-9]+)/g, String(Number("$1") * Number("$2")))And no, i don't want to do that, but something more complex.
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
I am confused with how component life cycle goes when component build in MXML. and if MXML calls methods automatically then how to call any method in life cycle explicitly.
In UI component life cycle, I heard validation and invalidation events. Please explain me about these events in short. What does updateDisplayList() method do in that life cycle. Please explain me in short if possible.
Driven on by curiosity, I'm trying to understand the Life Cycle used by Flex Application. I've done a little research on this argument; the two key concepts used into the FlashPlayer are:
SWF Frame: it's the logical unit that contains graphical code and as code Flash Player Frame: it's the time interval used by Flash runtime to update the screen and defined by frameRate property
If so, could you explain me the relationship bewteen these two concepts? In particular, are they paired togheter or not? The main rule is: the Flash Player streams in a swf; until a full SWF Frame is read, the Flash Player cannot render it.
I'll try to explain what I need to understand. For the sake of simplicity, suppose you have a two frame application: SWF FR 1 and SWF FR 2.
In general (for example in CS4) a frame is considered as a logical unit (delimited by ShowFrame tag) where you can attach as3 code. This as a simplified version of a swf file, i think:
Header // frameRate is defined here Symbols, classes etc... // this is FR1 === ShowFrame === Symbols, classes etc... // this is FR2
If you have two frame, FR1 and FR2, Flash starts executing FR1 and goes to the next one (FR2). If you don't stop the excution, the Player executes and renderes code contained into FR1 and FR2 through an infinite loop. On the contrary, when you stop the execution, for example in FR2, the flash player loops executing code contained in FR2.
took me like 20 minutes to get why my code is not functionning... this line: tempRef.x=(limitL-dist-tempRef.width/2)+(tempRef.width+dist)*(i+1); after auto format becomes like this: tempRef.x=limitL-dist-tempRef.width/2+tempRef.width+dist*i+1; that's not the same thing at all...may I know why this is happening?
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"
Results into: Implicit coercion of a value of type Boolean to an unrelated type Number. Why do parentheses turn into Booleans into Numbers? Can't I use bitwise operations?
Can we Bypass the save dialog box of FileRefernce.save()? If not, then Is there any workaround to save a file from web application in Flex without asking user where to save file?
I had this same issue when I created an application using google's javascript API and the solution was to have closure on the callback function creating the multiple markers.I can not seem to find an example for making multiple custom markers, with anything other than using some random math function to create the multiple markers.
GlobalVars is a class that contains static public var types to keep up with however many addressess, lats, lngs, etc...I have tried using markermanager but it has some issues that I finally just gave up on. Starting with
This is where I begin geocoding by address, rather than using an httpservice, as I was doing before, but I ran into issues of one httpservice result would return faster than another, which would in turn place the wrong data with the wrong marker.
Obviously, I have not found a solution, because this way is doing the same thing.Question being, how can I retrieve multiple markers info and keep all the markeroptions in order with the information being returned.
Here's the code:
public function makeMultipleMarkers(destinationAllObj:Object):void { removeRouteMarkers(); myMarkers = []; GlobalVars.myIcon = [];
I've written a url validator for a project I am working on. For my requirements it works great, except when the last part for the url goes longer than 22 characters it breaks. My expression:/((https?)://)([^s.]+.)+([^s.]+)(:d+/S+)/i
It expects input that looks like "http(s)://hostname:port/location". When I give it the input: https://demo10:443/111112222233333444445
it works, but if I pass the input https://demo10:443/1111122222333334444455
it breaks. You can test it out easily at[URL].. Oddly, I can't reproduce the problem with just the relevant (I would think) part /(:d+/S+)/i. I can have as many characters after the required / and it works great. Any ideas or known bugs?
what is the use of flag variable in the flex RegExpValidator. what I am to do is to create a validator that can provide variety of error messages as in EmailValidator
i want to check in Adobe AIR if given regex is valid. I'm looking for somtehing similar like here: How to check if a given Regex is valid?
I dont want to compare regex and text-value - i jus want to check if this regex is valid. If someone type invalid regex - for example: "x{5,-3}" or "(((^^$$$)//)" or something like this i just need to communicate to him that this regular expression is not valid - its not proper regular expression.
In the below code if i replace st2 into the pattern of regexp without quotes, it works fine.Now since i get the regular expression from some other file, as it is shown in st2. I want to add that into the regexp pattern. But as in the below code it doesnt work.
<fx:Script> import mx.controls.Alert public function onClicking(){
I have a datagrid and a search field. I've set the change event of the search field to run the filterfunction of the datagrid. I'm able to match the entire term, but I'd like to be able to use a regular expression to do a progressive search (e.g., "Pe" matches "Peter"). I tried to create a regular expression to compare the fields, but I can't seem to get it to work. How do I return the results of the RegExp? Here's the function as it currently stands
I need to extract in actionscript the variables from a string like /var1/var2/var3/...Each variables can be characters or/and number and variable size.My current regex /(w+)/g work for the first variable but not for the others.
var matchExpression:RegExp = /(w+)/g; var match:Array = matchExpression.exec(browserManager.fragment);
find the suitable regular expression to validate a string that has comma separated numbers, for e.g. '1,2,3' or '111,234234,-09', etc. Anything else should be considered invalid. for e.g. '121as23' or '123-123' is invalid. I suppose this must be possible in Flex using regular expression but I can not find the correct regular expression.
I get Strings from a server that look something like this: This is normal text followed by a link: [URL] Links might also look like this: [URL]
This Strings are set as the text value in a spark TextArea. What I'd like to achieve is that A. the text gets highlighted and B. the user can click it and it opens in the systems browser.
Using the StyleableTextField throws a typerror on Flex 4.6. I tried the simplest HTML text like this: StyleableTextField(newsStoryArea.textDisplay).htmlText = "TextArea <b>bold</b><i>italic</i>." Which throws; TypeError: Error #1034: Type Coercion failed: cannot convert spark.components.supportClasses::StyleableStageText@fc3d0a1 to spark.components.supportClasses.StyleableTextField.
I have a little math problem with a game I'm making, and I can't for the life of me figure out the formula needed to accomplish something..Say, there's a sniping game, and a BIG image that must scroll from left to right according to the mouse movement.
Something like this:[URL]... In that example, the scene is 550 pixels wide, and the image is 1100, exactly two times the scene, so the formula is kinda easy..
[Code]...
the center of the image would be at x 1500, way over to the right of the scene, outside it, but it would fit inside the screen, like this (the blue square represents the real size of the scene):[URL]..Then when the mouse is at the far right side, that is 550 x, the image center should be at -950 x, like this:[URL]...