View Full Version : draggable windows gone crazy
sansimian
April 19th, 2005, 06:17 PM
hey guys,
i just made a draggable window for my website, its contained within a movie clip
(profile_mc) and with in that there is a button which has these actions applied to it :
on (press) {
startDrag(_root.profile);
}
on (release) {
stopDarg();
}
now it all works good, but its reall jerky and just stops even if you dont release. its a bit strange and i dunno why its doin it.
any suggestions, if some one could take a look at my fla file and see if they know whats up with it or a better way to do it that would be awesome.
http://www.shapebydesign.com/shape.fla
thanks in advance.
simon
Gumby19
April 19th, 2005, 06:43 PM
startDrag(this, false, left, top, right, bottom)
put this startdrag() on your profile box, fill in the numbers for left, top, right, and bottom to constrain where it goes.
take the startDrag() off of your _root timeline and use this onClipEvent:
onClipEvent (enterFrame) {
_root.caption._x = _root._xmouse
_root.caption._y = _root._ymouse
if (_root.x==1) {
this._alpha = 100;
} else {
this._alpha = 0;
}
}
That should do it. You can't drag 2 things at the same time, so you'd lose your profile box when you would rollover an object with a caption.
sansimian
April 21st, 2005, 10:34 AM
Awesome, thanks man, really appriciate the help, works brilliant now.
thanks alot.
startDrag(this, false, left, top, right, bottom)
put this startdrag() on your profile box, fill in the numbers for left, top, right, and bottom to constrain where it goes.
take the startDrag() off of your _root timeline and use this onClipEvent:
onClipEvent (enterFrame) {
_root.caption._x = _root._xmouse
_root.caption._y = _root._ymouse
if (_root.x==1) {
this._alpha = 100;
} else {
this._alpha = 0;
}
}
That should do it. You can't drag 2 things at the same time, so you'd lose your profile box when you would rollover an object with a caption.
sansimian
April 21st, 2005, 06:54 PM
Ok so I have a new question now, i have all my windows working perfectly, they are all in seperate movieclips, and all the movie clips are on the same layer.
I have it so that you can have more than one window open at at time, and they sort of cascade.
What I need is that if say the profile window is in front of the work window, you can click on the work window and it comes to the front of all the other windows.
Does anyone know how I can do this? I read somewhere about swap depths but im not sure if it will work with they way I have things set out.
Thanks in advance.
Simon
fasterthanlight™
April 21st, 2005, 11:22 PM
You have to use swapDepths(); I'm not sure of the exact application, but there are tutorials out there, just give a quick google search or something.
scotty
April 22nd, 2005, 02:46 AM
mc1.onPress = function(){
this.swapDepths(9999);
}
mc2.onPress = function(){
this.swapDepths(9999);
}
//etc
scotty(-:
sansimian
April 24th, 2005, 10:06 AM
Ok I got that to work, but now my windows dont drag about?
Here's a link to my fla file if you could take a look for me that would be ace.
Simon
http://www.shapebydesign.com/shape.fla
mc1.onPress = function(){
this.swapDepths(9999);
}
mc2.onPress = function(){
this.swapDepths(9999);
}
//etc
scotty(-:
sansimian
April 24th, 2005, 10:12 AM
No worries I figured it out, thanks for all the help guys.
Ok I got that to work, but now my windows dont drag about?
Here's a link to my fla file if you could take a look for me that would be ace.
Simon
http://www.shapebydesign.com/shape.fla
scotty
April 24th, 2005, 11:26 AM
welcome=)
sansimian
April 24th, 2005, 01:12 PM
one more thing, my windows all work fine, but when they are loaded up the buttons on the main page still work through the movie clip.
is there any way of stopping this, so if the movie clip is over the button on the main page, the button is inactive. this is kind of importan as my movieclip windows will contain all the content and links and stuff like that.
i think thats my final problem that needs solving. thanks guys.
welcome=)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.