Flex :: Last Occurrence Of String Pattern
Aug 9, 2010Is there any inbuild function to find out the last occurrence of a string pattern in a string in actionscript.
View 1 RepliesIs there any inbuild function to find out the last occurrence of a string pattern in a string in actionscript.
View 1 RepliesI have a pipe delimited string "Y|Y|Y|N|N". How can I find the position of first occurrence of N using code after processing the string.
View 4 Repliesi'm trying to search a string for a particular pattern, and replace it with elements from within the pattern... for example..here's the given string...if you want to learn how to use regexp, {url===http://somesite.com, text===click here}.
the pattern...
{url===http://somesite.com, text===replacement text}
and the intended result...
if you want to learn how to use regexp, click here.
of course, i'll extract the url and do something else with it... i'm just wondering what the regexp is for that pattern, and how i can extract things from the results returned.
Is there some way in flex to parse strings to date. I want it to support custom formats similar to 'dateformatter'. Using 'dateformatter' class we can parse date object in various string formats as specified by 'formatString property'. I want it other way round, from string to date. The parse method 'Date.parse(my_string)' does string parsing but for a very limited set of formats. Can't we have something similar to following, where user can specify his/her own formats.
someformatter.formatString = 'HH::MM::SS' ;
mydate = someformatter.formatTodate('23::56:34');
Will 'parseDateString' method of dateformatter be useul here?
In my attempt to learn flex remoting I came across thisflexService.getRules.addEventListener(ResultEvent.RESULT, loadRules);here flexService is a remote java object . me that when esultEvent.RESULT will occur. On studying about ResultEvent in AS document it states as The event that indicates an RPC operation has successfully returned a resultSo keeping that in mind my guess is ResultEvent will be fired when flexService.getRules method will successfully return a list of object,where flexService is object of remote class FlexService having getRules function which returns list of object, Can any one please tell how exactly it works
View 2 RepliesIs there a way to extract children from an XMLList where the node name of a child contains a string pattern?For example :
<record>
<XblahX/>
<cow/>
[code]......
I've read some documentation about regular expressions in AS3. I was wondering if it is possible to check every word of a string for a pattern. If all the words satisfy the pattern, the test is passed, otherwise is failed. [code]
View 1 RepliesI need to write a regex which will match URLs that do not have a specific query string name/value pair anywhere in its URL. All other query string names, and all other query string values with the same name should be matched. Other pages in the same directory (or sub-directories) should not be matched.URL...The query string name and value that I need to exclude from matches is:[code]How can I prevent matches when the string exists anywhere in the pattern?
View 3 RepliesI've read some documentation about regular expressions in AS3. I was wondering if it is possible to check every word of a string for a pattern. If all the words satisfy the pattern, the test is passed, otherwise is failed. Here is an example of what I mean:
Code:
var reg:RegExp = /[a-z]/i;
var str1:String = "a b";
var str2:String = "a 1";
[code]....
I have to parse out color information from HTML data. The colors can either be RGB colors or file names to a swatch image. I used [URL] to develop and test the patterns. I copied the AS regular expression code verbatim from the tool into Flex Builder. But, when I exec the pattern against the string I get a null. Here are the patterns and an example of the string (I took the correct HTML tags out so the strings would show correctly):
[Code]....
I wish to do my project in mvc pattern. so I chose cairngorm framework and just read some of the document about this framework.But I cant understand deeply to do project using this framework. Have any methods or examples to study doing project in cairngorm framework??
View 1 RepliesI am using a command pattern, so any changes to object state need to happen within a command execution. A normal itemeditor in a DataGrid would just make its changes on the underlying bound object, but I need to intercept that change and make it use a command.how to implement this. A basic example is that I have an object with a "date" field. In the datagrid I am using a flex "DateField" component as the itemeditor. When I select a new date, I don't want it to update the datasource, I want it to call a different method where I can access the newly selected value and pass it to a command to execute.
View 2 RepliesI'm getting the ambiguous reference error when trying to bind properties. Here's the code:
[Code]...
Strangely enough, it doesn't even mention the binded property...
I am just looking design patterns used in Flex. Any value object design pattern and how is it implemented in Flex.
View 3 RepliesIn Cairngorm (Flex Framework), there is Model Locator Pattern, which is similar to Global variables, is it a right pattern, Adobe is saying for flex its best pattern
[Code]...
is it possible to transform regexp pattern match to lowercase?
var pattern:RegExp;
var str:String = "HI guys";
pattern = /([A-Z]+)/g;
str = str.replace(pattern, thisShouldBeLowerCase);
Output should look like this: "hi guys"
We are trying to fill our Flex 3 applications background with an image pattern by repeating the pattern throughout the background.
The pattern is a very small "bulleted"-background.
The Flex App seems to just stretch the image pattern even though we've specified in the CSS the following:
Application
{
background-gradient-colors: #ffffff, #ffffff;
color: #000000;
[Code]....
I need to write a method doing a formatting of numeric value given a pattern as one of the parameter, in actionscript.
For example:
a. 12345.00 using format pattern ###,###.## resulting 12,345.00
b. 12345.00 using format pattern ##,##,##.## resulting 1,23,45.00
Initially, I thought that NumberFormatter able to do that, but after reading documentation, it seems you are not able to accept pattern.
how to implement this ? I'm using Flex 4.1
UPDATE: I made an advanced formatter based on the sample created by Jason. You can download it here : link
I would like to implement the MVC pattern to an existing Flex project.I want to separate out the controllers and models from the views. They currently all live together in large mxml files.My question is, should httpservice requests be in the model or the controller? What sort of advantages/disadvantages would there be to either?
View 3 RepliesI am preparing a document for a project. The project's backend is developed in Java, frontend is adobe flex.
I am not sure about the correct way of describe the project in Model-View-Controller way.
For Model layer: Using Hibernate Java beans to implement all the business logic and persistence? For View Layer: Using Adobe flex send post or get request to Controller layer, and get respond in XML format. For Controller Layer: Using Java servlet to handle requests from Flex client?
I need a regular expression pattern for validating the following path directory:
[Code]...
I have a String variable in my flex (flash builder 4) application containing CSV data. I need to allow the user to download this data to a local file. For example, giving them a "csv" button to click and it might present them with a save file dialog (and I would be sending the contents of my string variable).Is this possible / how ?I am using the ResuableFX component for the datagrid to csv. This the code I ended up with that works to save the string to a text file for the user (in a web browser):
var dg2CSV:DataGrid2CSV = new DataGrid2CSV();
dg2CSV.includeHeader=true;
dg2CSV.target=adgEncounters;
[code]......
I embed a text file into my Flex project and read its contents using code like this:
[Embed(source = "../../data/abc.txt", mimeType = "application/octet-stream")]
private var r_Abc:Class;
var xx:ByteArray = new r_Abc();
[code].....
I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.
View 1 RepliesI want to know how to write "Intercepting Filter Pattern" like Java's servlet filter in Flex.
And I want to insert it into the classes which have a role of server communicating.
I have an experimental flex source file(lex.l):
%option noyywrap
%{
int chars = 0;
int words = 0;[code]....
Since there is no newline character in the input file, why the " in lex.l is pattern matched? (The "lines" is supposed to be 0, and the "chars" is supposed to be 9)(I am using OS X.)
I've been using the Regular Expression Explorer but I still can't come up with the right pattern.
[Code]...
I can't understand why should I even use the Singleton pattern in ActionScript 3. Can anyone explain me this? Maybe I just don't understand the purpose of it. I mean how it differs from other patterns? How it works? I checked the PureMVC source and it's full of Singletons. Why are they using them in the View, Module, Controller?
View 2 RepliesI'm working with some Action Script file and I found this:
var pattern:RegExp = /.*//
var results:Array = pattern.exec(cardImageService.url);
I know it's a regular expression and that exec() is looking for my pattern in my string. But how should I understand this pattern?
I am working on a Flash project that initially had a simple template for the animation, but has grown to have different "states" with multiple templates (not under my control)Because of this, my update (ENTER_FRAME) loop is now starting to look a bit like this:
private function update():void {
switch (state) {
case "intro":
switch(layoutState) {
[code]....