ActionScript 3.0 :: RegExp To Evaluate Correct MM/DD/YYYY
May 20, 2009does someone have a RegExp to evalute whether an input string is a valid MM/DD/YYYY format. The input field is restricted to "0-9 MDY /".
View 1 Repliesdoes someone have a RegExp to evalute whether an input string is a valid MM/DD/YYYY format. The input field is restricted to "0-9 MDY /".
View 1 RepliesI have a requirement. I have a date format as yyyy/mm/dd and I want to convert this format to mm/dd/yyyy in action script.
I had tried to parse to this format, it is not working.
I have dates formatted yyyy/mm/dd. i would like to find out what day of the week they areThere is a lot of info on the date object but it is all for getting today's date and time, or day. i need to get day of the week from a date. so for example:
View 3 RepliesI have an ArrayCollection of Objects. Each Object has the following keys/values:
{date: 2009-12-01, visits=13555, bouceRate=45}
{date: 2009-12-05, visits=46955, bouceRate=45}
{date: 2009-12-06, visits=13685, bouceRate=45}
[code].......
While I was playing with Air Sqlite, I got some trouble in saving Date in the Database
INSERT INTO tblUserComments (comment_text, comment_cat,comment_date,parent_id) VALUES('"+bubbleText.text+"','"+chosenCat+"',DATETIME('now', 'localtime'),'"+_parentId+"')
store the comment_date in the following format
2455783.2596296296 instead of 2011/08/09 18:13.
How can I save the Date Data as YYYY/MM/DD HH:MM?
I got a date field that i wish user to key in in a certain format likedd/mm/yyyyBut after my user key in, how can i validate and check that they key in in the correct format?
View 6 RepliesI'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?
View 4 RepliesCode:// This example is set to evaluate half a second pause (500)
if (Number(getTimer()-lastClick)<500) {
// Add your doubleclick actions here
if (Reaction._visible eq false) {
setProperty ("Reaction", _visible, True);
} else {
[Code]...
This is a double-click detector.. I was just wondering, since I've never seen lastClick, is there such a thing as lastMove? I'm thinking of using onClipEvent (MouseMove) with a x and y detection timer, or could the one above have some hope?
So why can I evaluate an expression in a switch like so:
[Code]...
If I trace vidList[currentIndex].video before the switch I get "city" but tracing vid after the switch I get null Quickly solved by just assigning to a variable and then using that in the switch... but it still seems odd I can't just do it directly.
[Code]...
I need to evaluate an expression in a string at run time . Not sure how to achieve this in Flex. My requirement is as follows
var test:String = "myparams.id=10" ;
//test will be a string populated at runtime.
// I need to treat it as an expression and evaluate it at runtime
[Code]....
is it possible to do something like this action script 3?
I believe the eval function earlier allowed this, but now it has been depreciated?
I have 25 textboxes on stage. I am using a for loop to point to each textbox and evaluate the contents. When I come across a textbox that has the letter "Y" in it I want to place a object called colorbox at a certain location. To do this I have created a variable called tf. When I trace this variable outside of my if statement it correctly shows the contents of the current box, however within my if statement it doesn't. Also the colorbox doesn't get placed at the designated coordinates and I get the following error message:
1176: Comparison between a value with static type flash.text:TextField and a possibly unrelated type String.
for(var i:uint = 1; i < 2; ++i)
{
var tf:TextField = TextField(getChildByName("sw" + i));
trace (tf.text)
[Code].....
I have three array holders that hold different text and numbers. First I need if(_root.achievements[0][i] (Needs to be evaluated as a string variable name for example _root.pKills because before I set _root.pKills to 10) == _root.achievements[1][i] (Need to be evaluated as a number so I can compare it to the string variable name))
[Code]....
Code:
var Happy:Array
Happy[Happy.length] = "_root.Train1_mc"
[code].....
I have 31 squares on stage named square1-31. Each square is defined as a movieclip. . Each square has a textbox within it named txtbox1-31. I also have an object in my library called marker.I am using a for loop to cycle through the squares. I need to evaluate the contents of each textbox in each movieclip and if it is not empty, addChild an object to the current square location. So far my cod is not working as AS3 doesn't recognize the name of my textboxes or their locations.
fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
[code].....
I am getting these errors when I try to run this program:
1120: Access of undefined property whiteRoll.1120: Access of undefined property blackRoll.
They are being thrown by the bold line in the code. I can trace the ionName property I have created, but I can't compare it to input text. How can I get this to work?[code]...
I have 25 textboxes on stage named sw1 through to sw25. I want to evaluate the contents of each box using a for loop.
for(var i = 1; i<26;i++)
{
var t = "sw"+i
trace (t.text)
}
I get this error message when I run my program:
Property text not found on Number and there is no default value.at Mastercalendar_fla::MainTimeline/frame1()
I need to evaluate the decimal point of an interger (bet u wouldn't of guessed that from the title eh?!)
So, im reading in XML for a thumbnail viewer, the viewer displays 5 thumbs per "page" so, i divide the total number of thumbs by 5.
Then i need to evaluate the number if it dosn't have a decimal point (ie, the total divides by 5 exactly) then that is the number of pages i need.
Then if the number does have a decimal 12.2, for instance i need to strip the 2. leaving 12, and then add one so the 2 images left go onto a new page.
I've created a dropdown menu which drops down onClick. gotoAndPlay("2")
I have been trying to create some AS 3 code that, evaluates the number of clicks and therefore, if the menu button is clicked for a second time it goes to it's original state. ("1") and creates the illusion of closing. Rather than as it does at the moment and repeats the the process of opening.
Code:
var menuclicks:Number = 1;
function onMenuClick(evt:MouseEvent):void {
gotoAndPlay ("2");
[Code]....
[Code]...
"newbie" is the name of the var ( a URL )and the trace function works ... so that being said i know the function has access to the variable the problem is w the
Code:
URLRequest( MovieClip(root).newbie )how can i get this to evaluate as a URL ...
heres the error i get:
TypeError: Error #1034: Type Coercion failed: cannot convert "http://www.yourfacesucks.com/newbishness" to flash.net.URLRequest.
at ShattrF3_Alpha_fla::squareExpand_WEB01_53/openPage()
Ive racked my brain on this one and I just cant seem to see what im doing wrong. I have 2 text boxes that need to be evaluated against each other. Both are input boxes that capture and store data into variables. I just want to compare those values and run the proper code. t works fine for the first round. If I enter new values, the variables are updated as well. But the new values are not applied to the condition the second time around.
var requested: Number = input_txt1.text;
var total: Number = input_txt2.text;
btn_mc.onMouseUp = doPress;
[code].....
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 RepliesI want to check the contents of 25 textboxes on stage. Each textbox is embedded inside of a movie clip. Using the counter on a for loop I want to cycle through all 25 textboxes and if they have text in them, i want to place an object overtop of that movie clip . For this example I will only use 3 movieclips, each containing a textbox. The movieclips are named mov1, mov2 and mov3 and the textboxes within them are named text1,text2 and text3
for(var i:uint = 1; i < 4; ++i)
{
var xloc="mov"+i.x
var yloc="mov"+i.y
[code]....
This should be fairly simple but I understand why it doesn't work. I am hoping there is a clever way to do the following: I have a string 'movieclip1.movieclip2' I have a container movieclip - Container. Now to evaluate the string normally I would look something like: this.container['movieclip']['movieclip2']
Because clip2 is a child of movieclip. But I would like to parse or evaluate the string with the dot syntax to read the string as a internal path. this.container[evaluatedpath]; // which is - this.container.movieclip.movieclip2 Is there a function or technique to be able to evaluate that string into an internal path?
In the attached CS4 file I have attempted to have a button evaluate whether a variable (textbox) is equal to a number. If so, I want another textbox to say "correct" or trace "correct" either way. However, it doesnt appear to be evaluating the variable. I receive the "correct" trace everytime the button is released.
I tried to upload the file but it is too large. The code in the button is as follows:
on (release){
if (phoneNumber == "911");
trace ("correct");
}
I have a textbox entitled numbers, in which the user presses buttons and the number is added to the textbox. The same textbox has a variable assigned to it entitled phonenumber. When the talk button is pressed the code above should check the variable to see if it == 911. However no matter what I enter into the textbox, the trace always pops up and says correct.
I have piece of ActionScript code which is supposed to evaluate a string of HTML and break it up into individual pieces. So a string like <p>Hi</p><span>Hi</span><a href="index.php">Hi</a> would be translated into:
1. <p>Hi</p>
2. <span>Hi</span>
3. <a href="index.php">Hi</a>
...
However, when I run a test version of this code, I get a value of null in return. I'm pretty sure my regexp string is good, but I'm doing something wrong in ActionScript. My code is below:
var evaluatedInput:RegExp = new RegExp('/<([A-Z][A-Z0-9]*)[^>]*>(.*?)</1>/');
var output:Object = evaluatedInput.exec("<p>Hi</p><span>Hi</span><a href="index.php">Hi</a>");
trace(output);
Regexp for AS3 to get the domain name from URL?[URL]
View 2 RepliesI'm using Flex 4. I'm driving myself crazy. Why won't the following work?
// in my Application tag:
creationComplete="replaceMe(event)"
// in my script block:
[code]....
my text area (id="test") says "She sells seashells by the seashore."...it should say "sche sells seaschells by the seaschore."
I'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?
Using Actionscript 3.0 (Within Flash CS5)A standard regex to match any digit is:
var myRegexPattern:Regex = /d/g;
What would the regex look like to incorporate a string variable to match?(this example is an 'IDEAL' not a 'WORKING' snippet) ie:
var myString:String = "MatchThisText"
var myRegexPatter_WithString:Regex = /d[myString]/g;
I've seen some workarounds which involve creating multiple regex instances, then combine them by source, with the variable in question, which seems wrong. OR using the flash string to regex creator, but it's just plain sloppy with all the double and triple escape sequences required.There must be some pain free way that I can't find in the live docs or on google.
I am using URL Loader to hit the server (e.g. Yahoo server) and then listing to HTTPStatusEvent.HTTP_STATUS" listener for Status code 200. If the response code is 200 then form submits to database else I am giving the error "URL is not valid".I am running my application from Tomcat server using address Issue: On submiting the form Flash returns "SecurityError stating "form.swf" cannot access data on "Yahoo server".I have also placed a crossdomain.xml file on the server with allowDomain set to wildcard "*";
View 3 Replies