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




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?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 11-02-2007, 12:53 PM


View Complete Forum Thread with Replies

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

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 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 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.

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 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

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

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!

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 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.

Dragging Objects, But They Are Stuck In A Movie Clip?
Hey guys, I don't know what I've done, but I am sort of pulling all these different elements into a project that I'm working on, and they are sort of getting all confused and mushy...

Check out the confusion at:

bathroom planner has some issues

I would like the objects on the left hand side to be dragged onto the right side of the screen (after you create the box), but they are in a movieclip scrollbox...

I'm sure that there must be some easier way, with actionscript or something like that, but I am really confused and violent-feeling...

If you want me to make the .fla available, just tell me...

-- Nate (TheArchon)

Dragging A Movie Clip With Input Field
I have a MC in the library that is like the talk boxes they use in comics to display the characters' words.

I am dynamically inserting an instance of this callout into another MC I have, to allow people to add their own little quotes and thoughts to a photo gallery I have.

The problem I am having is that when I add an event handler to the talk box movie clip:

ActionScript Code:
_root.frame.photo_frame.new_call_out.onPress = function () {
this._alpha = 50;
this.startDrag();
}

I then get the hand cursor for this movie clip and do not have access to the dynamic input field located inside the movie clip, so the user cannot add their own text to the callout.

Any ideas?

How To Play Movie Clip While Dragging Button?
I was wondering what the best way is to play a movie clip while dragging a button inside a separate movie clip.

Example: I'm creating a children's book in Flash form. Some childrens' books have movement using a pull tab on the side of the page. I have created two things for one of these pages:
A) The pull tab movie clip consisting of a button inside of it. Its code is as follows:
on (press) {
startDrag(toggleDrag2,false,596.5,118.0,666.5,118. 0);
}
on (release) {
stopDrag();
}

This way (and it works), the pull tab cannot be dragged along the y axis, and its movement along the x axis is restricted.
B) A movie clip with a symbol in it that has a motion tween, 75 frames, a stop action and key frame on each of the 75 frames.


There is exactly 75 x coordinates the pull tab can be dragged along (its instance name is toggleDrag2 and the movie clip instance name is Flying Violin).

What I'm not sure how to do is make the Flying Violin move with the pull tab. Not literally along the the x-axis, but with each increase in the x axis of the pull tab, I want the FlyingViolin to play one frame, then stop and wait for the x-axis to increase or decrease. If it decreases, the FlyingViolin movieclip moves back a frame and stops.

Here is the code I came up for the FlyingViolin movie clip:

onClipEvent(enterFrame){
var _x1 = _root.toggleDrag2._x;

if(_root.toggleDrag2._x>_x1)
_root.FlyingViolin.play();
if(_root.toggleDrag2._x<_x1)
_root.FlyingViolin.gotoAndPlay(_currentFrame-1);
}

What I wanted to do was assign a new variable the x value of the pull tab (toggleDrag2), allow the x value to increase, and when it increases any amount, the ActionScript checks to see if toggleDrag2's x value is now greater or less than it was before, and if it is, the FlyingViolin movie clip either plays or decreases a frame (_currentFrame-1).

Did I do this right?

-Galen

Dragging A Movie Clip At A 45 Degree Angle
We all know how to drag a movie clip:

my_mc.startDrag(target,[lock, left, top, right, bottom])

But does anyone know how to drag/restrict a movie clip to a 45 degree angle?

How To Play Movie Clip While Dragging Button?
I was wondering what the best way is to play a movie clip while dragging a button inside a separate movie clip.

Example: I'm creating a children's book in Flash form. Some childrens' books have movement using a pull tab on the side of the page. I have created two things for one of these pages:
A) The pull tab movie clip consisting of a button inside of it. Its code is as follows:
on (press) {
startDrag(toggleDrag2,false,596.5,118.0,666.5,118. 0);
}
on (release) {
stopDrag();
}

This way (and it works), the pull tab cannot be dragged along the y axis, and its movement along the x axis is restricted.
B) A movie clip with a symbol in it that has a motion tween, 75 frames, a stop action and key frame on each of the 75 frames.


There is exactly 75 x coordinates the pull tab can be dragged along (its instance name is toggleDrag2 and the movie clip instance name is Flying Violin).

What I'm not sure how to do is make the Flying Violin move with the pull tab. Not literally along the the x-axis, but with each increase in the x axis of the pull tab, I want the FlyingViolin to play one frame, then stop and wait for the x-axis to increase or decrease. If it decreases, the FlyingViolin movieclip moves back a frame and stops.

Here is the code I came up for the FlyingViolin movie clip:

onClipEvent(enterFrame){
var _x1 = _root.toggleDrag2._x;

if(_root.toggleDrag2._x>_x1)
_root.FlyingViolin.play();
if(_root.toggleDrag2._x<_x1)
_root.FlyingViolin.gotoAndPlay(_currentFrame-1);
}

What I wanted to do was assign a new variable the x value of the pull tab (toggleDrag2), allow the x value to increase, and when it increases any amount, the ActionScript checks to see if toggleDrag2's x value is now greater or less than it was before, and if it is, the FlyingViolin movie clip either plays or decreases a frame (_currentFrame-1).

Did I do this right?

-Galen

Dragging A Movie Clip At A 45 Degree Angle
We all know how to drag a movie clip:

my_mc.startDrag(target,[lock, left, top, right, bottom])

But does anyone know how to drag/restrict a movie clip to a 45 degree angle?

Dragging Movie Clip With Easing Tween
Any assistance in this would be fantastic!

I've been going through the motions of trying to figure out the script involved in producing a draggable movie clip that eases out gradually once the mouse has been 'released'...

see example here -
http://www.graphictherapy.com/index2.html

i've tried using startDrag, onClipEvent etc etc with mx tween transitions but as i'm more of a designer than techy I must be getting things mixed up as i can't seem to get it right.

pleeeeease help me figure this one out!

many thanks
:)

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?

Scripting Is Supposed Flash Movie Much Cleaner
Scripting is supposed flash movie much cleaner, there should be a straight forward way to do this.

the example we can call "test.swf"

the movie clip we will call "fade" which resides inside the library

"fade" extends over 50 frames the first 30 have a snazzy animation upon a mouse click on a button in the main menu.
I would like to use this movie clip again just starting at frame 30. My question is can you reference a frame label inside the "fade" clip from the "test.swf?"

Note tell target is usefull by adding a ../ script you can exit a movie clip. Can you preform this code to enter in a clip?

Much thanks

aspiring asssstronaught

Dragging A LoadMovie Clip Attached To An Existing Clip
Hello guys,

I need to have my startDrag action grab a movie clip on one layer, and also move another clip that's above some other content along with it. It seems to work using attachMovie, but it sticks to the lower layer and won't appear above the other object no matter what level I set.

So I thought I could have the second MC in a different SWF, loadMovie it, then attachMovie it to the dragged MC, and the new clip would move along with the initial clip, only above the content on the stage.

Basically, it's not dragging. It loads OK but refuses to move with the other object.

Details:

the object that needs to be attached is called "circleout" in a file called "circleout.swf" and has Linkage Identifier set to "circleout1".

Frame 1 of the test movie has the following actions:
loadMovie("circleout.swf", "_level200");

Frame 2 has the following:
stop();
circlein.attachMovie("circleout1", "circleout2", 200);

a button on the stage in frame 2 has the following:
on (rollOver) {
circlein.startDrag(true);
gotoandStop(3);
}
(where "circlein" is a MC already on the timeline, the underneath clip)

Frame 3 has a stop action, and is the frame you stay on while moving these objects around the stage.

On frame 3, there are area buttons to stop the drag when you leave a certain area:
on (rollOver) {
circlein.stopDrag();
gotoandPlay(1);
}

pretty straightforward but the attached movie just won't drag.

See the test here: http://www.thinklabsmedical.com/circletest.html


PLEASE HELP ASAP, just let me know where my syntax is wrong to get this thing to drag.

THANKS YALL

Dustin Resch

Help...dragging A Clip With Inside A Clip
Ok, I have to make it a calliper. Well I got my slider to work from left to right.


Code:
cursor._visible = false;
cursor.playani = "zoomin";
cursor.onEnterFrame = function ()
{
if (this._parent._xmouse > 25 && this._parent._xmouse < 205 && this._parent._ymouse > 16 && this._parent._ymouse < 196)
{
Mouse.hide();
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
if (!this._visible)
{
trace(this.playani);
this.gotoAndPlay(this.playani);
} // end if
this._visible = true;
}
else
{
Mouse.show();
this._visible = false;
} // end if
};
function zoomin(obj, menu)
{
delete this["onRelease"];
delete this["onReleaseOutside"];
delete this["onPress"];
delete this["onEnterFrame"];
this._parent.cursor.gotoAndPlay("zoomout");
this.nextscale = 100;
this.finalx = 115 - this._xmouse;
trace(this.finalx);
if (this.finalx < 5)
{
this.finalx = 5;
}
else if (this.finalx > 225)
{
this.finalx = 225;
} // end if
this.finaly = 106 - this._ymouse;
if (this.finaly < -4)
{
this.finaly = -4;
}
else if (this.finaly > 216)
{
this.finaly = 216;
} // end if
trace(this.finalx);
this.onEnterFrame = function ()
{
this._x = this._x + (this.finalx - this._x) * 0.200000;
this._y = this._y + (this.finaly - this._y) * 0.200000;
if (this._xscale >= this.nextscale)
{
if (Math.abs(this.finalx - this._x) < 0.500000 && Math.abs(this.finaly - this._y) < 0.500000)
{
this._x = this.finalx;
this._y = this.finaly;
zoomin.enabled = false;
this.onRelease = this.onReleaseOutside = this._parent.release3d;
this.onPress = this._parent.press3d;
this.onRelease = this.onReleaseOutside = this._parent.release3d;
this._parent.cursor.playani = "dragin";
this._parent.cursor.gotoAndPlay("dragin");
delete this["onEnterFrame"];
} // end if
}
else
{
this._xscale = Math.ceil(this._xscale + 5);
this._yscale = Math.ceil(this._yscale + 5);
} // end if
};
} // End of the function
function zoomout(obj, menu)
{
delete this["onEnterFrame"];
delete this["onRelease"];
delete this["onReleaseOutside"];
delete this["onPress"];
this.nextscale = 45;
this.finalx = 115;
this.finaly = 106;
this.onEnterFrame = function ()
{
this._x = this._x + (this.finalx - this._x) * 0.200000;
this._y = this._y + (this.finaly - this._y) * 0.200000;
if (this._xscale <= this.nextscale)
{
if (Math.abs(this.finalx - this._x) < 0.500000 && Math.abs(this.finaly - this._y) < 0.500000)
{
this._x = this.finalx;
this._y = this.finaly;
zoomout.enabled = false;
delete this["onRelease"];
delete this["onReleaseOutside"];
delete this["onPress"];
this._parent.cursor.playani = "zoomin";
this.onPress = this._parent.zoomin;
delete this["onEnterFrame"];
} // end if
}
else
{
this._xscale = Math.ceil(this._xscale - 5);
this._yscale = Math.ceil(this._yscale - 5);
} // end if
};
} // End of the function
function zoomout2(obj)
{
delete obj["onEnterFrame"];
delete obj["onRelease"];
delete obj["onReleaseOutside"];
delete obj["onPress"];
obj.nextscale = 45;
obj.finalx = 115;
obj.finaly = 106;
obj.onEnterFrame = function ()
{
this._x = this._x + (this.finalx - this._x) * 0.200000;
this._y = this._y + (this.finaly - this._y) * 0.200000;
if (this._xscale <= this.nextscale)
{
if (Math.abs(this.finalx - this._x) < 0.500000 && Math.abs(this.finaly - this._y) < 0.500000)
{
this._x = this.finalx;
this._y = this.finaly;
zoomout.enabled = false;
delete this["onRelease"];
delete this["onReleaseOutside"];
delete this["onPress"];
this.onPress = this._parent.zoomin;
this._parent.cursor.playani = "zoomin";
this._parent.cursor.gotoAndPlay(this._parent.cursor.playani);
delete this["onEnterFrame"];
} // end if
}
else
{
this._xscale = Math.ceil(this._xscale - 5);
this._yscale = Math.ceil(this._yscale - 5);
} // end if
};
} // End of the function
function press3d()
{
this._parent.cursor.gotoAndPlay("dragout");
this.lastClick = getTimer();
if (this._xscale == 100)
{
this.startDrag(0, 0, -16, 230, 224);
} // end if
} // End of the function
function release3d()
{
stopDrag();
if (Number(getTimer() - this.lastClick) < 200)
{
this._parent.cursor.playani = "zoomin";
this._parent.zoomout2(this);
}
else
{
this._parent.cursor.gotoAndPlay(this._parent.cursor.playani);
} // end if
} // End of the function
_level10._root.contents.allblock.gotoAndStop(1);
draggerMc.lilboton.onPress = function ()
{
// BELOW THIS LINE IS WHERE YOU POSITION THE SLIDER

offset = 0;
this._parent.startDrag(0, 56, 202, 1000, 202);
this._parent.onEnterFrame = function ()
{
currentPos = this._parent.followerMc._x - 55;
currentPos = this._x - 55;
m3dFrame = Math.floor(1 + currentPos * 29 / 108);
this._parent.m3d.gotoAndStop(m3dFrame);
trace(m3dFrame);
};
};
draggerMc.boton.onRelease = draggerMc.boton.onReleaseOutside = function ()
{
stopDrag();
delete this._parent["onEnterFrame"];
};
m3d.onPress = zoomin;
stop();
So I copied all my frames, then put it into a new movie clip. that has this code on it.


Code:
on(press){
x = this._x;
y = this._y;
startDrag(this);
}
on(release, releaseOutside){
stopDrag();
if(this.hitTest(_parent.target)){
this._x = 80;
this._y = 105;
_root.tester.gotoAndStop("ok");
}else{
this._x = x;
this._y = y;
}
}
The problem I got is that it my slider does not work within a drag clip. How do I get my slider script to work within?

Dragging A Clip At An Angle
HI I need help on how to drag a scroller/movieclip along a set path. This pathline will be at an angle rather than simply vertical or horizontal. Can i do this through either maths code or by somehow accessing properties of the line it is 'attached' to?
Thanks

Duplicating A Clip, Then Dragging
hello all,

ok i've been reading a few tutorials on duplicating clips, (and maybe i missed this ^_- )

but is there a way u can have a button that u click and it inserts a movie clip that you can then drag and drop about...

and then be able to press that button again, to make another copy of that same movie clip and be able to move them both about independently

hope that makes sense

I think i've done this before but can't remember how it was done, so if anyone could help it would be great

Clip Position When Dragging
Hey. I've got clip dragging under control but I was hoping someone could shed some light on how to stop a movie clip jumping so that it's X/Y value, '0/0' aligns wih the cursor's coordinates when the clip is moved? If the hit area of the button symbol is large, there's a very noticeable and ugly jump.

Cheers for any advice.

RYSO

Dragging Clip With Button Inside
My goal is to create a control panel that can be dragged and dropped anywhere. The controls would include Home, Previous, Play, Next and Pause. I created the buttons, created the draggable controller and pulled the buttons into the controller (see: Tutorial).

The controller drags fine. The problem is that the buttons don't seem to affect anything outside of the controller clip. If I have a bouncing ball on a layer, and pull in the controller on a second layer, pushing the pause button within the draggable controller will not pause the bouncing ball. However pushing pause when the button is outside the controller pauses the ball.

Does that make sense? Can anyone help?

Dectect If Mouse Is Over A Clip - Even If Dragging Another MC?
So i have a big grid made up of MC's:

grid
row1 -> sqr1, sqr2, sqr3...
row2 -> sqr1, sqr2, sqr3...
...

I wanted to know if you can add an event to the grid sqr that will detect if the mouse is over it.

The catch is I will dragging another MC around on top of this grid. The regular mouse events do not fire in this case.

With AS 2 I'd probably try - this.hitTest(_root._xmouse,_root._ymouse)

Anyone have an idea of how to do this?

Thanks!

[FMX] Dragging And Dropping A Duplicate Clip
Hi, I'm creating a drag and drop movieclip to colour a different movieclip. I need to duplicate the first instance so as the original stays in the same place (on the pallette), and then the dragged one can be removed after it has been dropped into the area. This is the script for the dragging and dropping of the original instance, but I can't figure out the duplication/removal part:

on (press) {
startDrag("_root.pallette1");
this._alpha = 70;
}
on (release) {
stopDrag();
if (eval(_root.pallette1._droptarget) == _root.one) {
var colorful = new Color("_root.one");
colorful.setRGB(0x0066CC);
}
}

Can anyone help, please?
Cheers

Resetting The _X - _Y Position Of A Movei Clip After Dragging
i have a second navigation system that pops out of the fist nav and is draggable.

this second nav can be closed down - and when it does it playes the movie clip backwards as if oozing back into the image on the first nav.

if the movie clip is dragged into a different position - the movie clip oozes back into 'thin air' thus i need to animate this movie clip back into position before playing the movie clip back into the first nav.

any clues??????

[F8] Dragging Clip Loses Rollover Functionality
I have a movie clip of a world map image, with rollover buttons on a layer above the map within the clip. I dragged the map movie clip to the stage and assigned some dragging action to the clip:
on (press) {
startDrag(getProperty(_x, _y));
}
on (release) {
stopDrag();
}

After doing so, the map and rollover buttons drag fine, but the buttons lose their rollover action ability - they seem to be "blocked" by the drag function. When I rollover the button the cursor changes from an arrow pointer to a hand, but the rollover action (color change) doesn't occur. If I assign the drag to just the map layer, the map drags but the rollover buttons don't (obviously.)

Is there a way to drag the map movie clip and retain the rollover functionality within the map movie?

Thanks!

Mouse 'Drag' Event (not Dragging A Clip)
I was wondering if anyone knows a way of simulating a mouse event that is triggered when:

The mouse button is down, AND it rolls over a clip. Like a rollOver with the button down.

Kind of like in a drawing program where you hold the button down and move to draw.

I have tampered with this for a while with no luck...

Any Ideas?

Cleaner
Hi
Just wondering if anyone uses Cleaner EZ which comes with Premier etc to compress their video files into Quicktime?
Im stuck on selecting the right settings...I need the video to be fairly small but it ALWAYS ends up being too blurred...
Thanks!

Can This Be Cleaner?
this is a movieclip that can move threw a maze of objects. if the user hits an object the movieclip jumps to frame that shows it crashing. Everything works. my question is.. can the code be cleaner or wrapped up in a function?

onClipEvent (enterFrame) {
if (Key.isDown(37)&& hitTest(_level0.wall)==false) {
_x=_x-4;
}
if (Key.isDown(38)&& hitTest(_level0.wall)==false) {
_y=_y-4;
}
if (Key.isDown(39)&& hitTest(_level0.wall)==false) {
_x=_x+4;
}
if (Key.isDown(40)&& hitTest(_level0.wall)==false) {
_y=_y+4;
}
if (hitTest(_level0.wall)==true) {
this.gotoAndPlay("hit");

}
if (hitTest(_level0.wall2)==true) {
this.gotoAndPlay("hit");

}
if (hitTest(_level0.wall3)==true) {
this.gotoAndPlay("hit");

}
}

[F8] Is There A Cleaner Way To Do This?
This code works just fine for restricting the area I can draw in, but it seems very inefficient. Is there a better way?


Code:
onMouseMove = function () {
if (_xmouse>32 && _ymouse>32 && _xmouse<607 && _ymouse<397) {
drawingArea.lineTo(_xmouse, _ymouse);
}
};
My movie actually uses close to 100% CPU after scribbling a lot, and I think it might be this code thats doing it.

AS2 - URL Cleaner
Hello, this is a great tool that i use to filter path to test locally.

the function:

function cleanVBLE(vble)
{
a = new String(vble);
b = a.split("/");
return b.pop();
}

the usage:
trace(cleanVBLE("/formas/80094/canalune.swf"));

Cleaner Animation
I am trying to make a movie which will play fullscreen with a small area with 20% opacity visible in the center. Now my character (any image) will erase the black background so that a clear picture becomes visible.
Pls. help. urgent

Cleaner Code
I have a code that consolidates current moneys into the least amount of tokens possible. It works but the actual code is extremely bulky, i was wondering if anyone has a tip or sees something that can be removed/replaced for less code

Thanks
code: C_Amount = _root.betTotal;
if(C_Amount < 25)
{
NumLeft = C_Amount % 10;
if(NumLeft < 5)
{
dollar_1 = NumLeft;
dollar_10 = (C_Amount - NumLeft) / 10;
}else{
NumLeft1 = NumLeft % 5;
dollar_1 = NumLeft1;
dollar_5 = (NumLeft - NumLeft1) / 5;
dollar_10 = (C_Amount - NumLeft) / 10;
}
}

[CS3] Cleaner Code
Hi,

Is there an easier, cleaner way to write:

type = _root.page;

if (_root.pageOn == 1)
{
if (type == 'ftp')
{
_root.content.ftp.filters = [myBlurFilter];
_root.content.ftp._alpha = 50;
}
if (type == 'news')
{
_root.content.news.filters = [myBlurFilter];
_root.content.news._alpha = 50;
}
if (type == 'hello')
{
_root.content.hello.filters = [myBlurFilter];
_root.content.hello._alpha = 50;
}
if (type == 'contact')
{
_root.content.contact.filters = [myBlurFilter];
_root.content.contact._alpha = 50;
}
if (type == 'exhibitions')
{
_root.content.exhibitions.filters = [myBlurFilter];
_root.content.exhibitions._alpha = 50;
}
if (type == 'interiors')
{
_root.content.interiors.filters = [myBlurFilter];
_root.content.interiors._alpha = 50;
}
if (type == 'conferences')
{
_root.content.conferences.filters = [myBlurFilter];
_root.content.conferences._alpha = 50;
}
if (type == 'live_events')
{
_root.content.live_events.filters = [myBlurFilter];
_root.content.live_events._alpha = 50;
}
if (type == 'new_media')
{
_root.content.new_media.filters = [myBlurFilter];
_root.content.new_media._alpha = 50;
}
if (type == 'people')
{
_root.content.people.filters = [myBlurFilter];
_root.content.people._alpha = 50;
}
if (type == 'clients')
{
_root.content.clients.filters = [myBlurFilter];
_root.content.clients._alpha = 50;
}
}

Cleaner Code
Hi all, I'm currently working on creating a simulated training flash-based presentation and I'm looking to improve my coding habits.
Part of the simulation was to create a custom cursor that functions just as any data entry cursor would. Here's where I need to improve:
The user is restricted to only entering uppercase glyphs at this point, so the cursor should only respond if a letter character is pressed. All other characters should be ignored. I've figured a method to do this, and it works just fine, but the code is very repetitive and long. I'm guessing that there is a better way to do this by referencing a list of key codes in the conditional statement, but I'm not sure how to go about it. Here's what the code looks like
Thanks

Code:
onClipEvent(keyDown) {
//ignore tab
if (key.isDown(9)) {
this._x = this._x;
} else if (key.isDown(12)) {
this._x = this._x;
} else if (key.isDown(13)) {
this._x = this._x;
} else if (key.isDown(16)) {
this._x = this._x;
} else if (key.isDown(17)) {
this._x = this._x;
} else if (key.isDown(112)) {
this._x = this._x;
} else if (key.isDown(113)) {
this._x = this._x;
} else if (key.isDown(114)) {
this._x = this._x;
} else if (key.isDown(115)) {
this._x = this._x;
} else if (key.isDown(116)) {
this._x = this._x;
} else if (key.isDown(117)) {
this._x = this._x;
} else if (key.isDown(118)) {
this._x = this._x;
} else if (key.isDown(119)) {
this._x = this._x;
} else if (key.isDown(120)) {
this._x = this._x;
} else if (key.isDown(121)) {
this._x = this._x;
} else if (key.isDown(122)) {
this._x = this._x;
} else if (key.isDown(123)) {
this._x = this._x;
} else if (key.isDown(124)) {
this._x = this._x;
} else if (key.isDown(48)) {
this._x = this._x;
} else if (key.isDown(49)) {
this._x = this._x;
} else if (key.isDown(50)) {
this._x = this._x;
} else if (key.isDown(51)) {
this._x = this._x;
} else if (key.isDown(52)) {
this._x = this._x;
} else if (key.isDown(53)) {
this._x = this._x;
} else if (key.isDown(54)) {
this._x = this._x;
} else if (key.isDown(55)) {
this._x = this._x;
} else if (key.isDown(56)) {
this._x = this._x;
} else if (key.isDown(57)) {
this._x = this._x;
} else if (key.isDown(186)) {
this._x = this._x;
} else if (key.isDown(187)) {
this._x = this._x;
} else if (key.isDown(188)) {
this._x = this._x;
} else if (key.isDown(189)) {
this._x = this._x;
} else if (key.isDown(190)) {
this._x = this._x;
} else if (key.isDown(191)) {
this._x = this._x;
} else if (key.isDown(192)) {
this._x = this._x;
} else if (key.isDown(219)) {
this._x = this._x;
} else if (key.isDown(220)) {
this._x = this._x;
} else if (key.isDown(221)) {
this._x = this._x;
} else if (key.isDown(222)) {
this._x = this._x;
} else if (key.isDown(32)) {
this._x = this._x;
} else if (key.isDown(37)) {
this._x = this._x;
} else if (key.isDown(38)) {
this._x = this._x;
} else if (key.isDown(39)) {
this._x = this._x;
} else if (key.isDown(40)) {
this._x = this._x;
} else if (key.isDown(20)) {
this._x = this._x;
} else if (key.isDown(106)) {
this._x = this._x;
} else if (key.isDown(107)) {
this._x = this._x;
//don't move left of original position
} else if (key.isDown(8)) {
if (this._x > 104) {
this._x -= 10;
}
//don't move right of new position
} else if (this._x < 112) {
this._x += 10;
}
}

If/Else - Is There A Cleaner Code?
Hello all,

I am currently working on a flash file and I'm an intermediate user. My actionscript abilities are probably close to beginner, but I'm a quick learner (most of what I have learned with actionscript has been self taught).

In my flash file I have an animation of a rotating globe. Each frame of the rotation is a separate raster image - I don't know how you would represent a rotating globe otherwise, not really something that can be tweened (suggestions are welcome).

I have different locations off to the side of the globe. When the user mouses over a location, the globe spins to that location. When they roll out, the globe spins back to a static starting point.

I wanted the animation of the globe to be as smooth as possible, so, I have a }else{ statement for every possible frame. IE - if the globe animation is rotating back from a position and the user mouses over a new location before the animation stops, it doesn't jump back to the starting static position, it seemlessly flows from the position it is currently at to the new position the user has moused over.

Make sense?

It works flawlessly as is. I've spent quite a bit of time testing it. However, the code is bulky in appearance and according to the size report bulky in bytes as well.

Is there a differnent way to set this up to cut down on size - mainly byte size if possible?

I will include a bit of code so you can see what I'm talking about:

on (rollOver) {
if (_root.EarthClip._currentframe == 1) {
_root.EarthClip.gotoAndPlay(140);
} else { if (_root.EarthClip._currentframe == 160) {
_root.EarthClip.gotoAndPlay(156);
} else { if (_root.EarthClip._currentframe == 161) {
_root.EarthClip.gotoAndPlay(155);
} else { if (_root.EarthClip._currentframe == 161) {
_root.EarthClip.gotoAndPlay(154);
} else { if (_root.EarthClip._currentframe == 163) {
_root.EarthClip.gotoAndPlay(153);

and so on, and so on . . .


Any help would be greatly appreciated.

Thank you in advance.

-MShetler

Cleaner Scripting
I think the code says it all. For a current project I need to use a hit area to start an animation when a mouse rolls over a _mc.

If I use the movie clip instead of a button I can simplify the script by using the first section of the attached code. In the simplified code I only have to define one over and one out state and then I can use a this statement to control the action.
For any number of _mc's I just need one set of functions.

Using buttons, each _mc needs it's own over and out definition and it's own unique set of functions.

I've tried using a bunch of if (grnMC_button.onRollOver = true) {this statements apply only to grn_mc} (not really code) but I can't find anything that works. It would be a great time saver if I could because in the final project I've got about 75 movie clips to control with over functions.

One more thing. I can't use the movie based code because the animations move out from under the buttons and the mouse over area gets big and overlaps the other "buttons". I guess I'm really looking for a way to define a hit area and still keep the code simple.









Attach Code

Movie driven _mc sample code:
˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
// over-out definitions
grn_mc.onRollOver = over;
grn_mc.onRollOut = out;

blu_mc.onRollOver = over;
blu_mc.onRollOut = out;

red_mc.onRollOver = over;
red_mc.onRollOut = out;

// onRollOver functions
function over () {
this.overThis = true;
this.gotoAndPlay("start");
}

// onRollOut functions
function out () {
this.overThis = false;

Button driven _mc sample code:
˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜
// button definitions
grn_btn.onRollOver = over_grn;
grn_btn.onRollOut = out_grn;

blu_btn.onRollOver = over_blu;
blu_btn.onRollOut = out_blu;

red_btn.onRollOver = over_red;
red_btn.onRollOut = out_red;

// onRollOver functions
function over_grn () {
grn_mc.overThis = true;
grn_mc.gotoAndPlay("start");
}

function over_blu () {
blu_mc.overThis = true;
blu_mc.gotoAndPlay("start");
}

function over_red () {
red_mc.overThis = true;
red_mc.gotoAndPlay("start");
}

// onRollOut functions
function out_grn () {
grn_mc.overThis = false;
}

function out_blu () {
blu_mc.overThis = false;
}

function out_red () {
red_mc.overThis = false;
}

























Edited: 05/16/2007 at 11:25:53 AM by Rick Gerard

Cleaner, Crisper Text
can anyone explain how to get cleaner, crisper text in FlashMX. Thank you.

LoriSchlitz

Cleaner 6 Or Sorenson Squeeze?
hi
I have cleaner 6, but a friend says sorenson squeeze it a better compressor for use of video in flash. Shoul i get a copy? or will cleaner suffice??

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