Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Restricted Numbers


Hello,
I need to create an input text field that allowes numbers to be only between letters.
for example: LLNNNL or LLNNLLNNLLL - is allowed, but NLLL or LLLN or NNLLLN isn't.
any ideas?




Ultrashock Forums > Flash > ActionScript
Posted on: 2008-08-30


View Complete Forum Thread with Replies

Sponsored Links:

Restricted Numbers
Hello,
I need to create an input text field that allowes numbers to be only between letters.
for example: LLNNNL or LLNNLLNNLLL - is allowed, but NLLL or LLLN or NNLLLN isn't.
any ideas?

View Replies !    View Related
Capturing User Input Restricted To Just Numbers?
I’ve written a function that restricts user input to just numbers (0-9,.) and stores the input in the associative array, userInput[]. It works but seems inefficient looping through the entire input text string to scrub out invalid characters. Anyone have suggestions for a more efficient approach? Note that a working solution must correctly process mouse or cursor key movements/edits within the input box.

Also, you can see I’m using the KeyboardEvent.KEY_UP event to trigger the processing. The docs seem to indicate TextEvent.TEXT_INPUT is really the proper event for this purpose. I started with TextEvent.TEXT_INPUT but found the event is triggered before the last key pressed is actually added to the instance. The result is that the function was always one character behind. Is there an easy way to get the current text in the input box, including the last key pressed, when processing TextEvent.TEXT_INPUT?







Attach Code

someTextInputInstance.addEventListener(KeyboardEvent.KEY_UP,numInputCapture);
//--------------------------------------------------
function numInputCapture(e:KeyboardEvent):void {
var myTargetName:String = e.target.name;
var myTargetText:String = e.target.text;
var numChars:Array = ["0","1","2","3","4","5","6","7","8","9"];
userInput[myTargetName] = "";
for(var i:uint = 0; i < myTargetText.length; i++){
var testChar:String = myTargetText.charAt(i)
if (numChars.indexOf(testChar)>-1) {userInput[myTargetName]=userInput[myTargetName]+testChar};
if ((testChar==".")&&(userInput[myTargetName].indexOf(".")<0)) {userInput[myTargetName]=userInput[myTargetName]+"."};
};
e.target.text = userInput[myTargetName];
};

View Replies !    View Related
Restricted Area
Hi!

I am doing a new web site with flash and I want to put one option with restricted acces, only for user identified.
How can I do it?
Anybody can help me, please?

View Replies !    View Related
Restricted Area
Hi guys!

I am on Flash MX 2004 Pro and I need to add an option at my web site where only some people could access entering a password, do you know?
Must I use php or asp, mySQL or anything like these?
Which is a good and simple method?

TIA

View Replies !    View Related
Movement Of MC _y Is Restricted?
lo guys and dolls,

I wonder if you might be able to shed some light on my problem, I am using two bits of code to move an arrow down a list of text items, when the text items are clicked the code is updated with the new value and the arrow moves down to that.

However it is hitting a point where it cannot go any further, even though I click a lower text item, I have traced the value substatusarrowMove1 which gives me the new value each time the timeline is returned to frame one for it, and in turn travels onto frame two and then frame three and in turn is looped back to frame 2 to continually adjust the movement.

substatusarrowMove1 return figure such as the original value+ the 33.3 for example, and then arrow moves there, but this value gets to something like 477 and will not go any higher.

I'm not sure why, any help or solution would be much appreciated.

Cheerz peeps


//The first piece of code is on the first of three frames:

substatusArrow = _root.submenuFurthest;
// then use this to put the arrow in the right place x33.3
substatusarrowMove1 = +24+(33.3*substatusArrow);

//the code in the second frame:

substatusarrowMove2 = getProperty("substatusArrow", _y);
substatusarrowMoveDif = (substatusarrowMove1-substatusarrowMove2)/10;
setProperty("substatusArrow", _y, substatusarrowMove2+substatusarrowMoveDif);

//and on the third frame is a gotoAndPlay frame 2 to loop back to the above.

View Replies !    View Related
Restricted Swf Re-sizing Possible?
I have a swf embeded in an a table with-in my html index. I want to enable the automatic shrinking of the entire swf when browser resizing (to allow entire swf viewing on smaller screens) but want to restrict any enlargement past the swf's true (actual stage pixel dimension) size when browser resizing (on larger screens) as to avoid pixelation of non vector artwork within the swf.

Is this possible and how do I do it? I know how the theory should work but I do not know if what i need is action script, js, html even? And what the specifics of the code would be?

View Replies !    View Related
How To Use Restricted Keyword?
Hi all,

I'm trying to do something like this:


Code:
var this_variable:XML = <stuff>get</stuff>;
But I get an error because "get" is a restricted keyword. I tried wrapping it in quotes but that doesn't work -- how would one get around this? I just want the string "get" inside of <stuff> tags. Thanks!

View Replies !    View Related
Restricted Mouse Following
i want to make one of the menu bars were an object follwos the mouse along the horizontal axis but still stays inside the menu


but i have no idea how to restrict the object to inside the menu area, when ever i try it simply goes over the edge,

any ideas on code or how get about doing it will be grealty appriciated

View Replies !    View Related
Restricted To Buttons
Okey Dokey,

On (release) is restricted to buttons right? Well, how can I classify a layer as a button

View Replies !    View Related
Restricted Drag Function
hiya,

anyone know how i can restrict a drag?

i have a picture of a hand which i want the user to be able to drag, but i want the user to only be able to drag it sideways, either left or right, about 2-3cm's in either dirrection...

someone suggested a bounding box but i have no knowledge about this...

View Replies !    View Related
Restricted Menu Curser
i am building a site and i have a menu with 5 different buttens to navigate from page to page, i want to designate an area over the menu as an active area and when the curser is in that area i want a tabe that i have created to slit along its Y axis to float over the curser and then when the curser is not in the area i want it to slide back to the page that the site is curently on. How would i do that??? its going to be in a movie clip, and i would like to only have to do it in 1 layer.

View Replies !    View Related
Restricted MC Rollover Area
I'm trying to make a MC follow the mouse arrow, but only in a small area...i can make the MC move all over the screen using,

Code:
onClipEvent (enterFrame) {
_x += (root._xmouse - _x)/10;
_y += (root._ymouse - _y)/10;
}
then i found a code in these forums that seemed to work for person who needed it, but not for me...it goes

Code:
onClipEvent (enterFrame) {
var dx = root._xmouse - _x;
dx /= 10;
if (_x+dx >= 50 && _x+dx < 150)
_x += dx;
var dy = root._ymouse - _y;
dy /= 10;
if (_y+dy >= 50 && _y+dy < 150)
_y += dy;
}
the MC doesn't move around at all...i'm using MX2004 pro (even tho i can't figure out this code)..basically i'm trying to get an effect simlilar to the star at fc ukstar.com <---had to put the space between fc and uk otherwise it automatically turns to 4 asterisks, funny...
thanks in advance

View Replies !    View Related
Restricted Sized Window
How do u create a window with only flash in it, so u dont have to put it in a html window.. ,so that it is always the same size and it doenst matter wat size ur browser window is

View Replies !    View Related
NonRectangular Restricted Area
Hi
I drag and move an object (like a candle or a ball) with mouse in my movie.
How can i restrict this object to be moveable just in a nonrectangular area (suppose a circlre or a triangle )

View Replies !    View Related
Flash In PDF - Restricted Networking
The Flex 3 documents state:

"You can control a SWF file's access to network functionality by setting the allowNetworking parameter in the <object> and <embed> tags in the HTML page that contains the SWF content."

However, there is no information about the networking mode when Flash is run from within a PDF. There is no such thing as an object or embed tag in this case, so how do you control this setting? Or if you cannot, what setting is used in this context?

Terry. (terryc@vitrium.com)

View Replies !    View Related
Triangle Restricted Drag
whats the best way to restrict a draggable object to a non-rectangular shape (like triangle)
I did it with hittest but i cant get it to go to the nearest point when the cursor is outside the shape...
Thanks

View Replies !    View Related
Is A AS 2.0 Swf Restricted When Loaded Inside A AS 3.0 Swf
Please Help!!!!
If an AS 2.0 swf is loaded into a AS 3.0 swf, does it, the AS 2.0 swf, lose the capability of loading in other AS 2.0 swfs? I am trying this right now, and none of the movie loading functions are working (e.g. loadMovie,loadMovieNum,MovieClipLoader.loadClip). I am however, able to load XML files into the AS 2.0 swf.

Any Ideas on why this isn't working? I'm trying to display a prexisting AS 2.0 application inside of a Flex Application.

View Replies !    View Related
Setting Up Restricted Area's In Games
Im creating a game, and ive created a layer below everything esle, and draw a restricted area on that layer, then alpha'ed it into the background. im trying to stop the character from walking on past the restricted area, i know this is possible, ive seen it done, can u help me?

View Replies !    View Related
Send To Mysql Restricted Data
How to resolve this?

I have a php with a user logged in (with a session), where lots of mysql data is load into a flash.

Now my problem is backwards, from that flash I need to save the data modified on mysql.

That could be easily done just by sending all information that I want to modify on mysql on the address with ?do=....&f=..., but since part of this information is the userid I really did not want this procedure or someone could try to modify what is not from them. In order to identify I could also add the password on the variables sent but that would become easy to try to hack each other passwords.

Is there anyway to send this modifyed data to mysql and also username and password to authenticate the user and to preven to just have access to modify the user data?

Thanks in advance
Zeb

View Replies !    View Related
Object Following Mouse In Restricted Area
Ok… yesterday in the night I start doing some code and one of the functions that is the last one and I thought the easier is driving me crazy.
I want to make the buttons keep flying on the stage following the mouse but in a restricted area. I have tested 2 ways to do that but without luck… I’ve searched over the forums, tutorials and now I don’t know what else I can do!

ActionScript Code:
for (i=1; i<4; i++) {
    this_one = this["sqr"+i];
    this_one.centerX = this_one._x;
    this_one.centerY = this_one._y;
    this_one.onMouseMove = function() {
        xdis = (_xmouse-this._x)/100;
        ydis = (_ymouse-this._y)/100;
        if (xdis>0 && ydis<0) {
            //trace("quadrant1");
            if (this._x-this.centerX<5 || this.y-this.centerY<5) {
                this._x += xdis/10;
                this._y += ydis/100;
            }
        } else if (xdis<0 && ydis<0) {
            //trace("quadrant2");
            if (this._x-this.centerX>-5 || this.y-this.centerY<5) {
                this._x += xdis/10;
                this._y += ydis/100;
            }
        } else if (xdis<0 && ydis>0) {
            //trace("quadrant3");
            if (this._x-this.centerX>-5 || this.y-this.centerY>-5) {
                this._x += xdis/10;
                this._y += ydis/100;
            }
        } else if (xdis>0 && ydis>0) {
            //trace("quadrant4");
            if (this._x-this.centerX<5//|| this.y-this.centerY>-5) {
                this._x += xdis/10;
                this._y += ydis/100;
            }
        }
    };
}
and the second one with hit test

ActionScript Code:
for (i=1; i<4; i++) {
    this_one = this["sqr"+i];
    this_one.centerX = this_one._x;
    this_one.centerY = this_one._y;
    this_one.onMouseMove = function() {
        xdis = (_xmouse-this._x)/100;
        ydis = (_ymouse-this._y)/100;
        if (this.hitTest(res1) || this.hitTest(res2) || this.hitTest(res3)) {
            this._x += xdis/2;
            this._y += ydis/2;
            trace("hit");
            oldhitx = this._x;
            oldhity = this._y;
        } else {
            if (this._x-this.centerX>0 && this._y-this.centerY<0) {
                trace("111positivo "+this._name);
                this._x -= xdis/2;
                this._y -= ydis/2;
            }
            if (this._x-this.centerX<0 && this._y-this.centerY<0) {
                trace("222negativo "+this._name);
                this._x += xdis/2;
                this._y -= ydis/2;
            }
            if (this._x-this.centerX<0 && this._y-this.centerY>0) {
                trace("333negativo "+this._name);
                this._x += xdis/2;
                this._y += ydis/2;
            }
            if (this._x-this.centerX>0 && this._y-this.centerY>0) {
                trace("444positivo "+this._name);
                this._x -= xdis/2;
                this._y -= ydis/2;
            }
        }
    };
}
any idea?!?!
as u can see now all my code is a mess
I’m very tired
thanks

View Replies !    View Related
Random() Rotation Restricted Values?
Hey guys/gals. My question is, can you restrict values to a "random()". For example, I want to rotate a bunch of MCs randomly so they all looked a little different, but obviously if something is rotated upsidedown, that would look kinda dumb, so I want to restrict the degrees that my MCs rotate. Can I set parameters so that my MC won't rotate more than 75 degrees one way (counter clockwise) and 75 degrees the other way (clockwise), but for each MC, do it randomly?

Thanks in advance,

J

View Replies !    View Related
Help With Fullscreen Flash W/ Restricted Text
I'm trying to build a site that uses fullscreen imagery which is scalable, but i want to load an external .swf on top that is restricted and cannot scale. see URL for example.

i've tried using all combinations of fscommand allowscale, and Stage.scaleMode but it applies it to the whole movie, is there a way you can target individual levels?

any help appreciated.

Rossco

View Replies !    View Related
Backlash Can't Be Restricted In Input Field
Does anybody know how to restrict the backslash in the input field?

I tried this code for my input text field named “myInputField” but you can still type the backslash:

// create input text field
_root.createTextField("myInputField", 1, 20, 20, 300, 20);
myInputField.type = "input";
myInputField.border = true;
// restrict backslash character
myInputField.restrict = "^\";

Can someone tell me what I'm doing wrong here? Thanks.

View Replies !    View Related
Restricted Html Page Size And Control
I want to display my swf on an html page which is fixed at the size of that swf i.e. without all the excess space surrounding it or the normal browser controls. Kind of like a pop up. I suspect this may be a dreamweaver/html thing but can any one help
Thanks
Mark Waterfield

View Replies !    View Related
How To Prevent Restricted Active Content Warning
Recent browsers have an annoying "feature" that pops up a warning before allowing the user to run any scripts present on a web page. Is there something developers can do or code we can include to prevent this warning message (below) so that users do not have to click through several alert boxes to get to the content?

"To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options..."

View Replies !    View Related
Password Restricted Photo Gallery Idea...?
Hi I have idea to restrict login into my flash based photogallery, I would like to:

1) not to run *.swf without PASSWORD
2) to PASSWORD let expire after defined time
3) have ability to change (define new PASSWORD) without running Flash application (e.g. through editing XML file or whatever)

Is it possible ? Does anybody have any experinces and could give my advice (code)....unfortunately I have basic knowladge of programming (actionscript) only...

Thanks
Peter

View Replies !    View Related
Is 0.48 Restricted In Flash, When We Trace It From Input Text Box?
Hi...
I have a query....

I used a input text box with instance name "a". And i have to compare the value given by the user and proceed to next step.

But when i give "0.48" and compare it, i'm not able to proceed. my answer should be "0.48" only.
but when i declare a variable called "b" and give it the value "0.48" and comparing it, I get positive result.

I want to know why is it not taking from the input text box?

It would be great if any one could help me in this.

Thank you,
Sri...

View Replies !    View Related
Is 0.48 Restricted In Flash Action Scripting When Tracing?
Hi...
I have a query....

I used a input text box with instance name "a". And i have to compare the value given by the user and proceed to next step.

But when i give "0.48" and compare it, i'm not able to proceed. my answer should be "0.48" only.
but when i declare a variable called "b" and give it the value "0.48" and comparing it, I get positive result.

I want to know why is it not taking from the input text box?

It would be great if any one could help me in this.

Thank you,
Sri...

View Replies !    View Related
Content Not Appearing On Restricted Windows Account
Hi all,

I have a flash file in which certain items are set to Export for AS.
"Export in first frame" is unchecked and those items are placed on the
stage some frames after frame 1 to allow for a small loader bar.

All's fine on a whole lot of machines (Mac, PC and all sorts of
browsers) except for a group of PC's which run on a restricted
useraccount and run only Internet Explorer. On those machines the items
set to "Export for ActionScript" but not in frame one are not shown.

Does anyone have any ideas?

QAD workaround I suppose could be to have it all load in frame 1 and if
needed built a separate preloader but I would prefer to keep it all in
one file...

thanks in advance,
Manno

--
----------
Manno Bult
http://www.aloft.nl

View Replies !    View Related
Having A Movie Clip Restricted To A Linear X-scale Movement That Follows Cursor
I am creating a menu where I want an arrow movie clip to follow the cursor above the menu but I want the movie clip restricted to a linear x-scale movement

<-----v------------------>

| button 1 | button 2 |

the only thing i can't quite figure out how to do is restrict the "arrow" movieclip to that certain x-y coordinate


any help would be great, and if you need clarification--just ask

Thanks,

Thayn

View Replies !    View Related
Test Equality Of Ip Numbers/ Non Existing Numbers
I'm building a site that recognizes the computer that enters. I've set a variable containing the ip adres, and i wanna ad a name to this.
So... when i say

if ip = 120.155.654.321-->flash tells me this is not a number.
if ip eq 120.155.654.321-->flash tells me this is not a word.

know any solutions???

thanx
sven

View Replies !    View Related
Converting Numbers To Numbers With Numerical Separators
So if I return 10000 as a number in flash, how can I convert it to 10,000?

or, 1000 - 1,000

or 1000000 - 1,000,000

These numbers are generated by a complicated math formula, so they can be ANY number...

Is there no way of doing this in Flash???

View Replies !    View Related
Actions For Numbers Between Two Numbers
I am trying to make a movie duplicate, and I got it all, EXCEPT, I want it to move over and line up in colums when the screen gets full going down. I started out with _y position = i*25, and that worked, but when it gets to the end of the screen I want it to do this y position= (i-15)*25 and x position = 250; could get that far... the problem is when it gets to the bottom the second time i need to do y position= (i-15)*25 and x position = 250 between 16 and 30, and the next "column" to be between 31 and 45 etc.

on (release) {
setProperty (_root.myMc, _visible, 0);
do {
duplicateMovieClip (MyMc, "MyMc"+i, i);
set (_root.myMc.i, _root.i);
_root["myMC"+i].minus = String(i);
i = i+1;
} while (i<=num);
}

View Replies !    View Related
Single Digit Numbers To Double Digit Numbers
How do you turn 1 into 01 using actionscript?

View Replies !    View Related
Even And Odd Numbers
does anyone have any ideas about writing a function that identifies whether a number is even or odd? i guess this may be a simple thing to do, but i can't quite figure it out. thanks.

View Replies !    View Related
Numbers
I need some help creating an effect where a set of numbers seem to count up a bit like a stop watch only its much quicker... anyone know how to create this effect or give me some guidance

View Replies !    View Related
Help Numbers
i have an array full of numbers between 0 and 100. there are about one hundred total numbers, several of which are the number "100" itself. when i try to sort the array using the script

sorted = array.sort()

the sort does not come out correct. all numbers are in ascending order except for the number "100", which i'm assuming it reads in as "10" because it groups the "100's" with the "10's" in ascending order. does anyone know how to make Flash put them at the end behind "99"? thanks!

View Replies !    View Related
Numbers
hello

i have a this problem

i have a text file on my hdd with 20 numbers
i need a flash file who must read the numbers and display a graphic for each number





10x10x10x10x

View Replies !    View Related
How Big Can Numbers Be?
Hi,
Perhaps strange question, but currently I am trying to create a secure login script.

I am trying to convert a password into ascii signs, giving it 3 numbers for each letter of the password, so e.g. a password like 'hi'(two characters) would become something like '145178'(6 characters), or 'hello' something like '165134565656934'

Since I want to do some calculations with it, for encryption purposes, I must know how big a number can be in flash?

Is someone has a password like "thisismypassword", that would create 16x3=48 numbers.

anyone an idea?

help appraciated
Patrick

View Replies !    View Related
Odd Or Even Numbers?
this post has no content...

but if you want to know wether a number is odd or even:
code:
if(x % 2 == 0){
//the number x is even
}else{
//it's odd
}

View Replies !    View Related
Add Numbers Together?
Hello,

Is there any way to add two numbers together without doing it this way :

code:
value = number(30)+number(40);


?

Thank you.

View Replies !    View Related
Even & Odd Numbers
Hey there,

I am wondering if it is possible to detect whether a number is even or odd in actionscript.

I am looking for something like this:
If (variableX is odd) { do this }
} else {
{do that}

Is this possible??

View Replies !    View Related
Numbers In Between
Hi!

Here's what happens:
i have a variable (x) that is getting a lot of numbers along time. Since 0.0 till 10.0 (for instance) and i need that between numbers 0.0 till 1.0 something happens; between 1.1 till 2.0 something else happens and so on...
How can i do that?

Hope you understand me
Thank you

HUGO ANDRÉ RIBEIRO

View Replies !    View Related
Key Numbers
What are all the key numbers, I number someone had a flash that if you click on any key on your keyboard, the number of the key would come up. Anyone know of the address?

View Replies !    View Related
Key Numbers
is there a list anywhere for the numbers assigned to keys? for example

Code:
key.isdown (key.60)

View Replies !    View Related
If Var = Between 2 Numbers
ok so i have a variable called 'speed' and i want it so that if speed is between 1 and -1 it will goto frame 2.

this is what i have now

if (_root.speed < 1) {gotoAndStop(2);}

but as you can see its just less than one but i want it so that it has to be between 1 and -1.
Thanks for any help

View Replies !    View Related
Whole Numbers
How do i make the output of a calculation which is a decimal into a whole number:

eg:

34.646 to 35
87.342 to 87

View Replies !    View Related
If Between Numbers?
Can I use a statment with an If command to use a set of numbers between each other?
So I don't have to do "} else if {" for every diffrent number.

If so, how can I go about doing this?

View Replies !    View Related
Only Two Numbers
hi, how can i make this number (value) 2.3487534 be like this 2.34?
thanks

View Replies !    View Related
5 Different Numbers From 22 Numbers
How to pick out 5 different numbers from 22 numbers?
thank you.

View Replies !    View Related
Between 2 Numbers
Hi all

I have a really simple question that I couldn’t find answers to on Google. I need to know how to write the script that checks whether the value of a variable is between two numbers. Below is what I need to do.

If (thisVariable = between 1 and 100) {
thisFunction1();
}
If (thisVariable = between 101 and 200) {
thisFunction2();
}
etc. etc.

Please help me. I’m sure this one shouldn’t test you guys too much. I know it involves parentheses. Thanks in advance for the help.

Jim

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved