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




X+y Position + Drag



hello...

I'm trying to create a dragable "movie-clip"
which will move to spesipic
_x and _y positions on the stage
if it hits other _x and _y.

The movment suppose to be in tween-animation

I'll apriciate any help.



FlashKit > Flash Help > Flash MX
Posted on: 07-02-2002, 12:48 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Drag Into Position
I'm trying to drag a movie clip into a square (also a MC). When I release the MC over the square I want it to center itself inside the square or whatever square it might be over (there are 6). I currently have the MC draggable, but don't know where to go from here.
Is there also a possibility to start the MC a little bigger than the square and have it scale down and center itself smoothly to fit on release? Thanks in advance for your help.
The .fla is at http://www.theautumnrun.com/squares.fla
A pic is at http://www.theautumnrun.com/squares.gif

Drag Movie + _x & _y Position
I'm trying to create a dragable "Movie Cilp"

+ the I need the "movie Clip" to move from
_x position and _y position
to new x and y position in animation.

I'll really apriciate all help

Resetting Position After Drag?
Did a search and found some script I could use, but what am I retarded? It won't work. So I did a dummy model and here is the FLA.

It zooms in and out on a button....and it will reset the size of the box on a button. But the box will also drag around. And I try to reset the position of the box after its moved, but thats not happening.

Please help somebody.

_D

Mouse Position On Drag
Hey guys,

I have a movie clip thats being dragged when clicked on.

I want to know what the best way to figure out if while im dragging i move over other movie clips on the screen and fire certain events based on which movie clip the mouse is above.

Im thinking to use the mouse coordinates but is there a better way?

Drag Mc Has To Snap To An Exact Position. Can Somebody Please Have A Look? Zip=8kB
How can I make the plug when drag snap to an exact position on the stage?

the attache zip is just 8 kB

Thanks looooots

Getting MC Back To Start Position After Drag?
I need help urgently!!!

a button starts a drag of a text box that in the beginning is hidden outside the screen. On roll over the box is dragged by the mouse. On roll out I would like for the box to go back to its original position.

I have tried stop drag and remove movieclip, but neither seems to work.

Anyone with an idea?

-Garbus

Character Position - Drag & Drop
I am trying to create a drag and drop interaction where a draggable item would be dragged and then dropped onto specific characters in a text field.

Is there a way to determine if something is released over specific characters of a text field, or a way to determine the x & y cordinates of a specific characters in a text field?

I'd normally do this by positioning a target MC over the specific text, and then use
eval(this._droptarget) == (targetMovieClip)
to determine if the item was released in the proper place, but I'm making a bunch of these, and am trying to do it dynamically, so I won't know where to position the targetMCs.

thx.

Return Drag Mc To Original Position
I don't know how to do this! It makes my head ache. Please help me!!! How can I make my dragged movie clip back to its original position after clicking a reset button?

Thank you so much to anyone who can help...

[F8] Restricting A X Position Of A Drag Button
I am attempting to create a custom scroll bar with a draggable button used to scroll the scroll bar.

Is there a way to restrict the X position of the drag function? I tried to use the left,top,bottom,right optional parameters of the startDrag function, but that isn't working. I've set the "left" and "right" parameters to 0.

This is what I have now:


Code:
button_mc.onPress = function(){
startDrag(button_mc, false, 0, minDragPos, 0, maxDragPos);
}


Thanks in advance!

[MX] Drag & Drop To Correct Position?
Hi there,

I am newish to flash. I am using flash mx so i think it would be action script 2.0.

I want to create a simply action where I can drag an oject / shape to a postion on the document, if it is the correct position it stays there is not a message appears or it bounces back to where it was. Can someone please help me?

Joe

How To Save The Movie Position After Drag?
i have a movie clip with drag and drop function. how to make it stay where i drop it??

How To Show The Last Position Of A Button That Been Drag
hi...
i want to develop an actionscript that when i hide an object (pressing 'hide' button) that i dragged to another place, it show the current position of the object (pressing 'show' button).Currently, the problem are if i press the show button the object will show.but if i drag it to another place and hide it..it will go to its previous position.
for now the script is like this:

i)Show button

on (press) {
LoadIcon = new LoadVars();
LoadIcon.load("data.txt");
LoadIcon.onLoad = function(success) {
if (success) {
for (k=0; k<=this.counts-1; k++) {
posX = "xpos"+k;
posY = "ypos"+k;
xposs = this[posX];
yposs = this[posY];
dupEmpty = _root.empty.attachMovie("poligon", "poly"+d, _root.d++);
dupEmpty._x = xposs;
dupEmpty._y = yposs;

dupEmpty.onPress = function() {
this.startDrag();
};
dupEmpty.onRelease = function() {
this.stopDrag();
};

}
}
};
}


ii)hide button

on (press) {
_root.dupEmptyLoad.removeMovieClip();
_root.empty = _root.createEmptyMovieClip("poly", 1);
a = 0;
}

-thank you-

A Constant Y Position For The Drag Proxy Possible?
hi,

i'm using DragManager.doDrag() in Flex 2 to create some drag functionality in a canvas.

is it possible to constrain the image used in the drag proxy to just one axis when it is being dragged?

In other words, I'm trying to create a slider-type effect that slides along a numberline.

the only form of control that i can see relating to positioning is 'yOffset':

thanx in advance

finty

Drag And Drop Position After Dropped
Just trying to add a little more functionality to this code for a drag and drop interaction. Suppose I have multiple objects to drag and some will have the same target. Right now (with this code), the draggable object gets positioned in the center of it's target so my draggalbe movieclips will overlap eachother once they're dropped on the correct target.

What I'd like to do is prevent this overlapping and have the movieclips slightly offset on the y axis so they cascade a bit. Could do this by writing out alot of code for the individual movieclips but i'd like to condense it a bit. Any thoughts?



Code:
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged = true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged = false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
trace("on targ");
} else {
this.onTarget = false;
trace("not on targ");
}
};
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
clip.onEnterFrame = function() {
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/5;
this._y -= (this._y-this.myHomeY)/5;
} else if (!this.beingDragged && this.onTarget) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
}
};
}

dragSetup(circle_mc,targetCircle);
dragSetup(circle_mc2,target2);
dragSetup(circle_mc3,target2);

Hittest -- Drag To Defined Y Position
Hi ,


i got 4 movie's on main (category0_mc, category1_mc, category2_mc and category3_mc) the _y position of these 4 movie's is variable.....

i want it so that when i start drag "categorie0_mc" you only can drag to (category1_mc, category2_mc and category3_mc) and when release "categorie0_mc" change _y position with the other categorie movie

i searched and find some things, but not usefull for me..

if somebody could point me to a tutorial or give a hint :d

thanks

Hittest -- Drag To Defined Y Position
Hi ,


i got 4 movie's on main (category0_mc, category1_mc, category2_mc and category3_mc) the _y position of these 4 movie's is variable.....

i want it so that when i start drag "categorie0_mc" you only can drag to (category1_mc, category2_mc and category3_mc) and when release "categorie0_mc" change _y position with the other categorie movie

i searched and find some things, but not usefull for me..

if somebody could point me to a tutorial or give a hint :d

thanks

Drag Button_x Controls Mc_x Position
I want to do mc that have dragable button on top and bellow
i have my project ikons. I would like to drag the button to the end of screen(only in x direction, left or right)and then the mc should start to runing in the oposite direction. Something like I saw on http://www.motown.com/classicmotown

I have one problem with that. When i create graphic simbol i dont have enough space to put all project ikons in a row. It is limited space for design.

************************************************** ******
i have look up in the tutorials and didn't find anything like this.
************************************************** *******
i found something on actionscript.org
intermediate level/tutorial1/Relative Scrolling Content and Navigation
but this isn't quite that i want. I understand the goto and other function used here.

my problem:
in the layer i must have mc that position is controled by dragbutton x position. I can do that. on mc lower layer i must have instant of graphic simbol that is masked.
i can do that.
and one more thing.....
in graphic simbol i must have all content thah i scroll.
How can i put in that graphic simbol content of 3000pixel spread ikons. As i say i will scrool horizontal with dragbutton this graphic.

Until now i only put 1500 pixel wide graphic and there is gray zone.
http://www.webagent007.com has similar thing. Not scrolling but wide graphic more than 1500 pixel.

*****************
The last thing that cross my mind as i writeing this long
question is to import wide graphic in one peace, but how can i then put invisible button over them.

i am staring to frustrate my self over this.
******************************************
Thanx all for help.

Reset Position Of Drag And Drop Game
I'm creating a "dressing up" game using the drag and drop functionality, however I would like to add a reset button that returns all the clothes to their original postion. Is there an effiecent way to code this?

Drag & Drop - Snap To Original Position
Hi,
I'm trying to do drag & drop. I have the drag working. I'm getting the feedback from trace letting me know when my movie clips hit the targets & which ones.
I cannot get my movie clips to snap back to the original position if they do not hit a target. That is what I'm trying to find out.

I have a movie clip (clip1) and a button within the movie clip. My target areas are numbered 1 to 4 (target1). The following code is on the button.



on (press) {
this.startDrag (false);
}

on (release) {
this.stopDrag();

if (_root.clip1._droptarget == "/target1") {
trace ("clip 1 in target 1");
}
if (_root.clip1._droptarget == "/target2") {
trace ("clip 1 in target 2");
}
if (_root.clip1._droptarget == "/target3") {
trace ("clip 1 in target 3");
}
if (_root.clip1._droptarget == "/target4") {
trace ("clip 1 in target 4");
}
else {
this_y= OrgY;
this_x= OrgX;
}
}


Please help

Drag To Rotate And Bounce Back To Original Position
help, can anyone teach me how should i drag and rotate it and bounce back to the original position.

Dial Drag Without Jump To Newly Clicked Position
Hi I am trying to do a rotating dial function, which I can do using the following code.

At the moment the dial automatically jumps to the position where the button down happens.
ie if the dial is turned to the far right for example and I click on the left, the dial jumps directly to the left position under my mouse

I want it so that the dial acts more like a dj dragging a record. A record doesn't jump to a position, it needs to be dragged to every position.

dial.onPress=function(){
pressing=true
}
dial.onRelease=dial.onReleaseOutside=function(){
pressing=false
}
_root.onEnterFrame=function(){
if(pressing){
rad=Math.atan2((_ymouse-dial._y),(_xmouse-dial._x));
degrees=Math.round(rad*180/math.PI);
dial._rotation= degrees


}
}



It s a difficult one to explain. I hope it makes sense.
Any ideas?

Making A 'drag N Drop' Object Snap To A Position
Howdy all, just a quick question. In following on from the 'drag and drop' tutorial, how would I make the object that i'm dragging snap to a particular position (lets say a tshirt snapping to a body)? Thanks all, BP

Drag And Drop - Moviclip Moving Back To Old Position
Hi Guys

I am learning to do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300.
Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

please can anyone help
thanks
orange

Drag And Drop - Moviclip Moving Back To Old Position
Hi Guys

I am learning to do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.

and the clipdrag movieclip is droped at say _x=200, _y=300.
Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.

please can anyone help
thanks
orange

Click Drag - Elastic Return To Position Effect
How can I have someone click/grab/ an object > remember it's last position > drag the object > onrelease the object returns to it's last position before being dragged (and with an elastic/rubberband effect)?

Thanks!

Drag Clip & Button To Send It Back To Original Position
I have a draggable movie clip that I've dragged and dropped at a random position on the stage.

I don't want it to snap back into place.

Does anyone know how I would code a button to tween it from that (random) spot back to it's original spot?

Thanks a lot in advance!!!
Pete

Drag Clip & Button To Send It Back To Original Position
I have a draggable movie clip that I've dragged and dropped at a random position on the stage.
I don't want it to snap back into place after it's dropped.

Does anyone know how I would code a button that would tween it from that (random) spot back to it's original spot?

Thanks a lot!!!
Pete

Drag Clip & Button To Send It Back To Original Position
I have a draggable movie clip that I've dragged and dropped at a random position on the stage.
I don't want it to snap back into place after it's dropped.

Does anyone know how I would code a button that would tween it from that (random) spot back to it's original spot?

Thanks a lot!!!
Pete

Drag N Drop (reset Draggable Objects To Original Position)
Hi! I have attached a screengrab of a Drag n Drop game I am working on. Currently, here is how it works:

I am defining a function on the first frame. I also call that function on the first frame to enable the drag n drop of the 6 chores on the left into the slots on the right. After dragging, the user clicks the "go to Next Day" button. The main timeline advances to the next frame where it re-defines the function and calls it again (to set different variables - I know this may not be the best way but I am crunched for time). Here is my problem:

When the "go to Next Day" button is clicked I need the draggable items to reset back to their original positions before the function is called. Currently they are staying in the slots on the right.

Here is the function and the call on the first frame:


Code:
function DragSetup(Obj, Target) {
Obj.Target = Target;
Obj.onPress = function() {
this.x = this._x;
this.y = this._y;
this.startDrag();
}
Obj.onRelease = function() {
this.stopDrag();
Drop = eval(this._droptarget);
if (this == chore1) {
_global.w1d1 = _global.w1d1 + 14;
} else if (this == chore2) {
_global.w1d1 = _global.w1d1 + 16;
} else if (this == chore3) {
_global.w1d1 = _global.w1d1 + 7;
} else if (this == chore4) {
_global.w1d1 = _global.w1d1 + 7;
} else if (this == chore5) {
_global.w1d1 = _global.w1d1 + 14;
} else if (this == chore6) {
_global.w1d1 = _global.w1d1 + 7;
}
daypoints.text = _global.w1d1;
for (a in Target) {
if (Drop == Target[a]) {
this._x = Target[a]._x;
this._y = Target[a]._y;
Check = 1;
return;
}
if (!Check) {
this._x = this.x;
this._y = this.y;
}
Check = 0;
}
}
}


DragSetup(chore1, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore2, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore3, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore4, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore5, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore6, [target1, target2, target3, target4, target5, target6]);
Here is the function and call on the second frame:


Code:
function DragSetup(Obj, Target) {
Obj.Target = Target;
Obj.onPress = function() {
this.x = this._x;
this.y = this._y;
this.startDrag();
}
Obj.onRelease = function() {
this.stopDrag();
Drop = eval(this._droptarget);
if (this == chore1) {
_global.w1d2 = _global.w1d2 + 14;
} else if (this == chore2) {
_global.w1d2 = _global.w1d2 + 16;
} else if (this == chore3) {
_global.w1d2 = _global.w1d2 + 7;
} else if (this == chore4) {
_global.w1d2 = _global.w1d2 + 7;
} else if (this == chore5) {
_global.w1d2 = _global.w1d2 + 14;
} else if (this == chore6) {
_global.w1d2 = _global.w1d2 + 7;
}
daypoints.text = _global.w1d2;
for (a in Target) {
if (Drop == Target[a]) {
this._x = Target[a]._x;
this._y = Target[a]._y;
Check = 1;
return;
}
if (!Check) {
this._x = this.x;
this._y = this.y;
}
Check = 0;
}
}
}

DragSetup(chore1, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore2, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore3, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore4, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore5, [target1, target2, target3, target4, target5, target6]);
DragSetup(chore6, [target1, target2, target3, target4, target5, target6]);
Could someone please show me how to reset these objects to their original positions when it advances to the second frame? A

lso, can someone tell me how to lock the draggable objects once they are dropped? Currently, you can keep moving them after dropping and it is messing up the "points" accumulation system.

Thanks,
aswhitehead

Drag & Drop - Animating A Dropped Object To Start Position
How can I make my drag and drop exercise so that when a dragged object is released, it goes back to its start position by animating back to it? I know how to script this so that it instantly snaps back to the start position, but I would like the user see the object move back to its start position.


My flash project can be downloaded from:

http://www.munzamedia.co.uk/flash/


Note: only the two top-left objects can be dragged.

Drag&drop-move Item Back To Original Position
I am making a flash site to view photos. I have created thumbnails which can be dragged to a viewing box where the photo is enlarged and snapped into place for viewing. The thumbnails are movie clips with buttons placed inside of them. The buttons have this code on them:

on (press) {
startDrag ("_root.betsy");
}
on (release) {
turnOff();
stopDrag ();
if (_root.betsy._droptarget == "/box") {
_root.box.gotoandStop("betsy");
}
}

"Betsy" is the name of one particular thumbnail. "Box" is the target viewing area. I would like the thumbnail to snap back to its original position after being dragged onto the viewing box. I want to keep the large photo open in the viewing box after the thumbnail has snapped back into place. What do I need to do?

-Abbie

Reset Movie Clip X-position & Y-position Back To Original
Is there a command to reset x-position, y-position and rotation all at once...like reset command?...or would I have to find the original x-positions and y-positions to all elements and hardcode that back....EEEK!!

Many Thanks
Andrea

SoundChannel.position - Trouble Triggering Event Based On .position
I would like to trigger an addChild event when my mp3 reaches a certain point.

My trace statements will only fire if I use <= but not ==

The goal is to add text to the stage when the MP3 has reached one second, what am I missing?

Ultimately there will be several trigger marks I need to hit along the MP3.


ActionScript Code:
var buffer:SoundLoaderContext = new SoundLoaderContext(10000);var welcome:Sound = new Sound(new URLRequest("Intro.mp3"), buffer);var welcomesc:SoundChannel = welcome.play();addEventListener(Event.ENTER_FRAME, playMessage);function playMessage(event:Event):void{trace(Math.floor(welcomesc.position));if (welcomesc.position == 1000)    {        trace("NOW!!!!!!!");    }    else    {        trace("WAIT-------------");    }welcomesc.addEventListener(Event.SOUND_COMPLETE, soundComplete);}

How To Position Mc_example Depending On Position Of Empty Movieclip?
I have a series of movieclips (graphics) which I want to position in a row.
I know that I can define the position of each movieclip individually by _x and _y. But can I place an empty MC on the stage and define the position of every single MC with _x and _y IN RESPECT TO THE POSITION OF THE EMPTY MC - so that ALL movieclips will change their position when I move the empty mc?

Thanks for helping
Aribert

[F8] Control Position Of Playhead In Movieclip By Position Of A Button
I am fairly new to actionscripting and just need a little help.

I have a bar which has a slideable block on it. When this block is dragged, to the left/right i want it to control the playhead inside another movieclip.

For example, when the block is to the far left, the playhead (of my movieclip) will be at the first frame. When the block is dragged to the right it will play the movieclip at the speed that the block is being moved and when it is at the far right it will be on the last frame of the movieclip. And when the block is dragged to the left it will play the movie backwards at the same speed etc...

It is just like the scrubber bars that are in media players, but instead of playing an actual video, i want to play the movieclip which is of an animation.

How would I do this?

Thanks

Flash Y Position Converted To Browser Scroll Position
I have a Flash movie that makes an fscommand call to the HTML page, and via Javascript, it moves the browser window scroll position down. I need to be able to scroll down to a position that coincides with a Y position on my Flash page, but I can't seem to figure out how to convert coordinates from a Flash Y position to a browser-window vertical scroll position. I hope this makes sense. Does anyone know how to do this? (I have all the code working to do this, except for this coordinate issue. That's the only part I need.)

Example:

Code:
myMC.onRelease = function() {
//Command to Javascript function in html doc
//Scroll down in browser to Y pos specified
//This scrolls down to 1000 position within browser window but
//but does NOT equate to a Y position of 1000 in .swf movie
//even if .swf movie is at 0,0 left & top margins within browser
fscommand("scrollToAnchor",1000);
};
Ultimately, what I am trying to do is simulate anchor points from HTML (not anchor points in Flash to go 'Back'), whereby you have a link at the top of the page, and you click it and it takes you somewhere else lower on the same page. Then you have a link there that says "Back to top", and it takes you back to the top of the page, etc.

Any ideas?

X Position? Y Position? Differs In MovieClips From _root?
Hey!

I'm confused:

I want to move a movieClip that is embedded in another movieClip:

firstMovieClip >> floatingMovieClip

Now, X = 0 IS NOT the upper left corner when I try to direct floatingMovieClip.

When I investigate the movieClip sets it's X = 0 in the middle. But on _root lever, X = 0 is the upper left corner.

Is it supposed to be this silly way?

THanks!
Regards

Help With Tweening From Current Position To Clicked Position
Hi
I have a motion tweening question-
I have a large rotary dial with an arrow on it, around that are 5 buttons. I want to set it up so that when the user clicks any button, the rotary dial will rotate until the arrow is pointing to that particular button. I can't figure out how to make it so that the dial tweens from one position to the other, which is of course dicated by where the user clicks. I also want that dial to stay pointed to that specific button until another one is clicked.

How can I do this?

Thanks!!!

-Steve

Mouse X Position To Control Movie Position?
Hi, my understanding of actionscript is very basic and I'd like some help with writing a very simple script. Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).

Reported X Position Doesn't = Actual X Position?
I can't figure this out. I'm loading a serious of pages of images in the same flash document, but all pages after the first one have a lower y position of about the height of one of the images. When I trace their y position they all say 30, when it's clearly more like 150. What's going on here?

(1)drag Drop In 3 (2)drag Dropin 3 ...print 3 Contents (1)+(2)
i want to do the following.

drag (dynamic text file link)1 of choice of x text file links
into an area where all text file links can then be printed..(the text file itself)


[1] [2] [3] [4] [5]...


(basket)


drag drop [1] then [2] then [3] then [4] into (basket)

then print textfiles related to [1] [2] [3] [4]

if sombody could point me to a good tutorial or help me on my way?

thanx

Drag Dial (ie Drag Point In A Circular Motion)
I want to incorporate a dial (such as volume dial on a TV, or a timer dial on a microwave) so that when the user clicks on the dial they can move the dial up and down, but in a circular motion.


Does anyone know where I can get a tutorial/movie that would help me with that?

Does that even make sense?!

Drag Function Lost In Main .swf When Drag External .swf
using MX:

I made this really cool menu that acts like the MAC OS X buttons...
The only problem that i have is when i load an external .swf (which is a window) and drag the window the startdrag funtion on the MAC OS X buttons stops working...

so to break it down:

Main .swf:


Quote:




startDrag("dragscale", true);






then the code in the buttons to make then scale (this code may not matter):

Quote:




colnum = "1";
startnum = 1;
endnum = 6;
numberofItems = 6;
mouseposX = int(getProperty("../dragscale", _x));
mouseposY = int(getProperty("../dragscale", _y));
i = startnum;
m = startnum;
filledSpace = 0;
gapspace = 0;
if (Number(myInit) == Number(false)) {
// on first run make an array of all the text Y Pos.
while (Number(i)<=Number(endnum)) {
set("textY" add i, getProperty ("text" add i, _y ) );
i = Number(i)+1;
}
i = startnum;
myInit = true;
}
boundleft = getProperty ("../boundbox" add colnum, _x);
boundright = boundleft + getProperty ("../boundbox" add colnum, _width) ;
boundtop = getProperty ("../boundbox" add colnum, _y);
boundbottom = boundtop + getProperty ("../boundbox" add colnum,_height);
if (Number(mouseposX)>=Number(boundleft) and Number(mouseposX)<=Number(boundright) and Number(mouseposY)>=Number(boundtop) and Number(mouseposY)<=Number(boundbottom)) {
while (Number(i)<=Number(endnum)) {
myDif = (eval("textY" add i) ) - (mouseposY - boundtop);
// percentage increase
scaleAmount = 150-((myDif*myDif)/16);
alphaAmount = 100-((myDif*myDif)/6);
if (Number(alphaAmount)<50) {
alphaAmount = 50;
}
if (Number(scaleAmount)<100) {
scaleAmount = 100;
}
setProperty("text" add i, _xscale, scaleAmount);
setProperty("text" add i, _yscale, scaleAmount);
setProperty("text" add i, _alpha, alphaAmount);
i = Number(i)+1;
}
// *** add up total Y pixels taken by text ***
while (Number(m)<=Number(endnum-1)) {
filledSpace = filledspace + getProperty ( "text" add m, _height);
m = Number(m)+1;
}
// *** find total Y pixels not taken by text
totalheight = getProperty ( "text" add endnum, _y) - getProperty ( "text" add startnum, _y);
gapSpace = totalheight-filledspace;
avgDistance = gapSpace/numberofitems;
m = Number(startnum)+1;
while (Number(m)<=Number(endnum-1)) {
setProperty("text" add m, _y, (getProperty ( "text" add (m-1), _y) + getProperty ( "text" add (m-1), _height)) + avgdistance);
set("watchheight" add m, getProperty ( "text" add m, _height));
m = Number(m)+1;
}
} else {
// *** shrink text back when mouse rolls out
i = startnum;
while (Number(i)<=Number(endnum)) {
if (int ( getProperty ("text" add i, _yscale ) ) >= 100) {
// return scale back to original state
setProperty("text" add i, _yscale, int ( getProperty ("text" add i, _xscale ) ) - 1);
setProperty("text" add i, _xscale, int ( getProperty ("text" add i, _yscale ) ) -1);
}
if ( getProperty ("text" add i, _y) < eval("textY" add i)) {
// return y position back to original state
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) + 1);
}
if ( getProperty ("text" add i, _y) > eval("textY" add i)) {
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) - 1);
}
if ( getProperty ("text" add i, _Alpha) > 50) {
setProperty("text" add i, _alpha, int ( getProperty ("text" add i, _alpha ) ) - 1);
}
i = Number(i)+1;
}
}







NOw the External .swf code:


Quote:




on (press) {
startDrag ("_parent.win2")
}
on (release) {
stopDrag ();
}







I am pretty sure the "on release stopDrag" code is making the above buttons stop scaling...

How can i make it only stop draging the window not the entire movie??

basic question is it posible to have multiple dragable objects in one movie clip???

Drag Function Lost In Main .swf When Use Drag On External .swf?
using MX:

I made this really cool menu that acts like the MAC OS X buttons...
The only problem that i have is when i load an external .swf (which is a window) and drag the window the startdrag funtion on the MAC OS X buttons stops working...

so to break it down:

Main .swf:



quote:
--------------------------------------------------------------------------------
startDrag("dragscale", true);
--------------------------------------------------------------------------------



then the code in the buttons to make then scale (this code may not matter):

quote:
--------------------------------------------------------------------------------
colnum = "1";
startnum = 1;
endnum = 6;
numberofItems = 6;
mouseposX = int(getProperty("../dragscale", _x));
mouseposY = int(getProperty("../dragscale", _y));
i = startnum;
m = startnum;
filledSpace = 0;
gapspace = 0;
if (Number(myInit) == Number(false)) {
// on first run make an array of all the text Y Pos.
while (Number(i)<=Number(endnum)) {
set("textY" add i, getProperty ("text" add i, _y ) );
i = Number(i)+1;
}
i = startnum;
myInit = true;
}
boundleft = getProperty ("../boundbox" add colnum, _x);
boundright = boundleft + getProperty ("../boundbox" add colnum, _width) ;
boundtop = getProperty ("../boundbox" add colnum, _y);
boundbottom = boundtop + getProperty ("../boundbox" add colnum,_height);
if (Number(mouseposX)>=Number(boundleft) and Number(mouseposX)<=Number(boundright) and Number(mouseposY)>=Number(boundtop) and Number(mouseposY)<=Number(boundbottom)) {
while (Number(i)<=Number(endnum)) {
myDif = (eval("textY" add i) ) - (mouseposY - boundtop);
// percentage increase
scaleAmount = 150-((myDif*myDif)/16);
alphaAmount = 100-((myDif*myDif)/6);
if (Number(alphaAmount)<50) {
alphaAmount = 50;
}
if (Number(scaleAmount)<100) {
scaleAmount = 100;
}
setProperty("text" add i, _xscale, scaleAmount);
setProperty("text" add i, _yscale, scaleAmount);
setProperty("text" add i, _alpha, alphaAmount);
i = Number(i)+1;
}
// *** add up total Y pixels taken by text ***
while (Number(m)<=Number(endnum-1)) {
filledSpace = filledspace + getProperty ( "text" add m, _height);
m = Number(m)+1;
}
// *** find total Y pixels not taken by text
totalheight = getProperty ( "text" add endnum, _y) - getProperty ( "text" add startnum, _y);
gapSpace = totalheight-filledspace;
avgDistance = gapSpace/numberofitems;
m = Number(startnum)+1;
while (Number(m)<=Number(endnum-1)) {
setProperty("text" add m, _y, (getProperty ( "text" add (m-1), _y) + getProperty ( "text" add (m-1), _height)) + avgdistance);
set("watchheight" add m, getProperty ( "text" add m, _height));
m = Number(m)+1;
}
} else {
// *** shrink text back when mouse rolls out
i = startnum;
while (Number(i)<=Number(endnum)) {
if (int ( getProperty ("text" add i, _yscale ) ) >= 100) {
// return scale back to original state
setProperty("text" add i, _yscale, int ( getProperty ("text" add i, _xscale ) ) - 1);
setProperty("text" add i, _xscale, int ( getProperty ("text" add i, _yscale ) ) -1);
}
if ( getProperty ("text" add i, _y) < eval("textY" add i)) {
// return y position back to original state
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) + 1);
}
if ( getProperty ("text" add i, _y) > eval("textY" add i)) {
setProperty("text" add i, _y, int ( getProperty ("text" add i, _y ) ) - 1);
}
if ( getProperty ("text" add i, _Alpha) > 50) {
setProperty("text" add i, _alpha, int ( getProperty ("text" add i, _alpha ) ) - 1);
}
i = Number(i)+1;
}
}
--------------------------------------------------------------------------------




NOw the External .swf code:


quote:
--------------------------------------------------------------------------------
on (press) {
startDrag ("_parent.win2")
}
on (release) {
stopDrag ();
}
--------------------------------------------------------------------------------




I am pretty sure the "on release stopDrag" code is making the above buttons stop scaling...

How can i make it only stop draging the window not the entire movie??

basic question is it posible to have multiple dragable objects in one movie clip???

Drag 2 MCs, Kinda...drag 1MC, Follow MC Half?
i want to drag an object and have another mc to move half that distance. im trying to get the nondragMC to move half the distance from the bottom of the stage than the dragMC is moved by the user. they both start at the bottom of the stage and when the user drags the dragMC up, i want the other mc to move half the distance with the drag. dont know what script i should use. anybody got any ideas?

How To Make A Drag'n'drop Change Mid Drag?
Help! I already know the script to make a Movie Clip drag and droppable.
But how do I make it switch to a different Movie Clip in the middle of being dragged?
Please please help.

Stacking Drag Movie Lagging When Drag...
just wonder if anyone know how to solve these problem.

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. Can't imgaine what will happen if it is on the net. Please help! is this normal for drag object ?

Drag Drag Drag Menu
hi everyone

i have created a basic dragable menu, what i want to happen is that the menu can only be dragged in y position,or moves in y and slightly moves in x,....... what should be done?

this is the script:
on (press) {
startDrag("/drags");
}
on (release) {
stopDrag();
}

thanxxxxxxx

I ?guess? It Is About _x.position And _y.position
My Flash 5 file attached !

When you hit button 2 and 4, you will see the word "Congratulations"
Now I would like the word just appear in the yellow area.

"You nerd - just drag the Congrats Clip in the yellow area, that's it" Hehe I know that but in my real program I have more than 110 clips which almost fill up my screen. Therefore I do not want to overlap tons of clips.

Copyright © 2005-08 www.BigResource.com, All rights reserved