ActionScript 2.0 :: Constraining StartDrag() To Trapezoid Shape?

Dec 30, 2011

how can i constrain the dragging of my movieClip inside the shape of a trapezoid? here's the code..

Code:
pamato.onPress = function()
{
startDrag(this, false, 1000, 270, 130, 605);[code]....

when i test the movie.. its a rectangle..

View 9 Replies


Similar Posts:


ActionScript 2.0 :: Constraining StartDrag() To Diagonal Line?

Apr 23, 2008

I'm working on a volume slider for a type of jukebox and what I'm using is an actual drawing that is on an angle, therefore the volume slider and handle aren't in a straight horizontal line.I've done the basic code to keep the handle within the distance of my slider "line" (left to right), but what I have obviously just constrains it to a rectangle.

on(press){
this.startDrag(false,0,0,32,9);
}
on(release){
this.stopDrag();
}

The slider and handle are both at actual size, that's why it's only 32 pixels wide that I need it to go across and 9 pixels down. I do realize that for what I want, it's much more involved than this simple startDrag code with 4 sets of numbers in it.I'm including the source file in Flash 8/Actionscript 2.0.

View 3 Replies

IDE :: Constraining 'startDrag' To A Non Vert Or Horiz Line

Jun 29, 2009

I need to know if there is any way to constrain the mouse movements on a startDrag to a line that is not going vertically or horizontally. I'm sure I'll need to use some trig functions, and that's fine, I just haven't been able to find this done anywhere else.

View 4 Replies

Actionscript 3 :: Flex To Create A Trapezoid Shape With The Class Of Matrix?

Jul 18, 2011

I want to use Image Reflection in trapezoid shape. That why i ask how to create trapezoid shape with the class of matrix

View 1 Replies

ActionScript 3.0 :: StartDrag To Path - Passing Custom Drawn Shape Like Curve

Nov 19, 2009

I am currently looking to see what the bounding are for the start drag method. And by the looks of it the bounding is set by passing the rect() object to the dragUpdater/ constructor. My question then is can you pass a custom drawn shape like a curve or what ever? By the looks of it you can not as specified by the adobe reference doc.
startDrag()method
public function startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
So from this I would conclude that to have a custom drag path one would have to create a custom class.

View 2 Replies

Flash :: Canvas Moved On StartDrag() Without Calling Set X / Y Or Move() - How Does StartDrag() Exactly Work In As3 / Flex

Feb 11, 2011

i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.

i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?

View 3 Replies

Actionscript 3 :: Flash - StartDrag() Within StartDrag() On Child MovieClip

May 19, 2011

as you can see, I have a container MC which I have added to the stage. I set its drag constraints using a Rectangle(). I then add the 'cat' child movieclip to the container, and I want this to be dragable too. However, as soon as I click on my cat when testing the MC. It shoots to point x=0 y=0 on the stage and doesn't move.

The container MC can be moved without any trouble.

If I remove the rectangle bounds from the containers startdrag() function. both MC's can be dragged without any issue.

//panning ability
my_x = 800 - myImage.width;
my_y = 480 - myImage.height;

[Code]....

View 3 Replies

Map Trapezoid To Rectangle?

Jan 28, 2011

How can I map a trapezoid to a rectangle?

Do you have any AS3.0 code about mapping? Or a formula for mapping?

View 2 Replies

ActionScript 3.0 :: Scale A Square To A Trapezoid?

Feb 1, 2012

I'm just learning how to use transformation matrices and i'm wondering if its possible to apply a transformation that pinches one end of a shape. i.e. transforming a square/rectangle into a trapezoid by pinching the top.

View 1 Replies

Flex :: Distort Object Like Panel So It Looks Like Trapezoid?

Dec 29, 2009

I was wondering how to distort a Flex object like Panel so it looks like a trapezoid?

View 2 Replies

ActionScript 3.0 :: Constraining 4 .SWF's On Site

Jul 15, 2009

I've got a problem with containing properly the .swf on my (main menu) site. Because the external .SWF's got a parralax effect it overlaps the swf above also the .swf is not nicely stretched out. This is the effect on my site that I want www.seniorict.com but as you look at the zip/fla(menu test) you see the complete file and how the effects are not working well.

[code]...

View 1 Replies

ActionScript 3.0 :: Constraining 4 .SWF's On Site?

Apr 8, 2011

I've got a problem with containing properly the .swf on my (main menu) site. Because the external .SWF's got a parralax effect it overlaps the swf above also the .swf is not nicely stretched out. This is the effect on my site that I want www.seniorict.com but as you look at the zip/fla(menu test) you see the complete file and how the effects are not working well.

code is

PHP Code:

stop();
var swfs:Array = new Array("home", "kandidaten", "opdrachtgevers", "contact");
var loaders:Array = new Array();

[code]....

View 2 Replies

Constraining Custom Mouse Pointer

Aug 16, 2010

I am using the following code on the main timeline

Mouse.hide();
target.onMouseMove = function() {
this._x = _xmouse;

[Code]....

And on the movie clip (target) that i am using for the custom pointer, i've put

onClipEvent (load) {
startDrag(true);
}

How can i constrain the pointer to an area of lets say 800x600 ?

View 2 Replies

ActionScript 3.0 :: Resizing And Constraining Proportions?

Oct 12, 2011

I'm doing liquid layouts, and resizing my images while constraining proportions. Here is the code I'm using:

Code:
image.y = (stage.stageHeight/2) - (image.height/2)
resizeMe(image, stage.stageWidth, stage.stageHeight);
//The resizing function

[Code].....

I want it to resize and totally centre itself in the middle of the screen. HOWEVER. I also want to nudge it down 100px, and THEN resize it. I'm having no luck with this though I can move it down 100 px, but then it resizes and positions itself as though it was still in the centre.

View 6 Replies

ActionScript 2.0 :: Constraining A Movement To A Rotate?

May 5, 2006

I am interested in rotating an object around a central pivot point, on command from two buttons (a + button, and a - button).

This file would essencially be a clock hand, or dot representing the hand, being rotated either clockwise or counter clockwise manually by a plus and minus button.

Things I am unclear about:

1) what forms of syntax, variables, etc, would I need to accomplish this task? I am unclear about the proper protocol for setting up this movement.

2) I have a specific background graphic that all this will be happing on top of, how do I find the desired pivot point coordinates (i am assuming the pivot point is defined by an x and y) in relation to my background graphic?

View 1 Replies

ActionScript 2.0 :: Constraining Movement >function_move?

Jun 12, 2009

I have a split screen view with a large image above and a smaller image underneath.There is a zoom window over the smaller image that when dragged around shows the larger image above it being moved at the same time (just that it's bigger uptop)

anyways I can't seem to constrain the movement of the smaller movie clip ... right now you can just click and drag it all over the place ... and I'll like for it to stay dragable only over top of the smaller image...and here is the code in the root.

// The base_mag_factor is the correlation of the small picture to the big picture...
_root.base_mag_factor = 5;
// The mag_factor will change as scaling occurs
_root.mag_factor = _root.base_mag_factor;

[code].....

View 1 Replies

Flash :: Constraining/clipping Symbol Boundaries In CS5?

Sep 27, 2010

I want to create a MovieClip symbol of a certain width and height, but with content that extends outside its boundaries, with the option to have the external content be clipped/hidden or visible.

In Flex, the solution would be to create a group with .clipAndEnableScrolling = true.

Is there a way to do this in Flash CS5, or will the symbol always resolve to the size of its contents?

View 2 Replies

Actionscript 3 :: Constraining Number Of Children In A ViewStack ?

Mar 7, 2012

I have the following code to create a ViewStack which is used as a dataprovider for a TabBar:

<s:TabBar id="objectTab" dataProvider="{vs_objects}"/>
<mx:ViewStack id="vs_objects" width="100%" />

I want to constrain the number of children the ViewStack to avvoid the tabs going out of the screen when the user opens many tabs without closing any. I attempt to do this by removing the oldest element in the ViewStack when the user opens a new tab and the size of the ViewStack is above 9.

private function openTab(object:Object): void {
//Create a new NavigatorContent(form) and add it to the ViewStack[code].........

The image below illustrates my problem, where the dark grey color illustrates the selected Tab. There should only be one selected tab, which works perfectly fine with both the child selection approaches above, when i don't remove a child before selecting a new. When i remove a child and then open a new Tab, the new Tab does not get selected properly, it only gets "painted" in the selected color. In This case Tab 40 is still shown when i open Tab 41 (exceeding 9 tabs). The result of this issue is that Tab 41 is not rendered completely.

UPDATE: The problem was my AS3 code inside the childrens NavigatorContent's that caused the application to behave this way. The solution was using the callLater method:Doric's

code example:

protected function openTab():void
{
var form:Container = new Container();[code]............

View 1 Replies

ActionScript 3.0 :: Constraining Mouse Cursor When Scrubbing Video?

Jun 21, 2011

Basically, I have a custom "scrub bar" graphic in which the user can drag a slider forward or backward in time to scrub/seek to a certain point in an external F4V.I have my slider constrained by a rectangle of 1 pixel in height. But when I click with mouse to scrub, my mouse cursor tends to move off of the slider graphic, causing problems with my MOUSE_UP event. (It can't trigger when my mouse is not over the target object).Is there a way like "new Rectangle(32,713,944.1)" to keep the mouse from moving in the Y-axis as the user drags the slider left and right to scrub video?

View 3 Replies

ActionScript 3.0 :: Constraining Full Browser Flash Site?

Jan 18, 2009

I'm making a fluid full browser flash site, and things are coming together nicely, but at some point, if the stage size gets too small (such as if someone is using a 800x600 resolution), things just don't look right. Things get all smooshed together and cause for a cluttered mess. To solve this, I put constraints on my stageResize function so the stage would only shrink down to a desired size. This worked great for the flash file, but I can't get the browser to add scroll bars are this point. I figured I would need a JavaScript file that would size the browser (or the div that contains the swf) and then constrain it as needed, but after digging around a few sites that perform the way I would like mine to, I am not seeing any such JavaScript files.
Example: [URL]

View 14 Replies

ActionScript 3.0 :: New Shape - 1046: Type Was Not Found Or Was Not A Compile-time Constant: Shape

Nov 30, 2009

ActionScript Code:
package {
import flash.display.MovieClip;
public class Base extends MovieClip {
public var baseHP:int = 50;
var newRect:Shape = new Shape();

1046: Type was not found or was not a compile-time constant: Shape. 1180: Call to a possibly undefined method Shape. What does it mean by "undefined method"? I am somewhat of a newby, so sorry if there are any stupid errors

View 1 Replies

Professional :: Adding Shape Hints Makes Shape Disappear In Between Frames

Jun 22, 2010

Whenever I add shape hints to a shape tween the shape disappears in the between frames. I am using CS5 on Vista. I using files from [URL]to practice.

View 2 Replies

ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape?

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 2 Replies

ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 1 Replies

ActionScript 1/2 :: Shape Colliding Another Shape, Not The Rectangleof A Movieclip?

Jul 9, 2009

Id like to know if there is a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangleof a movieclip.It can be in a movieclip.

View 23 Replies

Professional :: Change The Shape Of A Shape?

Oct 19, 2010

using the shape tool you can draw basic shapesthen using the subselection tool you can re-shape them by relocating certain points

What i want to do is create a tween whereby one of the points is movedthe problem is you have to convert to a symbol first and after you have done that you cant change the shapes shape.so how do i go about using a motion tween to change the shape of a shape?

View 1 Replies

AS3 :: StartDrag X Y Coordinates?

Jan 11, 2008

not sure if this is possible but i'd like to get the X,Y coordinates of a button I drag. here's my problem:

PHP Code:
public function backbuttonDown(e:MouseEvent)
{

[code].....

View 10 Replies

F8 :: StartDrag() Multiple Mcs At The Same Time?

Nov 1, 2007

is there a way to drag multiple movieClips at the same time? Flash help explicitly says: Only one movie clip can be dragged at a time. After a startDrag() operation is executed, the movie clip remains draggable until it is explicitly stopped by stopDrag() or until a startDrag() action for another movie clip is called. anyone know of a way to do it anyway? maybe combining them in a dynamic mc or something?

View 3 Replies

ActionScript 3.0 :: Can't Disable StartDrag

Feb 21, 2009

I have a zoom in function and when I'm zoomed in I can drag the movie clip around with a drag function I have a zoom out function which restores the movie clip to its original size but I would like the drag function to be disabled while zoomed out.[code]...

View 4 Replies

ActionScript 3.0 :: StartDrag With MouseEvent?

Sep 24, 2009

I've created a function called dragItem() that I call with the MOUSE_DOWN event. I've got it working....kind of. I can access the function when the mouse is clicked and I can even get the name of the instance when the mouse is down. I'm trying to use the same logic to get the single object to allow a drag. see my code below...
 
function dragItem(event:MouseEvent):void {            var instName:String = event.target.name;            trace(instName);            trace(event.target.width);                        event.target.startDrag();                        event.target.removeEventListener(MouseEvent.MOUSE_DOWN,dropItem);            event.target.addEventListener(MouseEvent.MOUSE_UP,dropItem);                    }
 
I get this error when I try to drag the item...ReferenceError: Error #1069: Property startDrag not found on flash.display.Loader and there is no default value.    at Main/::dragItem()

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved