ActionScript 3.0 :: RegExp (quantifier) Curly Brackets To Calculate Grouped Values?
Aug 5, 2011
It was hard to sum the issue so here's what I mean in the title is something like the following:
ActionScript Code:
var rX:RegExp = /^([0-9]+-[a-z]+){3,5}$/i;
trace(rX.test("1-a")); // false
[code]........
View 5 Replies
Similar Posts:
Nov 20, 2010
I have a form created using Flash CS3 and I want to pass the following hidden value name:
optionprod[ ]
The only problem is when I publish the file I get and unexpected "]" error. How can I pass the value with the brackets?
View 1 Replies
Nov 19, 2011
I have a CSV file that's being imported by users. I'm casting it to a string and splitting it up into an array using the line ending. The issue is, inside the quotes may be a line ending that I need to ignore. The RegExp I'm using to split the string is..
private var _newLine:RegExp = /[
]|[
]/;
how to ignore line breaks inside of quotes? or.. Find the line breaks inside quotes to use a replace method
String(myCSV).replace( _yourForumRegExp, "");
View 4 Replies
May 7, 2006
As per title said how to calculate the hours and minutes for 2 diferent values eg;
value 1 = 9.15 AM
value2 = 2.45 PM
So I want calculate how many hours and minutes between this 2 values..
9.15 AM -----> 2.45 PM
View 4 Replies
Sep 17, 2008
I have an equation that needs to calculate variables as it receives them and output the value to a dynamic text field. I have successfully created a function passed values to it but after the first calculation it wont do anything else. [code]...
View 3 Replies
Mar 9, 2007
i got this perlinnoise called function and movieclip.filter = [displacementMapFilter] inside a onEnterFrame and it's eating me at 100 percent. are there any substitutions for making it much less processor intensive? I'd like to show a picture rippling and i'd like to use perlinNoise. Is there a way i can pre-calculate the perlin noise values and then loop through it in an OnEnterFrame
View 7 Replies
Feb 13, 2006
and why would you have to use an extra curly brace on the second statement to be exeucuted?
wouldn.t one do the job followed by a semicolon???
dash.onEnterFrame = function() {
this._x += ((Stage.width / 2) - this._x) / 5;
this._y += ((Stage.height / 2) - this._y) / 5;
[code]....
View 1 Replies
Jul 1, 2011
I as this working in AS2 and need to update to AS3...shows that AS3 doesn't like sloppy coding. Here's what I need: I pull data from an XML and that works when I put the data into a dynamic text box. However, I can't seem to get the date of birth into a variable. I have some code that calcs age in years but uses a string literal that I thought I could just replace with a variable from my XML...ain't a workin'. Here's the code I have:
ActionScript Code:
import flash.display.*;
import flash.text.*;
import flash.events.*;
[Code]......
View 0 Replies
Jun 20, 2011
I am trying to create a XML variable but I need to include a { and } in it.
[Code].....
Flex is trying to find a variable named PROTOCOL, SERVER and FOLDER. I need to prevent this by escaping the curly brackets. Question: How can I escape curly braces?
View 3 Replies
Jul 30, 2008
I have a dynamic text field with htmlText that renders quotes as the straight double quotes as opposed to curl quotes ("smart quotes" if you're M$). Does anyone know how to get Flash to display curly quotes in dynamic text boxes?
View 2 Replies
Jun 19, 2010
This is my problem:1. I group a drawing or I create an object (movie clip, graphic,button...)2. I double click the object/group on scene to edit.3. I go in to the group.4. I go back to the scene by double clicking somewhere empty.5. And object is gone. It's invisible. I can only bring it back by clicking on something NOT GROUPED on scene, or by clicking the red line on the timeline.Note: This problem seems to be not occuring when I go back to the scene via the blue arrow icon pointing left at the top or by clicking the scene name.
View 1 Replies
Apr 29, 2011
I am in the very beginning stages of creating my own online multiplayer trivia game and I was doing this tutorial when I ran into a compile error (in title) in the actionscript associated with the 1st frame and the dynamic text field:[code]Using Flash CS5...is this code not compatible for CS3 or something?
View 4 Replies
Aug 30, 2010
I am embedding a font using the following class:
Code:
package {
import flash.display.MovieClip;
import flash.text.Font;
[code]....
So far, everything works well, but I am having problems getting curly apostrophes to display (�) instead I get a blank where the apostrophe is in my XML file. If I use a straight apostrophe (') it works but I can't get the curly apostrophe to work.What am I doing wrong? I looked up the unicode range for apostrophe and it's U-0027 which I appear to have in the ranges specified above...
View 1 Replies
Aug 3, 2009
How can I force flex to cuddle my curly-braces instead of putting them on a new line?
View 2 Replies
Dec 12, 2011
i am not sure on what key i press, but suddenly when i create object (box,line or circle) it become grouped and when i want to edit it, i need to double click. but previously it wasnt like that.
View 6 Replies
Sep 16, 2010
I'm trying to export an AdvancedDataGrid to CSV. This is easy enough for non-hierarchical data, but when using a HierarchicalCollectionView to show treed data it gets trickier.
how to access each of the cells just as they appear on screen when all of the nodes are expanded?
View 2 Replies
Feb 1, 2011
I#m looking for a solution to sort all grouped colums in advancedDatagrid. It should be the same behavior like clicking in a columns head. i'm not looking for a solution to sort the fields IN a the grouping. There is working solution named compareFunction. But I'm not able to sort the two rows in my picture by column "Einnahmen". Sorry for the german word.
View 4 Replies
Sep 23, 2011
I have flat data in my app which I will need to group, summarize, and count as I normally would with a sql query. For this project though, it must be done in the flex app. I need to figure out how to group my data by day or month using a datatime field in my Arraycollection, then appropriately count or summarize data in other fields. I've used Groupingcollections before, but only when binding to hierarchical controls (like AdvancedDataGrid and Tree), but I need a resulting ArrayCollection with the grouped and summarized data. Basically, I'm trying to access my AC like a sql table (GROUP BY MONTH(datetime), COUNT, COUNT(DISTINCT(), etc.) and I'm unsure how to do it.
View 2 Replies
Mar 10, 2012
I am trying to display grouped data in AdvancedDatagrid but the data does not show up. When I specify the dataprovider without the grouping collection I am able to see the data. Is there something wrong with this code?
<mx:AdvancedDataGrid id="dgAssetStatus" width="100%" height="85%" initialize="gc.refresh();">
<mx:dataProvider>
[code].....
View 1 Replies
Apr 7, 2011
Is there a way to have ungrouped and grouped items mixed in the same datagrid?
For example, think of a grid that lists the root items on a C: drive.
Obviously, we would want the Directory Structure to be group and expandable. But the files on the root drive would also be shown on the list, however they would not be grouped.
View 2 Replies
Jun 24, 2009
This Script:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var cities:Array = ["muscat", "sohar", "dubai","abu_dhabi"]
[Code]....
...does not work when the buttons "muscat_btn", "sohar_btn", "dubai_btn" and "abu_dhabi_btn" are grouped into a movie clip.
View 4 Replies
Jan 27, 2009
I have to send information to an external vendor using their existing parameters. However, they have included brackets [] in some of their variable names. As you might expect AS3 can't resolve the variable name. Does anyone know a way around this?
[Code]...
View 3 Replies
Jan 6, 2005
I was wondering why brackets are still given in actions that dont have parameters?
[code]...
They work without brackets too, dont they?Not that it makes a lot of difference, but I was just wondering
View 5 Replies
Jun 20, 2011
I'm trying to do that trick where you make a variable name with square brackets. I think I don't fully understand what I'm doing though...
Code:
var cursorDirection1:Point = pt.subtract(rootpos1);
var cursorDirection2:Point = pt.subtract(rootpos2);
var farShoulder:int = 1;//1 = left 2 = right
[Code]....
I'm trying to avoid having to do a conditional to choose between cursorDirection1 or cursorDirection2. My last line there isn't working, I'm not entirely sure why. Assuming farShoulder is 1, the code should be interpreted as
Code:
cursorDirection1.normalize(findNormVar(cursorDirection1));
but I'm getting errors about the input being undefined.
View 9 Replies
Jun 20, 2006
I'm stuck with trying to target a movieclip dynamically from a loop. I'm using the square brackket syntax but I can't figure out why it's not working. Here's what I'm trying to do:
Code:
this.t1.t1._alpha=20;
And here's how I'm trying to do it:
Code:
this["t"+1+".t"+1]._alpha= 20;
View 3 Replies
Aug 10, 2007
I'm reading a book on ActionScript and I'm in the section on controlling movie clips. I'm reading about the basic methods, and I'm starting to realize I still don't fully understand the significance of square brackets.[code]Obviously, this is the prototype form of the lineStyle() method. What I don't get is why "thickness" is the only parameter without square brackets. I know that square brackets are used for retrieving data from an array or object, but either my book doesn't cover why they're used like this in a method, or I just completely blanked it out.
View 2 Replies
Feb 13, 2009
Let's say I have a function in a class with two required parameters and two optional:
Code:
public class Person extends Sprite {
private var haveToWork:Boolean;
private var hoursOfSleep:Number;
private var gotANewVideoGame:Boolean;
private var gotAHotDate:Boolean;
[Code] .....
All of that setup for this question: on the second call of the areYouHappy function, how do I keep the gotANewVideoGame variable from having a false value assigned to it?
View 2 Replies
May 31, 2009
I have an SWF that has a var that is a string called fullpath. Now, if fullpath was "game.item1", How would I evaluate it as _level0.game.item1 in brackets [] rather than _level0.game.item1.Basically, how would I evaluate an item path from a string with brackets []? This is AS 2
View 5 Replies
Feb 22, 2010
I'm working on a flash chat and I'm having problems with Regular Expression.
In Javascript this runs ok:
[code]...
My regex pattern works for but it ignores any letters in brackets.
View 4 Replies
Feb 4, 2011
I have a text file that needs to be parsed correctly. The text file looks like this:
[header]
[header 2]
[ header3 ]
I can grab these headers by doing so
var expression:RegExp = /[ [a-z0-9 ]+ ]/igxm;
var items:Array = text.match(expression);
But I would also like to remove the white space from before and after the brackets, so the headers can align against the left edge. Also, for [ header3 ], I would like to remove the white space inside the brackets, before "h" and after "3". What would be the correct regex for something this?
View 2 Replies