ActionScript 2.0 :: Constrain Textboxes To Take Specific Value Range?
Nov 16, 2005Can I constrain textbox to get only values between 1 and 60?
View 2 RepliesCan I constrain textbox to get only values between 1 and 60?
View 2 RepliesI have a 'plus' and 'minus' button that rotates a dial (.hand). The code below belongs to the minus button.
I trace the position and I want the dial to not go past a position of 40, how can I set this up? The dial can still move in the positive direction, however.
Also, when the dial reaches a certain positive position, I want the entire movie to jump to another frame, (to an area with a different dial), and the dial reset itself to its origianl (symbol) position.
on (press) {
_root.hand._rotation -= 5 * direction;
trace(_root.hand._rotation);
}
[Code]....
Is it possible with the Flash Media Streaming Server 3.5 to only allow a specific IP range to the archived video stored on the server. However allow the live feed full access to the server, so basically in the end have the archived video locked down to a specific allowed IP range and the live feed available to the public? What would the Interactive server have as far as advantages to the Flash Media Streaming Server in this regards?
View 1 RepliesI'm trying to make it so that and object rotates to the mouse, but only within a specific range. In the class file for Object1, I want it to be able to rotate a maximum of 45 degrees in either direction from the rotation of Object2. So far this is all I could come up with:
[Code]....
The possible rotations of Object2 are 0, 45, 90, 135, 180, -135, -90, and -45. The code seems to work fine if the rotations are between -90 and 90 (the right half), but because the left half goes from -179 to 180 to 179, it obviously fails. How would I accomplish the effect I want?
I want to restrict a text box to to use a specific range of numbers, say from 35 to 40.[code]...
How do I restrict it to only allow the 6 numbers between 35 and 40?
Is my only option to use a control like a combo box and fill it with the numbers I want to appear?
Im trying to make a cursor display when rolling over a movieclip only between a specific range of frames. with this code the cursor shows up in the range of frames but doesnt follow the mouse, and the mouse pointe ris visible
Code:
thisFrame = _root._currentframe;
if (thisFrame > 50) {
if (thisFrame < 90) {
[Code].....
I have a movie, within this movie I have a container which loads an external swf, the problem I have is that when this movie is viewed within a browser, if the browser is resized then the external swf that loads into the contanier resizes, going smaller or larger.How do I constrain a particular container to stay the same size, 100%?This is the script I have that loads the external swf, is there a way to constrain container?
View 3 RepliesI'm loading a .swf (flash game) (719 x 480) into a new .fla that is bigger (1280, 720) than the dimensions of the .swfThe game appears to load well, but when I start playing it, I realize that the game is messed up because it is actually running in the dimensions of the .flaCan somebody tell me how to constrain the loaded .swf to 719 x 480?NOTE: I can't change the .swf game file's codingAnd the .fla stage-size has to stay the same.
View 5 RepliesI load swf files continuously, but if one of the swfs has some defective code such as Mouse.hide() the mouse disappears when the swf is loaded. I want to constrain such malicious code in loaded swfs. There is also another problem related to containing loaded or loading swfs. When I load a swf which loads another swf to operate, It never completes loading (Event.Complete of contentLoaderInfo) because it needs another swf to load. However, the swf should be loaded before it runs. Since loaded swf is as-2, loader does not give any error. I am also suspicious whether or not it will give error if it is as-3.
View 1 RepliesI'm at a bit of a coders block, and I'm sure it's quite simple. I tried using the following:Code:((angle-180)%360) + 180But for angles < 180 degrees, it works just fine, but after that it get's a little funny. I know why it's doing that, I'm just looking for a way to fix it.
View 2 RepliesI am trying to created a constraint to a rectangle. I have the startDrag working and I am trying to constrain a square to the movie size of 600x400.I have been searching online help files but I can not for the life of me get it to work, would someone beable to put me out of my misery. I have attached the demo file I am working with but I will also post my script here for thoughs who prefer that...
Code:
("animation", false, 0, 0, 300, 300);
but know joy...
my code:
////Button Listeners/////////////
Code:
// BtnNav listeners
btnNav.addEventListener(MouseEvent.ROLL_OVER, btnNavOver);
btnNav.addEventListener(MouseEvent.ROLL_OUT, btnNavOut);
btnNav.addEventListener(MouseEvent.CLICK, btnNavDown);
[code]....
I have a MC called planPOPUP which is draggable and at the moment I am constraining where the MC can be dragged to by using the 4 co-ordinates method such as:
Code:
startDrag (_root.loadHERE.allImagesMC.planPOPUP, false, 116, 231, 913, 396);
Now would it be possible to, instead of using that method, place another MC around the edge of the stage, making a border, and then have some code so that whenever planPOPUP touches the border MC it cannot be dragged over it? Thus constraining it to within the borders of the stage?
[code]...Now if I load this swf into a bigger SWF the mouse is acting in the entire movie as if it were in de loaded swf. This also happens when I test it (ctrl-enter) and make the resulting box bigger... the mouse will not fade at the border of the swf any more, but at the border of the containing window....) is there a (easy) way to constrain the mouse behaviour within the box of the loaded swf (like the MOUSELEAVE event triggered when i leave the box of the loaded swf in stead of the entire stage?)
View 5 RepliesI have a MC on stage with instance name of holder.I load a swf into holder. I want the swf which is bigger than holder to have the same height and width as holder.var myLoader:MovieClipLoader = new MovieClipLoader(); myLoader.loadClip("contact.swf", holder);
View 2 RepliesI have some script that loads an external image into the UILoader that also has a mask created based on loaded image width and height, which also centers on stage. That works great. On user click somewhere within the loaded image, the image then scales from that mouse position out.
i.e.: if I click top left corner image scales from that point out, center, left, right... etc. using the tween. That works great.
On mouse move image then pans reverse to mouse position. i.e.: I move mouse left image pans right, move mouse up image pans down, top left corner image pans down bot right...etc. Also using tween. This is where it becomes tricky. The image does pan, however it does not pan completely to left, right, up, down, diagonally and so forth. once mouse reaches boarder of mask the image pan stops, unless mouse is way outside boarder.
Then that creates another problem where the image now pans so much that it goes past the boarder and almost out of sight. Ideally when mouse moves to masked boarder, panned image should be at its image boarder then stop. Constrained within the masked boarders.
Code:
var myImagePanTween;
function moveImageTween(e:TweenEvent = null):void {
var CurrentMouseX=mouseX;
var CurrentMouseY=mouseY;
[Code] .....
I think there should be away to include a constraint within the Tween, as well calculate the image size so that when mouse reaches boarder the image should be panned to its width/height, up, down, corners ect.. within the mask. Make sense?
does anyone have an equation for resizing mc and constraining the prooprtions also.. through AS
View 6 RepliesI'm doing a tutorial on using the startDrag function but have no idea how to get the coordinates for my rectangle.How do you find the 4 points? I've tried using my mouse to pinpoint the location but that doesn't work.Here is the generic code:myMovieClip.startDrag(false, left, right, top, bottom);
View 2 Repliesi have a textbox (totaltxt) within a movieclip (link_mc) which is on frame1, and i am trying to access the contents of totaltxt and put it in another textbox called totalround1 in frame2...e.g. if totaltxt = 100 then totalround1 should equal 100 aswellthis is my failed attempt:PHP Code:totalround1.text = Number(link_mc.totaltxt.text);
View 1 RepliesI am trying to use arrays with textboxes. What I initially wanted to do was have 3 textboxes ( a, b and c) and when the user inputs information into the textboxes:
Textbox A: Tea
Textbox B: Coffee
Textbox c: Softdrink
It stores the information into an array that I can later view and call upon these strings inputted into the array.
I have been designing dynamic pages with Flash and I can't seem to apply effects such as simple motion tweens and alpha effects to it
View 3 RepliesDoes anybody know any reason why I can't use variables loaded from a text file using loadVariablesNum anywhere but in the Var field of a text box? If I try this:
The loadVariablesNum ("textfile.txt",0);it loads the textvariable1=3.14159&variable2=cowfrom the text file, and if I make 2 dynamic text boxes with the Var parameter as variable1 and variable2, they'd have "3.14159" and "cow" show up in them when I run the script. So I know that the textfile is being read and the variables are being loaded.But if I try newvar1=variable1;newvar2=variable2;in my code, and then put newvar1 and newvar2 in my textbbox Var, I get nothing in them. I should be able to assign the newvar variable the same value as variable1, but I can't. trace (variable1);should output the text "3.14159" when run, but it displays "undefined" every time.Every site I have been to says I should be able to access my loaded variable values simply by using variable1, or _root.variable1, or _level0.variable1, but none of these work any differently.
I can assign an instance name to the textbox and then assign a value to that instance name, and if I do that, assuming the instance name is "box")
[Code]...
how to constrain the proportions of a flash site so that when a browser window is resized the swf resizes to fit?Is it actionscript needed in the fla or some html in my dreamweaver file? [URL]
View 1 RepliesI have a draggable slider that looks like this:
The blue bar has the instance name track and the pink dot has the instance name puck.
I need the puck to be constrained within the blue area at all times, and this is where my maths failings work against me! So far I have the puck moving along the x axis only like this:
private function init():void
{
zeroPoint = track.x + (track.width/2);
puck.x = zeroPoint-(puck.width/2);
[Code]....
I'm trying to create an interactive piece, where the veiwer can move sliders to effect to movement of other pieces. I understand how to contrain the movement of the sliders, and I've done so, but I'm having trouble figuring out how to constrain the movements of the mc's effected by the sliders. How do I do this without using the drag function?
View 3 RepliesWhat I would like to have happen, is when the user drags arrow_mc, it will only rotate between 0 and 90 degrees. If you go above 90 degrees, and continue dragging, it will stop moving. The same would happen if you went below 0 degrees.Currently, the code below works, but you can go around in circles back and forth.Iwith figuring out how to constrain the drag rotation between specifid numbers, in degrees.
ActionScript Code:
arrow_mc.onPress = function () {
arrow_mc.onMouseMove = function () {
[code].....
I have a movieclip that is locking to mouse center when dragging it. I know how to set up the boundary code, though the movieclip images are different sizes, so didn't want to have to create a custom code such as:t.startDrag(true, 290, 85, 910, 390);for each movieclip.does anyone know how to constrain the draggable item to within the left, top, right, bottom boundaries inside of a movieclip?
View 1 RepliesI have a small movieclip where an external image gets loaded into a custom shape mask. The user can then drag the image around. This is all working fine.
I am now trying to constrain the movement allowed so that the image cannot ever leave the masked area.
On my startDrag() function i have tried to include the following properties but i cannot get this to work:
(false,new Rectangle(-xpos,ypos,stage.stageWidth,0));
Code:
// Imports.
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
[Code]....
I have 9 images that are draggable on my screen - and when pressed become the top image- using the script below. I'd also like to constrain to a rectangle (or coordinates) - ideally adapting the exisiting script and movie clip set-up.
[Code]...
I am designing an interface where a person will drag a circular measurement tool (called a goniometer) over part of an image, and then rotate two different arms on the tool to measure an angle.The entire tool itself needs to be draggable by its center. So far I have the arms rotating by means of pressing the arrow keys on the keyboard, but it would be more realistic to have the user drag the arms to rotate them. I can't think of how to accomplish that, though.
View 2 RepliesI have created some input text boxes using AS3. For starters, unless I set the text in the code to = " " you can't type in them. Secondly if I click on each box individually I can type in them. However if I tab through them I can't. Here is a link to the site I'm working on. I'm referring to the calendar / bookings form on the first page. To see the form just click on a date after today. [URL].
View 3 Replies