ActionScript 2.0 :: Generalize Drag Restriction For Any Angle?
Jun 18, 2010I have done the drag restriction for 0,90,180,270. how to generalise. use setAngle function change angle of img movieclip. How to generalise for any angle?
View 0 RepliesI have done the drag restriction for 0,90,180,270. how to generalise. use setAngle function change angle of img movieclip. How to generalise for any angle?
View 0 RepliesWe all know how to drag a movie clip:
my_mc.startDrag(target,[lock, left, top, right, bottom])
But does anyone know how to drag/restrict a movie clip to a 45 degree angle?
Ive made this rotation with AS. But Id like to make the bar to move from angle A to angle B smoothly.
How can I do this?
Im doing a login and I'm using MovieclipName.TextInputName.maxChars = 10; Is there a easy way to set minimum character?
View 4 RepliesBy this question, I don't just mean add a final to your class name.I'm talking about, let's say that you have a class that only one other class uses, but should not be accessed by no other class. Is it possible to say in the extended class that only this other class can extend me?*Change* Also, can you restrict which classes are allowed to initialise it?
View 2 RepliesThe function below returns points on a sphere with a given radius. I want to add restriction such that points cannot be plotted within 30 degrees of the poles of the sphere.
public static function randomPoint(radius:Number):Number3D {
var inclination:Number = Math.random() * Math.PI*2;
var azimuth:Number = Math.random() * Math.PI*2;
var point:Number3D = new Number3D(
radius * Math.sin(inclination) * Math.cos(azimuth),
radius * Math.sin(inclination) * Math.sin(azimuth),
radius * Math.cos(inclination)
);
return point;
}
After reading James Ward's post I'm considering using a proxy rather than a crossdomain.xml file. I have a java app, which includes a flex applet, on one tomcat instance and a java web service on another tomcat instance. Does it make sense to have a single (Apache httpd) proxy handle requests for both the app and the web service, thus eliminating the cross domain restriction?how to deal with the cross domain issue are welcome.
View 2 RepliesI am making some sort of security game and i would like to have some visual line of sight. The problem is that i can't restrict my line of sight so my cops can't see through the walls. Below you find the design, in which they can look through windows, but not walls. Further below you find an illustration of what my problem is exactly.[code]...
View 3 Replieshow can i restrict max number of characters in a dynamic textfield?is it possible somehow?
View 4 RepliesI'm using a typical full size website that proportionally scales on browser resize.
I would like to set a minimum dimensions so the user cannot squeeze the website more than 600x420 for example. The page will then start to crop if you go beyond these dimensions.
We are quite familiar with action scripting but are facing an awkward situation. We need to call different instances of youTube Video into our own swf and play them. Now as youTube video is from a different domain, the Flash sandbox restrictions naturally come into play. We are loading the youTube swf into a clip using the MovieClipLoader Class.
If we remove the instance using the removeMovieClip() command the video is removed but the sound continues. We have even tried the MovieClipLoader unloadClip() method but that too did not yield results.
We wish to be able to kill the sound object or atleast mute it so that it does not play even after the movie clip containing the video is removed. As the swf belongs to a different domain we are unable to control the sound object directly through script. We have even tried loading another youTube instance into the same movie clip after first removing it using the removeMovieClip() command, then creating it again, and finally loading the youTube instance using the MovieClipLoader class, but the earlier sound still continues to play even while the second clip sound also plays.
I'm having some trouble getting around a security restriction of flex. Saving a file is apparently an action that can only be invoked upon user interaction. The problem is that after my user clicks on the save button, I need to perform a database query to get the data for the file I want to save.
Because Flex works asynchronous, I have to make the database call and then catch the ResultEvent in a different function. In that function, I no longer have the user's mouseclick event. How am I then supposed to save this file?
[Code]...
i want to make flash drag a ball onpress and if its onrelease and if its on the Suquare movieclip it should stop draggin. my code is like this
[Code]...
I want to have an image and when I click on the image ,one can hold down the mouse and drag a copy to where ever on the stage and when one lets go, one can drag another and another with each copy still being able to be dragged after released.this is what i have but its pretty simple and doesn't work....
stage.addEventListener(MouseEvent.MOUSE_DOWN,makeA Box);
var i:Number = 1; //i will be the total number of boxes
var newBox:myMC = new myMC();[code]....
Im having trouble with this and its going wrong. I need to use actionscript 2 and im on flash cs3.
View 3 RepliesI have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function.[code]
View 1 RepliesIm trying to do a drag and drop system where the user can drag a movie clip into an area. Although i would like to make it snap to a target instead of just sitting wherever it lands in the area. Problem Two:
The next thing i am trying to do is when the user has a movie clip on a target already, and trys to put another movie clip in that target area, it will replace the one thats in there and go back to its current position. Here is the script of what i have done so far:
[Code]...
I have some movie clips. i want to drag all clips when i drag single movie clip. Ex. I have movie clips "A1", "A2", "A3", "A4", "A5" . Randomly visible some of them. Suppose "A1", "A3", "A4" has visible. When i will drag "A1" movie clip all these "A3", "A4" also move with "A1".
View 6 RepliesWhat's the code to start drag and stop drag. I would also like to know what's the code to detect if the object has been dropped on something. I know the code in AS2 but i cant figure it out in AS3.
View 3 RepliesI am very new to AS3 and I am running into some issues creating a simple class that will allow you to drag and drop and object but then also scale when it is over a hit area. Here is my current code:
[Code]....
i have load in a .swf and this .swf is make up of one drag object. When i load into my _level0, i can drag it but it seem then the drag is not smooth, instead it is lagging. Thus i went back to the indiviual files and try to drag on it and it was not lagging. ...why is it like that? All the files are still on my local disk.
View 4 RepliesWen i drag mc2 i want mc1 drag in the same time.
View 1 RepliesI'm using Flash CS4 Pro.In Motion Editor, the way that the blur works, it allows you to blur an object on X and/or Y axis.That means you blur horizontaly or/and verticaly.I would like to make a blur motion at another angle, by example 30 degree.
View 1 Repliesi have a movie clip that follows my mouse to create a fading line.the thing is that i want that movie clip to change its angle according to the mouse movement.Right now the mocie clip is kind of changing its orientation but it's also gettin cray and is not fluent.heres the code of the part that draws the mouse
private function drawMouseLine(e:MouseEvent):void[code].........
I know a matrix [x scale, y skew, x skew, y scale, trans x, trans y], and would like to get the angle in degrees.
View 2 Repliessay I have two points: 0,0 & 1,-1If i were to get the angle between these, it should return 45.But the function i have created below returns -45, and If i give it the points 0,0 & 1,1 it returns 45.
ActionScript Code:
function point_direction(x1:Number, y1:Number, x2:Number, y2:Number):Number
{
[code].....
I have a carousel built and it works fine, but there is an angle on it that I want to get rid of. When the images move along the carousel, I want them to always stay the same on the X axis. Here is the code, I have tried mangling it in every possible combination, but it is outside my AS3 knowledge on how to get the angle changed.
import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 1150;
var radiusY:Number = 50;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 6;
var speed:Number = 0.002;
[Code] .....
how to get angle of mouse its very simple.use this Script (copy and past in your file). A sample file which runs only on CS4 is attached.
//Start............................................. .................................................. .................
// Make a line (o-----------------------) and take its left side as center named 'mcArrow'
mcArrow._x = mcArrow._y =200;
[code]....
I'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 creating a Flash website (AS3) which contains multiple columns of swf's. These all have individual "start drag and stop drag" vertically and works fine. My problem is when I try to create start drag stop drag on top of these swf's horizontally - I want to be able to move the whole stage horizontally containing separate columns.
I am not sure how to code it and it ends up locking the "start drag top drag" inside the columns. How can I do this so that each column is scrollable and scroll to other columns without using a scroll bar...