StopDrag When It Reaches The End Of Another MC
Ok I am having some really big problems with this. For some reason I cant get this to work for me :S. If some one can help me with it, it would be great.
This is what I tried
on (press){
if (_root.MCSmallMenu.hitTest(_root.background1, true)){
_root.MCSmallMenu.startDrag;
}else{
stopDrag();
}
Can someone tell me what I have done wrong?? I only want MCSmallMenu to drag inside background1. :S I know its only easy but for some reason my head is not working around it at all.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 05-18-2005, 12:32 PM
View Complete Forum Thread with Replies
Sponsored Links:
StopDrag When It Reaches The End Of Another MC
Ok I am having some really big problems with this. For some reason I cant get this to work for me :S. If some one can help me with it, it would be great.
This is what I tried
on (press){
if (_root.MCSmallMenu.hitTest(_root.background1, true)){
_root.MCSmallMenu.startDrag;
}else{
stopDrag();
}
Can someone tell me what I have done wrong?? I only want MCSmallMenu to drag inside background1. :S I know its only easy but for some reason my head is not working around it at all.
View Replies !
View Related
Cpu Utilization Reaches 100%
I am trying to send bitmap channel data to php script using loadvar sendand load. Before sending the data, i am collecting alpha,red,green and blue color value in a string. That is working fine. But before i set the string value to loadvar object cpu utilization reaches 100%. If m/c is idle in that point time then it working properly but if i am working on any other application then its showing a script is responsible for slowing down the flash player 9 and if u want to break the script or not?. If i click on yes then it stops , if i click on no then its sending value to php script and working fine. I want to remove that message. What is the way to do it? I have 2gb ram/pentium 4, its not a memory related problem. Actually the posted string is large and i cant make it small. Any help is appriciated. Thanks in advance.
View Replies !
View Related
Cpu Utilization Reaches 100%
I am trying to send bitmap channel data to php script using loadvar sendand load. Before sending the data, i am collecting alpha,red,green and blue color value in a string. That is working fine. But before i set the string value to loadvar object cpu utilization reaches 100%. If m/c is idle in that point time then it working properly but if i am working on any other application then its showing a script is responsible for slowing down the flash player 9 and if u want to break the script or not?. If i click on yes then it stops , if i click on no then its sending value to php script and working fine. I want to remove that message. What is the way to do it? Actually the posted string is large and i cant make it small. Any help is appriciated. Thanks in advance.
View Replies !
View Related
Stopping Movieclip When Reaches End
I'm creating a small sliding app which slides images left to right using next and previous buttons, however the clip continues to slide even if it goes off the stage. I would like it to stop when the last image of 'slider' has reached the edge of the stage. Can someone take a look at my code attached to the 'slider' in my movie? Thanks for any help!
Here's the AS attached to 'slider' (there is not instance name for it, it's just the movieclip slider):
Code:
// initialize movie to starting point
onClipEvent (load) {
_x = 0;
_y = 0;
div = 5;
}
// sliding action
onClipEvent (enterFrame) {
_x += (endX-_x)/div;
_y += (endY-_y)/div;
// previous button
_root.previous.onRelease = function() {
endX += 750;
/*endY += 0;*/
};
// next button
_root.next.onRelease = function() {
endX -= 750;
/*endY -= 0;*/
};
}
View Replies !
View Related
When External .swf Reaches Last Frame
Hi,
I posted this a couple days ago but I still can't figure out what I am doing so I thought I would try again.
I've got a mc in my main movie called "movLoad" that is already loaded with an external swf. The code below is for a nav item that tells the loaded .swf play to the end and then load a new .swf into the same movie clip. The problem is I need to wait until the first one is finished playing before doing the loadMovie for the new content. I need some way to detect when the initially loaded mc has reached its last frame and then do the loadMovie for the new content.
about_mc.onRelease = function() {
tellTarget ("movLOAD") {
gotoAndPlay("Out");
}
loadMovie("about_test.swf", "movLOAD");
};
Gratefully, someone here suggested using an "if" loop, but I'm afraid my AS skills aren't up to the task and I couldn't make it work. Any help would be appreciated very much. Thanks in advance
View Replies !
View Related
White Box Before Preloader Reaches 89%
hey all,
new here. I am trying to build an all flash site for a friend, i am pretty much done and learned tons along the way but am having one issue. I have a white box showing up before my flash preloader. The loader eventually shows up at about 89% and finishes that then the movie loads.
any ideas?
please see the site here www.drorrico.com
all help appreciated.
*update if i publish using flash 8 and not just export the movie the white box goes away and stays black until preloader reaches 89%.
*update 2: scratch that I have resolved the issue seems that the music i have for the site was linked to be exported and run right from the first frame, I have fixed this and all is well. Thanks to this forum I found that*
View Replies !
View Related
Stopping Movieclip When Reaches End
I'm creating a small sliding app which slides images left to right using next and previous buttons, however the clip continues to slide even if it goes off the stage. I would like it to stop when the last image of 'slider' has reached the edge of the stage. Can someone take a look at my code attached to the 'slider' in my movie? Thanks for any help!
Here's the AS attached to 'slider' (there is not instance name for it, it's just the movieclip slider):
Code:
// initialize movie to starting point
onClipEvent (load) {
_x = 0;
_y = 0;
div = 5;
}
// sliding action
onClipEvent (enterFrame) {
_x += (endX-_x)/div;
_y += (endY-_y)/div;
// previous button
_root.previous.onRelease = function() {
endX += 750;
/*endY += 0;*/
};
// next button
_root.next.onRelease = function() {
endX -= 750;
/*endY -= 0;*/
};
}
View Replies !
View Related
Movie Loads Before Progress Bar Reaches 100%
Hi
I've used the code below to create a progress bar.
The problem is the bar gets to about 40% when the movie loads.
Check it out on
http://www.hodes.com.hk/clients/bhg/home.htm
Thanks in advance
Sean
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("Scene 2", 30) {
gotoAndPlay ("Scene 2", 1);
}
View Replies !
View Related
Event Not Loading When Timer Reaches Value
All right, I have started taking apart the code to my sidescroller test so far. In the following fresh fla I am attempting to utilize a timer code with an action, this time using an increment of 2000 miliseconds before a "trace" event should trigger and repeat. Can someone take a look at it and help me see why the action is not occuring when the "if (_root.timedeadline == 2000)" is met? I am using Flash MX Professional 2004. Thanks.
View Replies !
View Related
Triggering LoadMovie When An MC Reaches A Certain _y Coordinate
I was wondering what the best way was to trigger a loadMovie command when an MC hits a certain _y coordinate. I've tried this:
Code:
this.createEmptyMovieClip("profileLoader",200);
profileLoader._x=-100;
profileLoader._y=-100;
trace("profileLoader created");
this.onEnterFrame = function () {
var targetY = 380;
// create a blank movieclip that will loop constantly, thus constantly checking the value of our conditional...
this.createEmptyMovieClip("holder_mc", 100);
this.holder_mc.onEnterFrame = function () {
// here i am using == to see if the _y value is exactly the same as the target, you could substitute it with greater than or less than if it only has to be above or below the target _y value...
if (_root.profileSection._y == targetY) {
loadMovie("profile.swf", this.profileLoader);
this.loadProfile()
trace("movie loaded" + targetY);
delete this.onEnterFrame
}
}
}
but for some reason it is placing it in a wierd spot. Would I be better off using a listener??
View Replies !
View Related
Item That Resizes When It Reaches Coordinate.
I'm making a horizontal image scroller, with a bunch of icons inside of movie clips, these movie clips will be moving from side to side. what I want to do is determine a parameter such as an _x coordinate and when a thumbnail reaches that point it enlarges and scales back down to a normal size once it has past the center point. I want each movie clip to do this however I do not know where to even begin.. Could anyone out there help me get in the right direction?
How do I scale an image based on its _x coordinate. In other words write a script that says, if object's _x is = to center Coordinate, enlarge.
Thanks
View Replies !
View Related
Playing A Sound When Mc Reaches A Given Position
i made a search but coudnt find any help. I want that a dragable mc plays a sound when it reaches a certain position _y>400.
Here's the code i use, but without any results:
---------------------------------
onClipEvent (mouseUp) {
        if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
                this.stopDrag(true);
        }
                if (this._y>400) {
this.gotoAndStop(som);
        }
}
---------------------------------
i have a sound at frame label "som"
Any ideas?
View Replies !
View Related
When Target Reaches Destination, Stop Playing MC
Hi.
I am currently trying to design a game in which when a position is clicked on the stage, the main MC will move to that point. But i currently have it set so that if you click above the MC, it will go and play the frame for the above movement, below the MC plays the below fame for below movement, and so on... This all works great. But my problem is:
How can I make it so that when the destination is reached, it will goto a 'stop' frame, in which I can draw the main MC just standing still and not moving?
Here's the AS used on the first frame:
Code:
man_mc.stop();
// Use tx,ty to keep track of desired location
man_mc.tx = man_mc._x;
man_mc.ty = man_mc._y;
man_mc.walkSpeed = .1;
man_mc.onMouseDown = function()
{
// dx,dy are the position of the mouse relative to the center of the man
this.tx = _root._xmouse;
this.ty = _root._ymouse;
var dx = this._xmouse;
var dy = this._ymouse;
// get the angle of the mouse
angle = Math.atan2(dy,dx);
// convert to a frame number (1-8)
frameNbr = Math.round(8+4*angle/Math.PI) % 8 + 1;
this.gotoAndStop(frameNbr);
// trace(angle + ", " + frameNbr);
}
man_mc.onEnterFrame = function()
{
this._x += (this.tx - this._x)*this.walkSpeed;
this._y += (this.ty - this._y)*this.walkSpeed;
}
I've posted the fla so u can see what I mean...
Many thanks,
Tom
PLEASE NOTE: Only the directions left and right work at the moment as I have not drawn them in yet, but I know that they will work fine as the left and right do.
View Replies !
View Related
Movie Plays Before Preloader Percentage Reaches 100%
Hi all,
I've been having a problem with my preloader. The movie plays before the percentage reaches 100%. I've been wondering, is it because that the preloader only works if you have a a clean stage? I mean only 2 layers, one layer containing the mc of the preloader on frame 1 and one layer containing the whole movie on frame 2. I have several attributes on the stage, several layers and long frames. Would that be the problem?
I've attached the screencaps. Hope you can help me
Thanks in advance.
View Replies !
View Related
[MX] Disabling Buttons Before An External .swf Reaches A Certain Frame...
Sorry, title should be "Disabling buttons until an external .swf reaches a certain frame"... (title didn't properly change when edited!)
Okay, I've got external .swf movies that display within a container called "movieholder", whenever the relevant button is pressed. These movies have got both start and end transitions. It all works well... to an extent!
Here's the problem:
Say we've got "movie1" and "movie2"...
If the start transition is running for "movie1", pressing the button for "movie2" will lock that button into it's "down state", with the original movie ("movie1") still visible.
So, I've been trying to work out a way to disable buttons temporarily whilst the start transition for an external .swf is running.
For starters, I haven't been able to get my code to read the current frame number/label of the external .swf, which I figure is a key part of this!
Put in English, what I've been trying to achieve will, I think, look something like this:
IF the current frame of external .swf doesn't equal the "midframe":
Disable my buttons
ELSE when the current frame of external .swf does equal "midframe":
Enable my buttons
Anybody know how this can be achieved?
Thanks in adance for any help!
View Replies !
View Related
How Do I Play A MC When The GetVolume Method Reaches A Certain Number?
Anyone have any tips or suggestions as to how I can play a movie clip once my volume level for my music reaches a cetain number/level?
Here's my code:
player_mc.volumeUp_btn.onRelease = function (){
if(song.getVolume() < 100) {
song.setVolume(song.getVolume() + 20);
if(song.getVolume() == 80) {
volume1_mc.gotoAndStop(2);
volume2_mc.gotoAndStop(2);
volume3_mc.gotoAndStop(2);
volume4_mc.gotoAndStop(2);
}
}
}
Anything is much appreciated!
codeJunky
View Replies !
View Related
Moving Box Back To Xpos When Reaches Certain X Coord
heya,
i just read your tutorial about making an object move from one side to another by using actionscript. so now i was wondering how to make the box get back into the same place as it started when it reaches a certain point.
can someone please help me with adding the code to this AS i already got:
Code:
onClipEvent(enterFrame) {
speed = 5;
this._x += speed;
}
thank you very much
View Replies !
View Related
Streaming Audio Restarts When It Reaches The End Of The Timeline
Hello,
the site in question is thirdcache.com - i've got streaming audio playing as background music, however after someone clicks the stop all sounds button it stops, however when the background music reaches the end of it's timeline, it starts back up again. How do i get it to stop forever? Also, how do i get this button to have two functions, off and on.. without embedding the audio, I want it to start and stop the streaming audio.
Any help in this matter would be greatly appreciated.
Thanks
View Replies !
View Related
Playing One Movie Clip Instance After Another Reaches It's Target
Hi,
Basically I have 1 movie clip called mc1, inside this movie clip contains another movie clip with an instance name of "shape" and another movie with an instance name "box. To control the x position and alpha of the instance "shape" and the xscale of "box I have the following codes on frames 1-3 inside of mc1
frame 1:
//initialize xscale, alpha, x parameters
shapeX = shape._x;
shape1X = shape._alpha;
targetX = shapeX;
target1X = shape1X;
buttonScale = box._xscale;
buttonTarget = buttonScale;
frame 2:
//apply x position equation
if (shapeX<>targetX) {
shapeX = Math.round (shapeX+(targetX-shapeX)/4);
shape._x = shapeX;
}
//apply alpha equation
if (shape1X<>target1X) {
shape1X = Math.round (shape1X+(target1X-shape1X)/15);
shape._alpha = shape1X;
}
//apply xscale equation
if (buttonScale<>buttonTarget) {
buttonScale = Math.round (buttonScale+(buttonTarget-buttonScale)/10);
box._xscale = buttonScale;
}
frame 3:
gotoAndPlay(2);
mc1 is placed on the main timeline and the code attached to mc1 is:
onClipEvent (enterFrame) {
targetX = -660;
buttonTarget = 0;
}
basically all this moves the instance "shape" from right to left and changes the xscale of the instance "box, however both animations start at the same time
I want to perform the xscale of "box" after the instance "shape" reaches its target but am unsure how to do this. Please advise.
View Replies !
View Related
Make Movie Play When Preloader Reaches Certain Percentage?
I'd like my movie to start playing at a certain percent loaded instead of loading the entire movie first.
I have a particularly large video with voiceover flash that im afraid guests will be discouraged waiting for if they see the preloader going too slowly...so i'd like the file to start playing at, say, 30% loaded instead of loading 100% of the file first.
here's the actionscript of my preloader currently..
bytes_loaded = Math.round(_root.getBytesLoaded())+1;
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
backwards = getPercent*242;
_root.loadBar._width = 242-backwards;
_root.loadText = Math.round(getPercent*100);
if (bytes_loaded >= bytes_total) {
_root.gotoAndPlay(4);
}
Thanks in advance - Jay
View Replies !
View Related
Stopdrag
Hi I have loaded a movie pan.swf and Its
movieheight = 250;
moviewidth = 450;
I have a startdrag and this works
but now I want it to STOP when its outside the movie..
can anyone help
:-) PAUK
View Replies !
View Related
STOPdrag
HI all
This movie loads an panorama
http://www.pauk.dk/pano/pan_svaneke_start.html
and the panorama-movie has an startdrag and moviesize
startDrag("", true);
movieheight = 250;
moviewidth = 450;
but since its loaded into a bigger movie I want the movie to STOPDRAG when you leave the panwindow/movie
anyone have an Idea ?
:-) PAUK
View Replies !
View Related
StopDrag?
here's the deal. i have a nav menu inside an mc. in the nav, i want something to follow the mouse. right now, i have a box that basically hovers over the nav choices. makeing an invisible button inside the nav mc, i can use startDrag on rollover to get the slider moving. unfortunately once that happens, it never leaves the mouse alone. it still stays within the bounds of the rectangle i defined (the nav mc), but i cannot get it to stop when i rollout. how can i get this? is there a better way? i know i've seen this done before, and think i've even seen a tutorial on it, but can't find it now.
View Replies !
View Related
Stopdrag
I am working in Flash MX and have a problem with a movie clip containing a navigation palette. The file is being called in by a loadmovie function and allows the palette to be draggable and acts as a smaller view for scrolling the background image around a restricted area nested within the main swf file.
The problem I am having is that although the user can move the background around alright by moving the square on the navigation palette when you go to drag the whole palette to a new location on top of the background the movie rreturns to the very begginning of the main timeline. I think it must be soething to do with the nesting of movies but can't quite work it out, here is the code I have for the navigation palette -
on (press) {
startDrag("");
}
on (release) {
stopDrag();
tellTarget ("/") {
gotoAndPlay("nodockloop");
}
}
File attached - pretty big due to jpeg
Hope this makes some sense and somebody can help me out soon.
Cheers
Jamie Newbury
View Replies !
View Related
StopDrag()
I have
code:
if(_parent._currentframe>74){
if( _parent._ymouse > 40 && _parent._ymouse < 271 && _parent._xmouse > 25 && _parent._xmouse < 260){
startDrag(_parent.arrows, true);
Mouse.hide();
}else{
_parent.arrows.stopDrag()
_parent.arrows.ease(144,75,6);
Mouse.show();
}
}
}
This is not where my problem is...
i have a scroll bar over to the right and the drag on the bar will not work if there is a drag in this code....
I dont really understand, cause I have a direct path for the stopDrag(), but it is still causeing the scroll bars drag not to work.....
That is my problem.....
HELP !
View Replies !
View Related
Help On StopDrag()
hi im trying to recreate this to learn more on flash
http://www.funny-games.biz/external/traffic-jam.html
so far here is what i have right now...
but i dont know how to make them stopDrag when there is another movie clip in front of it..
can someone help me with this??
thanks
View Replies !
View Related
StopDrag
Is there any way to make Flash more lenient on its drag stopping?
Right now I have a scroller that, while it works fine, if you keep on pressing and go off of the scroller then release, it will continue to drag. Is there anyway to make it so that when you release the mouse button ANYWHERE at all it will stop the drag?
Also, for some reason, when you release the drag on this scroller, the cursor goes in to a perpetual state of the hand icon and, if you zoom in, you can't move around the screen to change what you're zooming in on. That doesn't really matter, it's just kind of weird. Is there any way to fix that?
View Replies !
View Related
StopDrag() Question
I'm trying to build a drag and drop menu. However, it seems to me that I'm doing something wrong with stopDrag(), because well, dragging is not stopping.
I have the following in a movie clip.
onClipEvent(mouseUp) {
stopDrag();
}
For some reason, that isn't working.
Any help is greatly appreciated.
View Replies !
View Related
Startdrag & Stopdrag.
Hi.
Is it possible to f.ex. set some kind of an border around a movie, so when the user drags a "window" it's not possible to drag the "window" outside of the movie ?
It could maybe be, with the help of actions scripts.. but I can't find either the method or propertie.. for this..
Can anyone please help me ?
I'm really looking forward to hear from you.
Best regards
Raz
View Replies !
View Related
StopDrag On Mouse Out ?
I want to make a "stopDrag", when my mouse is out of reach of the movie. Every time I start drag the movie-clip, and I'm letting the mouse go up out of reach of the scene, the movie thinks the mouse is still up:
onClipEvent (mouseDown) {
startDrag("_root.mctotaal", false, 875, 558, -416, -287);
}
onClipEvent (mouseUp) {
stopDrag();
}
Then something has to follow like:
onClipEvent (mouseOut) {
stopDrag();
But this isn't possible in ActionScript
Thanks for answering,
Maaike
Netherlands
View Replies !
View Related
StartDrag + StopDrag
Im having a little porblem. I have a code to start and stop drag on different movie clips. Its all the same code, but different movie clips. The problem is when I test the movie, i can only drag one of the movie clips. And its always one specific one...I dont understand.
View Replies !
View Related
Why Won't StopDrag Work
This stop drag is not working, but if i change the line startDrag(this,true,0,0,100,0); to this.startDrag(); it works fine. What gives?
this.mcScrubber.onPress = function(){
startDrag(this,true,0,0,100,0);
this.onRelease = function(){
this.stopDrag();
trace("TEST");
}
}
View Replies !
View Related
Non-square MC For StopDrag()
I am trying to develop a drag and drop system that has dynamic 'dropzones'(moveTo() & lineTo()). These dropzones need to initate a function if the dragging object is dropped on. However, I need these dropzones to be rhombuses, not squares.
It appears that _droptarget and hitTest() use the square(x,y,height,width) of my dropzones making them bigger than they are suppose to.
Is there a mathematical way to determine whether or not the draggable object was dropped onto the rhombus hotspot?
View Replies !
View Related
StopDrag(); Problems
hello i am creating a dragable menu. I'm trying to have the top of the menu , ex. where it would say "drag here", to move six different movie links. heres the code if you can tell me whats wrong with it that would be a great help, thanks. ( by the way there is no line break after startDrag in the real action script, it does that only in the forum)
on(press)
{
startDrag("drag", "1", "2", "3", "4", "5", "6", "home", "gallery", "faqs", "contact", "about");
}
View Replies !
View Related
StopDrag Not Working..how Come?
I've got a clip that runs a drag function when a 'zoom in' button is pressed. that all works well and when the image zooms in, i can click and drag it all around. Now, when i click the 'zoom out' button, i want to turn off the drag function but i can't seem to figure out how. The function is defined in a frame on the main timeline:
Code:
function dragMe(target_mc) {
target_mc.onPress = function() {
this.startDrag(false, -60, -40, 440, 400);
};
target_mc.onRelease = function() {
this.stopDrag();
}
}
and the 'zoom in' button initiates the function:
Code:
on (release) {
_root.map_mc.scaleTo(200,0.5);
_root.dragMe(_root.map_mc);
}
So, on the 'zoom out' button, i want to cancel the drag function. So I've got:
Code:
on (release) {
_root.map_mc.scaleTo(100,0.5);
_root.map_mc.slideTo(249,264, 0.5);
_root.map_mc.stopDrag();
}
but the stopDrag(); doesn't seem to affect the movieclip. i can still drag it all around after i press the button. what am i missing?
View Replies !
View Related
Problem With StopDrag;
how can i make stopDrag command work? Where ever i add it, it won't work.Still drags it forever. Myby multiple values would help, but i don't know how to add them. Any ideas how to get this thing work?
code: this.ratio = 0;
dragger.onPress = function() {
this.startDrag(true, 0, 0, line._width, 0);
this.onEnterFrame = function() {
ratio = Math.round(this._x*100/line._width);
uus_interval = ratio*100;
};
};
dragger.onRelease = dragger.onReleaseOutside = function() {
ratio = Math.round(this._x*100/line._width);
uus_interval = ratio*100;
_root.interval = setInterval(_root.uuenda, uus_interval);
}
View Replies !
View Related
StopDrag-problem: Help
I have this mc with this drag-function. I want it to duplicate only when the mc is dropped on the mc"bordet.yta" but now it´s duplicating by just clicking on it.
what could be the problem?
-------
_root.pizza.onPress = function(){
startDrag("pizza",false,35,30,400,220);
}
_root.pizza.onRelease=function(){
this.stopDrag();
if(this._droptarget != "/bordet.ytan") {
pizza.duplicateMovieClip("pizza2",0);
setProperty("_root.pizza2",_x, 80);
setProperty("_root.pizza2",_y, 100);
setProperty("_root.pizza",_visible, false);
_root.bra++;
s = new Sound();
s.attachSound("mat");
s.start();
}
}
-----
View Replies !
View Related
HitTest & StopDrag
hi i wrote this simple code
Code:
stop();
square_mc.onEnterFrame=function(){
startDrag(this,true,32,32,268,268);
for(var i:Number = 1; i<=4; i++){
if (this.hitTest(this._root["bar"+i+"_mc"]))
stopDrag();
}
}
basically what it does is.. i have this square movie clip that is draggable.
upon hitting another movie clip in this case movie clips named bar1_mc, bar2_mc, etc. it suppose to stopDrag();
the code is working.. but no 100% of the time. There are times when it touches the very edge that the stopDrag doesnt execute. Is there an alternative in doing this?
I want the movie clip to stopDrag upon hitting the other movieclip 100% of the time. Is this a flash limitation?
thanks..
View Replies !
View Related
[F8] _rotation And StopDrag
I have a long rectangle (long horizontally) that, when clicked, rotates 90 degrees. All the code in the onRelease worked fine until i put the _rotation line in the onPress event. Now my hit test and stopdrag dont work.
Whats up with that?
My Code:
Code:
ath_pt_mc.onPress=function(){
this.startDrag();
this._rotation += 90;
}
ath_pt_mc.onRelease=function(){
stopDrag();
if(this.hitTest(ath_part_target_mc)){
this._visible = false;
bar_ath_pt_increment_mc.gotoAndPlay("c1");
}else{
this._x = 40;
this._y = 91;
}
}
Thanks!
View Replies !
View Related
StopDrag Not Stopping
Hullo. I've got a problem that's really driving me nuts. I have a slider that controls the playback through a number of frames in a movie clip, but the stopDrag function isn't stopping. The actionscript I use for the dragger is this:
on (press) {
startDrag(this, true, 35, 35, 335,35);
}
on (release) {
stopDrag();
}
The numbers constrain the movement of the dragger. If anyone's got a solution I'd be deeply indebted. You can view the flash at www.kaptivate.com/globe/bottom.html. Thanks!
Mike
View Replies !
View Related
Sound On StopDrag
what i want to do is play a sound on dropping the target and play that sounds with multiple movie clips.
example: start dragging movieclip A and play sound A when I drop it and also play sound A when I drag and drop movieclip B.
View Replies !
View Related
StopDrag Problem
Have a problem with some code, or perhaps the overall method of how I'm doing this.
I have a map loaded up with a green background that is a button. This allows me to drag the map around within a masked area of my overall map display.
It works good if you click, drag and let off, within that masked area. But if the user clicks, and drags outside of the masked area, the map stays locked to the mouse and is dragged around even after they left off, unless they move the mouse back into the masked viewable area and click it off.
how can I fix this so that it functions properly? I think the best would be to have it drop the map when you drag outside the masked viewable area....
http://wwwdev.selu.edu/test/dakota/
Code:
_root.mainMap.mainMap.drag_button.onRollOver = function () {
_root.hand_cursor._visible = true;
_root.hand_cursor.gotoAndStop(1);
Mouse.hide();
}
_root.mainMap.mainMap.drag_button.onRollOut = function () {
Mouse.show();
_root.hand_cursor._visible = false;
_root.mainMap.stopDrag();
_root.hand_cursor.gotoAndStop(1);
}
_root.mainMap.mainMap.drag_button.onPress = function () {
_root.mainMap.startDrag();
_root.hand_cursor.gotoAndStop(2);
}
_root.mainMap.mainMap.drag_button.onRelease = function () {
_root.mainMap.stopDrag();
_root.hand_cursor.gotoAndStop(1);
}
_root.mainMap.mainMap.drag_button.releaseOutside = function () {
_root.mainMap.stopDrag();
_root.hand_cursor.gotoAndStop(1);
}
_root.mainMap.mainMap.drag_button.dragOut = function () {
_root.mainMap.stopDrag();
_root.hand_cursor.gotoAndStop(1);
}
View Replies !
View Related
StopDrag Problem
Hi,
This is my simple code:
Code:
mc1.addEventListener(MouseEvent.MOUSE_DOWN,startToDrag);
mc1.addEventListener(MouseEvent.MOUSE_UP,stopDragging);
function startToDrag(e:Event):void {
mc1.startDrag();
}
function stopDragging(e:Event):void {
mc1.stopDrag();
}
If there is another movieclip (in this example called mc2) ontop the mc1 on a higher level (between the mouse and mc1) when I reslease it the stopDrag will not work. The mc1 will drag until I move it outside of mc2, then it will release.
I could place the mc1 on a higher level (above mc2) as soon as I start dragging it but I do not want to do that. I allways want the mc2 to be ontop of everything else on the highest level. But I also want to be able to drag mc1 and drop it under mc2.
Is there a way to avoid mc2 interfering with the dragging of mc1?
View Replies !
View Related
|