Dragging A Loaded Movie
I've got a text box movie that I am loading into another swf. I want to add a button to drag that text box around the screen, but I don't know how to do this since the "target" would be the loaded movie. Please help.
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-22-2001, 01:45 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dragging A Movie Loaded With LoadMovie
Hi
I've got a button in my main timeline that loads a movie over the main one like a pop-up in html. What i'd like to do is to make it draggable, but i don't know how - or where i have to put the code (in the loaded movie or in the main movie but referring to the loaded movie) ...
Could you help ?
thank you :-))
Dragging A Loaded Pop-up
Hi
I have used the following action script to load a pop up window into a movie using a button:
on (press) {
this.attachMovie("mypopmc", "window", 1);
window._x = 250;
window._y = 150;
}
I have included a button in the movie clip to remove it
on (press) {
this.removeMovieclip("window");
}
Now I would like the movie clip once it has popped up to be dragged on press of the mouse and of course released on release.
How can I do that and maintain the functionality of the button inside the clip used to remove it?
Any advice would be greatly appreciated.
Regards
Dragging Loaded Movies
If I load a movie into a holder_mc, can i then drag that movie by targeting the holder_mc? This is what Ive got:
blank1.loadMovie("main_content.swf");
blank1._x = -(0);
blank1._y = 77;
blank1.onPress = function() {
blank1.startDrag(true);
}
blank1.onRelease = function() {
blank1.stopDrag();
}
Also, how would i write this so that the dragging is constricted within a boundary box?
If I got the above code to work, I was going to try something like:
blank1.onPress = function() {
blank1.startDrag(true, 0, 225, 0, 400);
}
Help is appreciated. Thanks!
Dragging Dynamically Loaded Text
I'm using Flash MX and have a basic understanding of Actionscript.
I have a mc. The mc is supposed to resemble a small window with a title bar. The 'window' can be minimized, maximized, and closed. The mc ('window') is draggable. Inside that mc are a number of buttons (one of which is the buttn that makes the mc draggable).There is also another movieclip into which I want to place a text box that dynamically loads a text file. The code =
loadText = new loadVars();
loadText.load("news.txt");
loadText.onLoad = function() {
scroller.text = this.newstext;
};
The text file loads fine. The problems now are:
1 The main mc - 'window' - drags erratically. It's jumpy and hesitates.
2 The other problem is that when I minimize my window (using : on (release) {setProperty("_root.win.bottombar", _yscale, "0");} )the lowerpart of the window disappears, but the text stays visible!!!!!
The same thing happens when I close the window (using:
on (Release) {setProperty("_root.win", _alpha, "0");} ).
The dynamically loaded text stays visible!!!
I certainly hope someone has an answer that will solve this issue for me.
Dragging Dynamically Loaded Text
I'm using Flash MX and have a basic understanding of Actionscript.
I have a mc. The mc is supposed to resemble a small window with a title bar. The 'window' can be minimized, maximized, and closed. The mc ('window') is draggable. Inside that mc are a number of buttons (one of which is the buttn that makes the mc draggable).There is also another movieclip into which I want to place a text box that dynamically loads a text file. The code =
loadText = new loadVars();
loadText.load("news.txt");
loadText.onLoad = function() {
scroller.text = this.newstext;
};
The text file loads fine. The problems now are:
1 The main mc - 'window' - drags erratically. It's jumpy and hesitates.
2 The other problem is that when I minimize my window (using : on (release) {setProperty("_root.win.bottombar", _yscale, "0");} )the lowerpart of the window disappears, but the text stays visible!!!!!
The same thing happens when I close the window (using:
on (Release) {setProperty("_root.win", _alpha, "0");} ).
The dynamically loaded text stays visible!!!
I certainly hope someone has an answer that will solve this issue for me.
Dragging Dynamically Loaded Text
I'm using Flash MX and have a basic understanding of Actionscript.
I have a mc. The mc is supposed to resemble a small window with a title bar. The 'window' can be minimized, maximized, and closed. The mc ('win') is draggable. Inside that mc are a number of buttons (one of which is the buttn that makes the mc draggable).There is also another movieclip into which I want to place a text box that dynamically loads a text file. The code =
loadText = new loadVars();
loadText.load("news.txt");
loadText.onLoad = function() {
scroller.text = this.newstext;
};
The text file loads fine. But it loads before the 'win' mc loads. So, there is text hanging out there. I cant't seem to make the text box 'invisible' prior to loading it (although the mc it is embedded in is visible = false. The problems now are:
1 The dynamic text box loads immediatley and there is text hanging out there.
1 The main mc - 'window' - drags erratically. It's jumpy and hesitates.
I certainly hope someone has an answer that will solve this issue for me.
I have placed the files here:
http://www.landstownhs.vbschools.com/fla/
Dragging Movie Clip To Play 2nd Movie
I created a movie clip called drag that is being dragged by the mouse. I have a seconded movie clip called spin that is on the stage. A third movie clip, Which is blank, on the stage has my actions. My goal is to have the spin movie play when the mouse moves. On the first frame in the blank clip, I have:
Begin Tell Target ("../spin")
stop
End Tell Target
Set Variable: "locate" = GetProperty (drag, _x)+GetProperty (drag,_y)
The second frame has:
If (locate = GetProperty (drag,_x)+GetProperty (drag,_y))
Go to and Play (3)
Else
Begin Tell Target (../spin)
Play
End Tell Target
Go to and Play (1)
Frame three has an action that goes back to frame two
When i test the movie and i move the mouse i get a warning telling me that there is an infinite loop.
What could be wrong with the code?
Dragging A Movie
Hi there
I need to control the movement on y axis of a movie clip (aclip), this has to done from a control bar(bclip).
It´s very much similar to how scrolls work, I need to move the "scroll" and the aclip has to move down or up according to bclip.
anyone can help me?
WHY : My Movie Is Dragging In Other PCs
Hello,
I have a flash movie which works perfectly in my PC. But when I view it in other PC, it seems that the animation is dragging. What are the reasons for such thing? Is it VIDEO CARD? Because in some computers, it works fine.
Thanks
WHY : My Movie Is Dragging In Other PCs
Hello,
I have a flash movie which works perfectly in my PC. But when I view it in other PC, it seems that the animation is dragging. What are the reasons for such thing? Is it VIDEO CARD? Because in some computers, it works fine.
Thanks
Dragging A Movieclip But When Not Dragging Click To Run Function
basically I have a bunch of boxes on the stage. what I'm trying to accomplish is that when a clip is clicked and held it can be dragged. when you release naturally it should stop dragging.
here is the part that stumping me. if you click it without dragging I want it to call a function.
like I said I'm quite stumped at this point any help or suggestions would be great.
cheers
drew
Dragging A Movie Clip......
i'm trying to drag a movie clip that springs back to it's home x & y position.....i have done this ok, however i have another movie clip that should follow it but will only travel half the distance i drag the other one.
any suggestions?
cheers
Dragging Movie Clips Around....
Here's the problem. Xmas tree needs to be decorated. There's about 30 decorations which are to be dragged about.
I've made each item a movie, and applied the following code actionscript to it:
onClipEvent (mouseDown) {
startDrag ("this, true");
}
onClipEvent (mouseUp) {
stopDrag ();
}
After selecting an item and dragging it to the tree (which works fine) I go back to pick up another piece of decor. Problem is, when I try and select another one, it moves the one that I have just placed on the tree.
What is the problem here, and how do I sort this out ??
Frustrated and deadlined...
Fabman
Dragging Movie Clip
hi,
what script can i define if I want to restrict dragging a movie clip in a circle and not a square area?
Dragging Movie Clips
I have looked through the tutorials on this site but im still confused on howto get a movie clip to move with the mouse when i click on it (drag).. I want to know howto have a movie clip i made 'drag' when I click on it and then 'undrag' when I release..
Dragging 2 Movie Clips
Hi,
I have a movie clip which has to move as per the position of the mouse,horizontally only.To achieve this i have used the start drag (on load)- constraint to rect property. however due to this it does not recognise the buttons residing on the stage.
Please advise.
Arcane(arcane676@hotmail.com)
Dragging In Certain Part Of A Movie
im trying to find the way
to drag a movie clip inside a box
so the movie clip wont get out of the box that I assigned
anybody know how to do that?
my current work
www.indonesia-net.com/hansenwork2.htm
not working the way i want it to be....
cuz u still can drag it outside the box...
Dragging In Certain Part Of A Movie
dragging in certain part of a movie
im trying to find the way
to drag a movie clip inside a box
so the movie clip wont get out of the box that I assigned
anybody know how to do that?
my current work
www.indonesia-net.com/hansenwork2.htm
not working the way i want it to be....
cuz u still can drag it outside the box...
therse another posibble way i found...
by putting this action script
startDrag(this, false, 100, 100, 200, 200);
but i dunno how to make the accurate measurement....
help me plz
Dragging Two Movie Clips?
I need to vertically drag two separate movie clips simultaneously, but from what I understand startDrag() only lets you drag one clip at a time. Is there any way to get around this??
Thanks
HELP Dragging Movie Clips..
Uhm.. I really need help. I just want to know how could I make a movie clip go up with the use of a button and also go down? I want to create an "iframe" effect in flash but I don't know how to do it. I really need help.. please... thanks...
Dragging Movie Clips
While dragging a movie clip I need to be able to locate given x points along the dragging line for the movie clip being drug. When those points are defined I will need to have it stop at those given x points and still be dragable to next point.
Dragging A Movie Via Slider Bar
I have looked everywhere in the tutorials for this, but i cant find anything.
I need to be able to drag a movie clip from left to right via a slider bar at the bottom of the movie.
To explain it better, imagine if you have an image thats too big for your screen, at the bottom of the window theres a horizontal scroll bar, when you drag the bar right, the image scrolls left and vice versa.
I need to incorporate this into a site asap
If anyone can point me in the right direction for a tutorial, or know how to do such a task, your advice would be appreciated.
Thanks
Aaron Bennett
Dragging Movie Clips Help Pls
Hi, i have this code that enables me to drag a movie clip on the stage:
onClipEvent (load) {
// start out not dragging
dragging = false;
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// follow the mouse from now on
dragging = true;
// get the mouse offset
xOffset = this._x - _root._xmouse;
yOffset = this._y - _root._ymouse;
}
}
onClipEvent (enterFrame) {
if (dragging) {
// set to location of the mouse
this._x = _root._xmouse + xOffset;
this._y = _root._ymouse + yOffset;
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// don't follow the mouse any longer
dragging = false;
}
}
This lets you drag it along the x and y axis, but i only want it to drag along the x-axis i.e. left to right, right to left, not up and down.
Does anyone know the script that will let me do this? What would also be nice would be when you drag it, for the dragging to be disabled once the mouse pointer is at a certain point on the stage.
Thanks alot!
Dragging Movie Clip Help Pls
Hi, think i posted this is wrong thread. I have this code that enables me to drag a movie clip on the stage:
onClipEvent (load) {
// start out not dragging
dragging = false;
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// follow the mouse from now on
dragging = true;
// get the mouse offset
xOffset = this._x - _root._xmouse;
yOffset = this._y - _root._ymouse;
}
}
onClipEvent (enterFrame) {
if (dragging) {
// set to location of the mouse
this._x = _root._xmouse + xOffset;
this._y = _root._ymouse + yOffset;
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
// don't follow the mouse any longer
dragging = false;
}
}
This lets you drag it along the x and y axis, but i only want it to drag along the x-axis i.e. left to right, right to left, not up and down.
Does anyone know the script that will let me do this? What would also be nice would be when you drag it, for the dragging to be disabled once the mouse pointer is at a certain point on the stage.
Thanks alot!
Movie Clip Dragging
is it possible to drag a movie clip between levels?.......i have a movie clip in level 4 and i want to be able to drag it to level0........ Im not sure if this is even possible but if anyone has any suggestions please post a reply to this thread.....Have a great day
Movie Clip Dragging
I know how to drag a movie clip and make it lock to the center, but how do you make the movie go to a certain frame when the movie clip is dragged over a button?
I've been trying for hours, and it's driving me crazy!
Dragging Movie Clip
I must be forgetting something. Can you check my code?
Everything works fine except the movie clips are visible when the movie loads, they disappear and reappear upon the proper action, but I don't want them to be displayed until the roll over has been made.
on (rollOver) {
_root.controlroom_1._visible = 1;
startDrag("_root.controlroom_1", true);
}
on (rollOut) {
_root.controlroom_1._visible = 0;
_root.controlroom_1.stopDrag();
}
on (press) {
gotoAndPlay("controlroom_info");
}
"controlroom_1" is the instance name of my movie clip.
Anybody?
Flip X/Y When Dragging A Movie Clip
Is there any way to flip the X/Y properties when dragging a movie clip? Like when you move the mouse up it drags it down, and left goes right. Thanks in advance.
Loading External Movie And Then Dragging It
Hi.
Im loading and external movie containg one image into a target movie called thumb:
loadMovie("thumb.swf", "_root.libruary.move1_.thumb");
My aim is to have no code within the external movie because its going to contain a single image. Im now having difficulty trying to drag the movie clip thumb. The laoded movie just stays in one place. Is it possible to do this? If so how?
Dragging Movie Clips Vs. Buttons
I'm still new to Actionscript, so this may seem like a common and/or stupid question.
When I user onClipEvent(mouseDown) and startDrag(this.clip), the movie clip will start to drag no matter where you click on the screen.
If I use a button and on (press), I can't give the button an instance name in flash 5.
How should I solve this problem?
Clicking And Dragging More Than One Movie Clip At Once.
Heya,
Quick question,
Does anybody know how or if it is possible to make Flash MX drag more than one object at once?
Basically i've got two movie clips: and i'm trying to make it so that when the user clicks on one of them, the second movie clip will be dragged along as well...
However,
whenever i apply the command to -both- objects, only one of them [[it would seem to always be the second clip]] is dragged along by the mouse movements, while the other one remains stationary...
Any assistance will be greatly appreciated, thanks.....
Dragging/Duplicating A Movie Clip
Hi - I'm trying to figure out a way to basically create a stacking effect out of a draggable element. Is there a way to do this without manually duplicating and stacking?
Any help is much appreciated!
Dragging Duplicated Movie Clips
i have movie clips that i'm using as stamps in a drawing program. when you click once on the stamp it picks it up then when you click again it places the stamp on the board. there are some problems with it though that I dont know how to fix. the problems are...
the biggest problem... when you click on a different stamp, one of the previous stamps disappears. so if you put two pig stamp on the board, and then put a chicken stamp on the baord, one pig will disappear. i dont want to have a stamp limit, they should be able to fill the whole board with stamps if they choose.
once the stamp is placed on the board you can click on it again and duplicate and drag the already duplicated MC. i dont want it to do this. i only want them to have one chance to place it on the board.
heres the code im using:
on (press) {
this = this.duplicateMovieClip("pig2"+count, count);
count += 1;
startDrag (this);
}
on (release) {
stopDrag ();
}
i changed the name of the duplicate mc for each stamp, for example the chicken is named "chicken2".
any help would be appreciated, thanks.
Dragging Objects Between Movie Clips
I am new so this might be simple but I can't figure it out.
I have created 4 draggable objects (cartoon eyes) that are hosted within one movie clip (an "eyes menu") . I have also created a second movie clip (a blank face) to serve as a drop target.
After I drag the eyes onto the face drop target, I want to be able to choose a nose from a similar menu (4 draggables in a nose menu).
To hide each menu when not in use, I have set the y value to put it off screen.
The problem is that the draggable eyes on the face drop target disappears with the rest of the un-chosen eyes when the nose menu is chosen and the y value of the eye menu changes.
Is this clear? Is there a better way to do this?
Dragging A Very Small Movie Clip
Hi,
I have a movie clip that's really just a line segment. I've made it draggable but I'm wondering if there's a way to make the "grab area" bigger. It's very difficult to grab the mc as is. Is there a line or two of code I could add to it?
Thanks!
[F8] Dragging Objects Out Of A Movie Clip
hi, hope somebody can help me because i'm dying here.
i'm doing a paper doll game.
i have a stationary menu at the bottom of my stage with buttons that open four different movie clips (closets) on the right. each clip has items (clothing) that i want to drag and drop onto the main stage area where my doll is.
i brilliantly thought that i could make each clothing item a movie clip and then use the standard "start drag" code to move them onto my doll. but i can only drag to the end of the closet movie clips.
how on earth do i drag items out of the movie clip to the main stage where my doll is. what is the code?
am i supposed to be using targets?
this is not working:
Code:
on (press) {
startDrag(this);
}on (release) {
stopDrag();
}
any help would be appreciated.
thank you
Cleaner Movie Clip Dragging
I briefly remember seeing a tutorial for this somewhere but I cant find it anywhere. But is there a way to drag movie clips around using startDrag but with a cleaner more fluent motion as it a bit jolty when moving?
Anydony know the answer?
Dragging & Duplicating A Movie Clip
Hi - I'm trying to figure out a way to basically create a stacking effect out of a draggable element. Is there a way to do this without manually duplicating and stacking? Each one needs to be able to be dragged independantly.
Any help is much appreciated!
Dragging & Movie Clip Buttons?
How do I keep the buttons of a draggable movie clip ( say, a stereo control) dominant after I input the startdrag coding? it seems that buttons in a mc are overridden by this; I have two fistfuls of hair and no answers!
the Darkitect
Dragging Complete Flash Movie Is It Possible?
HI!
Ive been using flash since flash 4 and would consider myself intermediate/advanced. I havent used flash in a while however and have gotten rusty.
Is it possible with FlashMX to be able to drag my whole published movie? I have a website in plain html which I want a navigation bar/remote to be made in flash. The navigation bar is made but I would like the user to be able to drag and drop the nav. bar where he/she pleases.
Not sure if I have explained this well so I will try again Is it possible to have a movie that is possible to drag and drop anywhere on my webpage? If it is possible then hows it done?
hmm still not sure if anyone will understand my lame attempts at explaining this. Any reponses would be greatly appreciated.
cheers!
Problem With Dynamic Movie Dragging
Hi,
I am trying to drag my dynamic moviclips. But this code does not work properly.
I have to mosue click the movie clip, and once again use mousepress to drag the movie clip.
Is there an way o eliminate the two clicks? Thanking you in advance.
Here is the code.
clickAction = function (_arg2) {
//info._y += 150;
trace("click"+_arg2); // _arg2 contains name of dynamic movieclip
_arg2.onPress = function (){
trace("on press"+_arg2);
_arg2.startDrag();
// further code
}
_arg2.onRelease = function (){
_arg2.stopDrag();
// further code
}
}
//code for creating dynamic movieclip
for (i=0; i < xmlnodecount; i++) {
_root.content_mc.image_mc.duplicateMovieClip("imag e_mc"+i, i);
_root.content_mc["image_mc" + i]._x = imageWidth * xinc; ;
_root.content_mc["image_mc"+i]._y = yinc;
loadMovie(image[i],_root..content_mc["image_mc"+i].holder);
}
Having Trouble Dragging A Movie Clip
I was doing the equilibrium tutorial, in special effects, and I could not make the movie clip object draggable, I added this code to the movie clip--
on(press){
startDrag(this);
}
on(release){
stopDrag();
}
But whenever I previewed it I got this output--
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: on handlers may not nest within other on handlers
on (press) {
What code should I put in to make something draggable?
Thanks for the Help
¦wyatt¦
Dragging & Duplicating A Movie Clip
Hi - I'm trying to figure out a way to basically create a stacking effect out of a draggable element. Is there a way to do this without manually duplicating and stacking? Each one needs to be able to be dragged independantly.
Any help is much appreciated!
Dragging Complete Flash Movie Is It Possible?
HI!
Ive been using flash since flash 4 and would consider myself intermediate/advanced. I havent used flash in a while however and have gotten rusty.
Is it possible with FlashMX to be able to drag my whole published movie? I have a website in plain html which I want a navigation bar/remote to be made in flash. The navigation bar is made but I would like the user to be able to drag and drop the nav. bar where he/she pleases.
Not sure if I have explained this well so I will try again Is it possible to have a movie that is possible to drag and drop anywhere on my webpage? If it is possible then hows it done?
hmm still not sure if anyone will understand my lame attempts at explaining this. Any reponses would be greatly appreciated.
cheers!
Dragging Movie Clips To Enable Sound
can anyone help.
I have created a draggable movie clip and several other static ones.
I want a sound to be played when the main movie clip is dragged over anyone of the static ones, but it must only happen when the 2 movie clips are overlapping, and not at any other time.
Does anyone know how to do this??
Dragging Movie Clips To Activate Sound
can someone help with this PLEASE!
I've created a flash file with several static MC's and I've got one draggable one. What i want to happen is everytime the draggable MC is dragged over a static one it activates a sound, but it must only do it when the two MCs are overlapping and not just when the mouse cursor hits it.
Anyone got any suggestions.
Movie Clip In Library Not Dragging Onto Scene
I have no idea what's going on. I just have a guess.
I have a big .FLA Flash file. About 20 MB in size, because lots of stuff is in it.
I imported a Symbol (Movie Clip) from another Flash File i created for it Originally, into my movie. The symbol got imported, and included in my Library. Now when i drag the symbol from my Library onto a keyframe in my Scene.. the system shows the Wait Cursor for few minutes.. and then NOTHING HAPPENS!! It's thier in my Library.. it even Plays in the Library Preview.. but it doesnt add into my Scene!!
Basically it's an Avi Clip i saved an Image Sequence of in Gif, and imported in a Flash Movie and made a Movie Clip Symbol out of it. I did this with 2 others also, and they are included in my Movie, which makes the size 20 MB of the .FLA, but when the 3rd one has come in my Library, why the HELL is it NOT ADDING into my Scene??? What is happening?
What do i do? Please Help!!!
Rahul
Dragging Multiple Movie Clips Simultaneously
Hello Everyone,
Here's a problem that's probably been asked many times but in all of my searching I haven't found a good workaround for it. Maybe someone can think of one or suggest one? Or if someone knows of a good workaround, please give me the URL.
I need to drag two (and potentially more) movie clips simultaneously. I am developing a Flash-based drawing application which will have a "group" function that allows multiple objects to be repositioned at the same time.
I've distilled the problem down to this: Suppose I have two movie clips, one called "master" and the other called "slave". When the master clip is dragged, the slave clip should move by the same amount, so that it appears that they move as a "group".
Here's what I have so far. In this code sample, which can be viewed at http://www.*****.com/MasterSlave.swf , when the master moves, the slave moves with it, but not exactly, because the slave starts falling behind. What *should* happen is that the slave should move by exactly the same x,y amount that the master moves, in the same direction that the master moves. I've tried increasing the movie frame rate, but it didn't do any good.
master.onMouseMove = function()
{
// adjust the position of the slave clip
if ( this.hitTest( _root._xmouse, _root._ymouse ) && this.dragging )
{
_root.slave._x += this._x - this.origX;
_root.slave._y += this._y - this.origY;
// reset the original X and Y values
this.origX = this._x;
this.origY = this._y;
}
}
master.onEnterFrame = function()
{
this.origX = this._x;
this.origY = this._y;
}
master.onMouseDown = function()
{
if ( this.hitTest( _root._xmouse, _root._ymouse ) )
{
this.dragging = true;
this.startDrag();
}
}
master.onMouseUp = function()
{
this.dragging = false;
stopDrag();
}
Dragging Movie Clip Snapping To Reg Point
I've made a movie clip draggable by putting a button inside it and setting 'dragging' variables to 1 or 0 depending on (press) or (release). MY problem is, this movie clip, when clicked, jumps to the mouse cursor (the reg point does anyway). Is there some sort of script to stop this happening?
I have tried making the movie clip itself draggable on a mouseDown clipEvent, but this just makes it move when the mouse is down anywhere, and this needs to be moving when the mouse is on it, not anywhere on the screen.
My email address is seriouslystressedout@hotmail.com, if you would like a copy of the .swf file to see the exact problem please email me.
I'm not sure if there's already a thread to deal with this problem, I couldn't find one and if there is, please just stick a link or something in here.
|