ActionScript 2.0 :: Resize An Item (a Vector Square Or Such) On Drag?

Oct 24, 2006

how to resize an item (a vector square or such) on drag? In other words, I want to click a side and drag that side having it resize. Sort of like WACK [URL]

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Placing Bitmap Image Instead Of Vector Square?

Oct 15, 2010

I am attempting to adapt a face detection application for a project I am working on. It works great, and displays a sprite of a vector square where it detects a face. The problem I am having is that I would like to place a bitmap image (from a source file) instead of a vector square. Here is the snippet containing the drawing of the vector:

Actionscript Code:
/*** Creates a rectangle*/
private function _createRect() : Sprite {
var rectContainer : Sprite = new Sprite();
rectContainer.graphics.lineStyle( 20 , __rectColor , 1 );
rectContainer.graphics.beginFill(0x000000,0);
rectContainer.graphics.drawRect(0, 0, 100, 100);
return rectContainer;
}
I'm pretty sure that this is the only part that needs altering in order to swap the square with a bitmap though.

View 3 Replies

ActionScript 2.0 :: Square Movieclip Resize Itself

Dec 3, 2003

I am messing around to learn more about actionscript and I am trying to have a square movieclip resize itself so both sides are equal to 50 here is my code on the movieclip it does the resize and all but it keeps on going. I am not sure how to stop it.

[Code]....

View 6 Replies

ActionScript 2.0 :: Resize A Square So That A Thumbnail Size Image Comes Through?

Jun 29, 2006

just wondering how to resize a square so that a thumbnail size image comes through

heres the link peeps: its awesome [URL]

View 1 Replies

ActionScript 3.0 :: Resize Object To Hexagon Form (Not Square)

Feb 3, 2009

I developed so far, a function to resize objects (images, shapes) and center them inside a hexagone clip (similar to the bees hexgagon cells).

function imageResizer (b, maxW:Number, maxH:Number) {
var r:Number;
r = b.height / b.width;
if (b.width > maxW) {
b.width = maxW;
b.height = Math.round(b.width * r);
} if (b.height > maxH) {
b.height = maxH;
b.width = Math.round(b.height / r);
}}

Symptoms: The function resizes the object being passed to it, but, there's still some room to fill inside the square, but now it's empty! is there any solution to resize the objects with max width/height and still be able to fill the whole area of the hexagone resizes.

View 4 Replies

ActionScript 2.0 :: Use StartDrag To Drag Square Movie Clip?

Nov 23, 2008

I am trying to use startDrag to drag my square movie clip and while i drag it up the square should rototate right and when I drag down it should rotate left, everything works except of the rotation part

View 1 Replies

ActionScript 2.0 :: When I Hit The Square After The First Time I Drag A Ball To The Trashcan?

Nov 10, 2004

1 : click on the square to make duplicate movies of the ball. 2) which can be dragged to the trash can, to be discarded, but the problem I�m having is that I when I hit the square after the first time I drag a ball to the trashcan, it appears on top of the trashcan, and not where I want it to, yet the next time I hit the button it�s fine.

View 2 Replies

ActionScript 2.0 :: Make Photo Gallery And Drag Several Square Images?

Nov 4, 2007

I'm trying to get some general info and be pointed in the right direction to make kinda like a photo gallery where they can be dragged, and moved around like several squire images that can overlap one another, and if you click an image that is under another image, it will come upfront..

View 1 Replies

ActionScript 2.0 :: When Creating A Dynamic Square With The Api - Won't Drawing Api Square Object

Dec 2, 2010

when creating a dynamic square with the api. 400 by 400. I am not sure why it wont draw the object

[Code]...

View 2 Replies

ActionScript 2.0 :: Resize Item As It Goes Backward In Carouse?

Mar 18, 2010

So my issue is that I want my images to get smaller as they go to the back, and unlike the carousel in the tutorial, I don't want them to go up on the Y axis I'd like them to stay level horizontally but get smaller as they recede. The code in the tutorial I'm using only goes over how to do this by adjusting radiusY.

var numOfItems:Number = 4;
var radiusX:Number = 250;
var radiusY:Number = 5;

[code]....

View 4 Replies

ActionScript 2.0 :: Have An Enemy Square That Chases The Player Square?

Jan 15, 2010

I have this game, and some levels have a moving square as the player, you move the square with your arrow keys.... I want to have an enemy square that chases the player square.... They only chased mario when you didn't look at them? Kinda like that...... but in this regards:

I only want the enemy square to chase the player square when the player square moves.... soo say the player square moves 5 pixels per movement (know how to do all that), I want the enemy square to move when the player square moves..... towards the player square at like 7 pixels per movement..... so eventually you won't be able to avoid the enemy square....

View 4 Replies

ActionScript 3.0 :: Drag And Drop Item Sticking

Nov 3, 2008

I'm creating a drag and drop game for grades K-2 and two of my pieces stick to the mouse when clicked. I'm not sure what the problem is as I've used the same code for all of my pieces. The pants1_mc and the glasses_mc are the problems.

View 3 Replies

Flex :: Drag-and-drop Onto List Item?

Oct 21, 2010

I have a List with an item renderer and would like to enable drag-and-drop onto the items in the list, rather than adding the data to the list. Is it possible to find the item that is being hovered over when dragging?

View 1 Replies

Actionscript :: Drag More Than One Item In Adobe Flash?

Apr 25, 2011

I've been trying to program a game in my class on Digital Media, and have run up to a huge roadblock concerning draggable items. I first managed to make one item that could be dragged with the mouse using this code (the movie clip is called 'honey')[code]...

View 1 Replies

ActionScript 3.0 :: Making A Draggable Item That Can Only Drag On An Axis?

Oct 5, 2010

What I want to create is a movie clip, that I can drag, but only on axis, such as up and down, but not left to right. For example, only on an X axis, but not on a Y axis.The code i'm currently using to make the items draggable is:
 
pc.onPress=function(){
startDrag("pc",true,50,50,550,350);
removeMovieClip("cnt");

[code]....
 
"pc" is the instance name of the movie clip I want to drag. "cnt" is a line that I've got drawn between the various draggable points I've created.

View 3 Replies

Actionscript 3.0 :: Hit Test - Drag Each Item Around To Reorder The List

Aug 10, 2009

I am making a horizontal list that I want to be able to drag each item around to reorder the list. When one clip is dragged over another I want the one under it to move left or right to fill in the empty space left by the clip being dragged. I cannot seem to figure out how to tell which movieclip is touching or "under" the movieclip currently being dragged around. It seems that the hitTestObject method need explicity instance names to work. In summary, I want to know the instance name of any display object that the dragging moveclip touches.

View 1 Replies

ActionScript 2.0 :: Dynamic Column - Drag Item Out Of List?

Feb 21, 2004

I basically want to be able to drag any item out of that list, and when doing so, have it that item automatically go to the bottom, and have the remaining items scroll up. I can handle the drag and drop part of it, but I'm confused on how I could get the remaining column of items to dynamically move up depending on which item is taken out. I'm thinking maybe along the lines of an array? And I also suppose each item will have to be loaded in.

View 5 Replies

ActionScript 2.0 :: Drag+Drop Then Resize Symbol (MX)?

Feb 27, 2006

I'm dragging a symbol that has been reduced in size, I'm dropping that symbol and I then want the symbol to resize itself, basically return to it's 100% h+w.

The dragging and dropping is no probs and I'm sure the resize would be setting some sort of symbol property value or something

View 21 Replies

ActionScript 3.0 :: Drag And Resize Rectangle MovieClip

Jun 14, 2011

I would like to add the ability to resize a rectangle movieclip, plus have the ability to drag it horizontally. I have the horizontal drag code working, but I am not sure how to add the ability to grab the ends and resize it.. There are a lot of these bars on screen, so I am adding listeners in a loop:

this["box" + i].addEventListener(MouseEvent.MOUSE_UP, dropIt);

I imagine I need to add 2 movieclips to each rectangle to allow for resize handles, but I'm not sure how to refer to them or initalize them...Here is a pic of what I am looking to accomplish.

View 10 Replies

Professional :: Drag And Drop Item In Adobe Flash CS3 Quiz

Feb 10, 2010

I am trying to create a quiz in Adobe Flash CS3 using Drag and Drop Feature. I have created similar Drag items and I want to drag the item and place it into any target. For Ex. I want Drag1, Drag2, Drag3, Drag4, Drag5 should go to any target from Target1, Target2, Target3, Target4, Target5. The objects on Drag1 through Drag5 is similar like I am working on number system. So I want the Drag boxes to go to any place values into the target boxes. But the drag and target instance names should be unique and should be mentioned in the component inspector also.

View 3 Replies

ActionScript 2.0 :: Drag And Drop Item To Target And Check To Result?

Mar 23, 2012

I need to ask about drag and drop item to the target and how to check the result if the target is true?

View 2 Replies

ActionScript 2.0 :: Upload Image To A Movieclip, Then Drag And Resize?

Jun 11, 2007

I need to make a form that allows the user to upload an image from their own computer, then dump that loaded image into a movie clip, and allow them to move it about on stage, and possibly scale it. I have the upload function working, it allows me to select a file, and i have the server side php to dump the images on the server, but im not sure how to go about dumping the image in the movie clip after the usser has selected and uploaded it. Ive found stuff around the net that dumps the file into a scroll pane, but im not really sure how to modify the code to work with a movie clip. I think dragging and resizing will be cake after that, because theyre functions ive used before. But i just cant seem to get past this upload hurdle.

View 4 Replies

Actionscript 3 :: Flex - Tree Control Drag Drop .item Position?

Dec 9, 2009

just facing a difficulty with tree control drag drop..Suppose i have tree with drag-drop enabled.I want to which node(id) is droped inside which node. 1]if i drag "Cat1" node inside "Cat3",i want to identify ids of siblings of "cat1",and "cat3".2]in general i want to know the ids of current element being moved along withits new parent and new position and save these postions.3] Also "cat4" when moved outside "cat3",i want know its position and its siblings id.

<mx:XML id="treeDP">
<node label="Categories">
<node label="Cat1" id="1" isBranch="true"/>

[code].....

View 2 Replies

Flex :: Prevent The Addition Of Dragged Item In Tree Which Drag Accepting?

Oct 25, 2010

i have two tree one tree lets say TreeDrag is drag enabled and other is drop enabled lets say TreeDrop.. when i drag item from TreeDrag to TreeDrop,, i want to show feedback and everything else normal except the addition of dragged item in TreeDrop..

View 1 Replies

ActionScript 3.0 :: Drag And Drop Item Order Not Matching DataGrid Source

May 25, 2010

I have a DataGrid that contains data linked to a server. When I select mutliple items from the grid (using shift-select) and drag some items out from the DataGrid to another component, the array of items being dragged over appears to be in a completely arbitrary sort-order, and are not in the sort -order f the DataGrid as I'd expect.

Therefore, wwhen i drop them on the target (which is unsorted), their order doesnt match that of the DataGrid... what am I doing wrong and how can i fix this?

I'm getting the array using:

var dragItems:Array = event.dragSource.dataForFormat("items") as Array;

Is this the wrong data source on dragSource to look at?

I should mention that the drop target is a nonlist control, and that i am using a custom drop handler...

View 1 Replies

ActionScript 1/2 :: Multiple Dropzones For A Drag And Drop Item - Show Answers Option?

Nov 8, 2011

I have a drag & drop activity where 3 of the drags can go into 1 of 3 possible dropzones and be counted as correct. On clicking 'Submit', if only some are placed correctly, there's a 'Show me' option - this is the bit I can't do:if some of those with more than 1 possible answer are correct, I don't know how to check which dropzones are free to place the remainder in. My code for the first bit, checking the hitTest is ok:
 
for (var i:Number = 0; i<aLabels.length; i++) {
//3 drag items have 3 poss dropzones:
for (var t:Number = 0; t<aNewCorrectDZ[i].length; t++) {
//IF ITEM IS DROPPED ON ANY DROPZONE:

[code]....

View 3 Replies

ActionScript 2.0 :: Drag & Drop - Perform A HitTest The Item Is Supposed To Dissapear, But It Doesn't?

Mar 1, 2005

I'm having a problem with my dragOver function.The point of my project is that can drag the items that are on the table to the little bag (this is a button) on the left bottom of the screen.The thing is that the dragging works but when I perform a hitTest the item is supposed to dissapear, but it doesn't....

View 3 Replies

ActionScript 2.0 :: MovieClip - Control Resize With Mouse Or Single Click / Drag

Jan 20, 2010

I'm pretty new to Flash and seem to be struggling with variable scope, events and where to put code within movieclips/main area etc. What I'm trying to do is produce a Flash movie that will allow the user to click on a tool from a selection, i.e. a circle, then click on another part of the screen to place the centre of the circle, with a second click to set the radius of the circle (an alternative would be a single click and drag to place the circle and drag it out to the desired radius.) Once the mouse if clicked a 2nd time, or the drag operation is completed, the circle will stay at the selected radius.

The code I'm using so far to test out the idea is below:
_root.onEnterFrame=function(){
_root["item1"].onMouseMove=function(){
d = Math.sqrt(Math.abs(_xmouse-this._x)*Math.abs(_xmouse-this._x)+Math.abs(_ymouse-this._y)*Math.abs(_ymouse-this._y));
if(d<370){
this._width = d*2;
this._height = d*2;
}else{
this._width = 87;
this._height = 87;
}}}

This uses a simple circle movieclip, and the above code is placed in Frame 1 of the background as opposed to the movieclip itself. It resizes the circle movieclip ok, but I want to be able to control the resize with the mouse or with a single click/drag.

View 10 Replies

ActionScript 2.0 :: Drag And Drop Resize And Scale Movie Clips On Stage?

Jun 25, 2010

'i am doing a game for children where users can drag and drop resize and scale movie clips on stage!The drag and drop is not an issue...

View 2 Replies

ActionScript 3.0 :: Vector Of A Superclass Hold A Reference To A Vector Of A Subclass?

Sep 13, 2011

I'm getting

ActionScript Code:
1067: Implicit coercion of a value of type
__AS3__.vec:Vector.ie.aro.floorplanviewer.model.buildingVOs:ConfigurationVO>[code]....

which surprises me as ConfigurationVO inherits from NodeVO.Is the compiler really not able to figure out that a Vector of a superclass should be able to hold a reference to a Vector of a subclass?

View 7 Replies







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