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




Draggable Clips



Hello. I have a matching game with some drag and drop clips. When all the mc's are matched up correctly, the movie goes to the next frame where there is a play again button. When this button is clicked the movie returns to the first frame. The actionsript on this button sets up the properties so that the movie clips return to their origingal positions. The problem is that the clips are no longer draggable. And ideas how to fix this? Thanks.
Here is the code from one of the clips.

onClipEvent (load) {
white_x = getProperty(this, _x);
white_y = getProperty(this, _y);
}
onClipEvent (enterFrame) {
this.onRelease = function() {
_root.tries++;
if (hitTest(_root.answer2)) {
_root.answer2;
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);

this._x = _parent.answer2._x;
this._y = _parent.answer2._y;


_root.s_check._visible = true;
_root.score++;
this.enabled = false;
} else {
setProperty(this, _x, white_x);
setProperty(this, _y, white_y);
}

};
}
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();}



FlashKit > Flash Help > Flash General Help
Posted on: 04-11-2005, 09:35 AM


View Complete Forum Thread with Replies

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

Draggable Movie Clips
hi, i just need the basic actionscript to drag a movie clip around the screen.

i looked in the tutorials but none seem to describe it right.

thanks in advance

Draggable Movie Clips
I have a movie clip called "rec_mc"
on the stage.

I also have this select box that has a changehandler for loading images into "rec_mc" using loadmovie.

Im aware that loadmovie replaces the original movie, but should'nt it keep the instance name.

My problem is I want to be able to drag the movieclip after i load the images.

function select_item() {
oVal = combo_mc.getSelectedItem().data;
loadMovie("drawing_images/"+oVal+".jpg",rec_mc);


}

rec_mc.onPress = function(){
this.startDrag();
}

rec_mc.onRelease = function(){
this.stopDrag();
}

Draggable Clips-numbers
Ok hi again. Now, it is like this.
I have a draggable movieclip that I wish to use in some sort of game-thing.

However, I would need a box on top of the draggable clip where you would be able to write numbers. (This msut follow the clip when it is dragged)
Is this possible and if so, hos to make is?

Draggable Movie Clips
hey there, is it possible to make a draggable text box that can later have input text entered into it. You can't enter type in the box when the movie clip it resides in becomes draggable.

I've pinned the ._x and ._y values of the text box to a draggable move clip so it sort of "follows" it when it's released, but it doesn't look very nice at all.

Surely there is some other way? Any ideas are most welcome..

Draggable Movie Clips...
Hi! I followed the Draggable Menu Tutorial to try and scroll a movie clip -- i SORTA altered it to follow the y position instead of x and im seeming to have run into some trouble here. Below is my .fla so far, does anyone possibly mind checking it out to see what im doing wrong?

Here it is

Thanks very much in advance!

Jen

Draggable Movie Clips?
How do I create a draggable movie clip? I need to drag it from one pt and place it on another.

Multiple Draggable Movie Clips
Help! I have 5 different movie clips that i have being able to be dragged around. I hvae a huge problem tho, and that is when i try dragging any of the other 4 movie clips, the 1st movie clip always gets dragged ....whyy?????

Constraining Draggable Movie Clips
hi

I want to Constrain a draggable movie clip, along the x axis. It follows the mouse, but then goes straight through a wall, does aanyone know he litttle bit of code, which, wil stop the movieclip even when the mouse still moves past that point.

Thanks
Pedros

Making Movie Clips Draggable
Ok im using flash 5 and know that only movieclips are technically draggable. WHat Im having trouble with is that even if I have the draggable action script for each different movie in, everytime I click on a new clip to drag it the very first clip I made draggable takes the focus it seems and none of the others can be dragged. Can someone help me out with this please. Below is the code Im using:

onClipEvent (mouseDown) {
startDrag ("", true);
}
onClipEvent (mouseUp) {
stopDrag ();
}

If anyone could help me out in some way to make it that what ever clip is clicked and mouse button held down becomes the clip that is draggable it would be greatly appreciated.

Multiple Draggable Movie Clips
Is it possible to have multiple draggable movie clips in a single movie?

Stopping Movie Clips Being Draggable
Hi everyone,

Im having trouble stopping a movie clip being draggable.

I have the following code...


Code:
on (release) {
stopDrag();
if (this._droptarget == "/43") {
_root.answer1 = "Correct";
_root.mySound.start();
_root.score++;
} else {
_root.answer1 = "wrong";
}
Its supposed to check weather the mc has been dropped in the correct place. If it has then I dont want the user to be able to move it again.

It wont work! Any advice would be great.

Thanks

Importing XML Into Draggable Movie Clips?
Hello all,

I am using Flash to read an XML file and display it in a text area. However, I want some of the text to be imported as draggable movie clips. So, when a reader reads the text, they can select certain segments of the text and drag it to another part of the screen. For example, a doctor reads about a patient and makes an initial diagnosis. After they make the diagnosis, they have to choose text and phrases about the narration and drag it to a quiz area to support the diagnosis they came up with.

Is this possible? I know it probably requires a ton of coding, which I am more than willing to research, but so far I have not been able to come up with many answers. If someone could start me out on the right foot I would greatly appreciate it. Thank you all for your valuable time and help.

-Chaz

Draggable Duplicated Movie Clips
Hello, I'm creating an application with Flash and I could really use some help. The application is for floorplan furnishing. There is a floorplan and you drag and drop furniture on the floorplan.

I would like to allow the user to generate as many MCs as they'd like of whatever furniture pieces they want and rotate them.

Thanks!

Draggable Duplicated Movie Clips
Hello, I'm creating an application with Flash and I could really use some help. The application is for floorplan furnishing. There is a floorplan and you drag and drop furniture on the floorplan.

I would like to allow the user to generate as many MCs as they'd like of whatever furniture pieces they want and rotate them.

Thanks!

How To Prevent Overlapping Draggable Clips
I wonder if there is a reliable way to prevent draggable movies clips specially if those were instances that generated and named dynamically on the run....

the idea is to have them draggable but not allowed to overlap overn one another just like the optional (prevent overlap) way with layers in Dreamweaver ...

thank u in advance

Draggable Movie Clips That Trigger Events
Please help!

If I have multiple draggable movie clips and I want to be able to drag them into a designated area and have different events happen depending on which movie clip I drag into that area, how can this be accomlished?

Any insight would be greatly appreciated. Thanks!

Setting Depth Of Multiple Draggable Clips - MX
I have a flash movie with several draggable movieclips. I would like to add a 'bring to front' button to each of them. I am having trouble using swapdepth as they do not share the same parent movieclip. Any ideas?

I an using MX

Draw A Line Between 2 Draggable Movie Clips
Hi, i'm trying to draw a line between 1 stationary and 1 draggable movie clip. i've got it working but when i drag the movie clip awy from the other the line scales to far and comes out the other side. Any ideas how I can stop this from happening so that it only scales out to where the mouse is hovering over the movie clip.

I've posted my code if thats ok


Code:
//positions line on the stage
this.line_mc.onEnterFrame = function () {
line_mc._x = drag2_mc._x ;
line_mc._y = drag2_mc._y ;
line_mc._xscale = drag1_mc._x-line_mc._x ;
line_mc._yscale = drag1_mc._y-line_mc._y ;
updateAfterEvent();
}
//Starts draggble movie clip
this.drag1_mc.onPress = function () {
startDrag(this);
}
//Stops draggable movie clip
this.drag1_mc.onRelease = function () {
stopDrag();
}



As you can see there are 3 movie clips
line_mc is the line
drag2_mc is the stationary clip
drag1_mc is the moveable one


A second problem is that I can only have the line set as hairline because as it scales it gets fatter. I originally tried to draw the line with actionscript using 'LineTo' and 'MoveTo' . I caould draw the line fine if I used x and y co-ords such as 200, 400 etc but could not assign it the co-ords of the 2 movieclips.. is this possible

Andy

Arrays And Duplicating Draggable Movie Clips
Hi,

I'm using this code for a "furniture placement tool" and was having some trouble figuring out the correct syntax for doing an array of multiple draggable objects.

Here is my code so far. The pieces of furniture are their own movie clips, all contained within a movie clip "furn":

ActionScript Code:
i = 0;
 _parent.furn.SOFA.onPress = function() {
 duplicateMovieClip("SOFA", "SOFA"+i, i);

 _parent.furn["SOFA"+i].startDrag();
 _parent.furn["SOFA"+i].onPress = function() {
 this.startDrag();
 if (Key.isDown(Key.SPACE)) {
 this._rotation = this._rotation+45;
 }
 };
 _parent.furn["SOFA"+i].onRelease = function() {
 this.stopDrag();
 };
 i++;
 };
 _parent.furn.SOFA.onReleaseOutside = function() {
 this.stopDrag();
 };

To add an array, I was planning to add this function around the above code, but am not sure how to integrate the array item reference (replacing "OVAL") with correct syntax:

furnArray = new Array("SOFA", "CHAIR","TABLE");
for (f=0; f<furnArray.length; f++) {
}

My second question is how to clear all the duplicated movie clips? I tried using removeMovieClip, but had spotty results.

Any help with coding would be appreciated!

Thanks

[Example]Creating JPEG Image From Draggable Clips
I've seen many threads requesting info on how to dynamically create a JPEG image from movie clips that are dragged around the screen. Rather than continuously answer these threads with cryptic info, I decided to throw together a basic example, I hope it helps: http://jerryscript.hostrocket.com/fl...composite.html

[note -- I cross-posted this to the backend forum, sorry if that upsets anyone]

[Example]Creating JPEG Image From Draggable Clips
I've seen many threads requesting info on how to dynamically create a JPEG image from movie clips that are dragged around the screen. Rather than continuously answer these threads with cryptic info, I decided to throw together a basic example, I hope it helps: http://jerryscript.hostrocket.com/fl...composite.html

[note -- I cross-posted this to the backend forum, sorry if that upsets anyone]

Draggable Clips In Swf Not Workin In Loaded Level
I've got a project that takes place on different levels.

In _level0 is the main navigation.
In _level1 is the secondary navigation with draggable items.


The movie in _level1 has several drag and drop clips.
When I publish/play the .swf on it's own it works fine. When I play it loaded into _level1, it drags but does't recognise the targetMC it's dropped on and so the 'triggerMC' doesn't work at all.

I've tried a couple different things. Referencing the draggable objects and target using _level1. The draggable objects only become draggable when loaded in _level1 however the targetedMC code will still not work?

Major stress please advise.

Problem Combining Draggable Movie Clips In Different Levels.
Why is not possible to combine draggable movie clips in different levels within a main movie clip?

In my case, I've got a draggable movie clip, and inside this movie clip I've got a few movie clips which are draggable as well. The hit area of the main movie clip menu does not cover neither the movie clips of the next level nor their corresponding hit areas.

When I execute the file, I just can drag the main movie clip, but the hit areas of the next level are not selectable (the hand cursor does not appear), so I cannot drag the other movie clips.

Is there any way around this? Please, help!

Making Dynamically Created Movie Clips Instances Re-draggable
This is a Flash 8 / Actionscript 2 problem

The application allows the user to create multiple instances of a dot
by clicking on the original dot - and then drag the instances to position
them on the stage (it's part of a game)

I need to allow dots to be re-dragged - but to do that need to detect the
instance name of the dot under the mouse pointer (otherwise I can't turn
the dragging on)

this is what I've got so far...

numberOfDotDuplicates = 0;

dot.onPress = function()
{
numberOfDotDuplicates++ duplicateMovieClip(_root.dot,"dot"+numberOfDotDupl icates,getNextHighestDepth())
_root["dot" + numberOfDotDuplicates].startDrag(true);
}

/*
This bit below is not realy part of the problem
- but it feels like an inelegant workround
I've had to use a listener to stop the dragging
because the onRelease event is only detectable
if it happens over the original 'dot' (where the
corresponding onPress event was detected)
*/
var myListener:Object=new Object()
Mouse.addListener(myListener);
myListener.onMouseUp = function()
{
stopDrag();
}

Thanks for taking the time to read this

Simon

"snapping" Draggable Attached Clips To Each Others' Edges?
Sorry for the confused subject line, I've managed to confuse myself now regarding this...

I'm attaching MC's from the library when a button is clicked and changing the name and depth of each newly attached clip each time the button is clicked. Additionally I'm swapping depths of the clicked MC with the most recent (most current) MC when they are clicked and dragged around the stage. Now it works reasonably well so far. What I want to do now is have a clip snap to the edge of a previously spawned MC. All the clips being attached are just rectangles so their bounding box will do fine. But how do use the getBounds(); function when I don't know the name of the drop target?

All this is supposed to do is allow the user to select the shape they want from a "catalogue" and drag them around on screen to arrange them. While being arranged, the MCs should snap to the left or right edge of the MC it was released over.

How I'm attaching MCs...

Quote:




on (press){
// increment name and depth level of attached MCs...
nameCount = nameCount+1;
depthCount = depthCount+1;
//
//name the child object...
doorName = "doorpanel" + nameCount.toString();
//
// add a movieclip from the library
_level0._itemLib.empty_mc.attachMovie("mc_view_doo rpanels1", doorName, depthCount);
//
// store the path to the new object to make referencing shorter...
_level0.pathToObject = _level0._itemLib.empty_mc.doorName.toString();
//
// Tell the attached MC what frame it should be in.
_level0.pathToObject.gotoAndStop("flat");
//
// Start the property assignments...
_level0.pathToObject.setProperty (_level0.pathToObject, _x, 376);
_level0.pathToObject.setProperty (_level0.pathToObject, _y, 279);
//
// Add item to purchase array for the purchase order...
_level0.purchaseArray[nameCount] = new unitItem(doorName.toString(), "Display Frame", "80 x 96 Display Frame", "80 x 96", "100.00");
//
//
if (_level0.stylesLoaded == "") {
_level0.mc_styleselection.loadMovie("libs/lib_doorstyles.swf");
} else {
_level0.mc_styleselection.loadMovie("libs/lib_doorstyles.swf");
}
}





And what's attached to the button of the soon-to-be-draggable MC in the library...


Quote:




on (press) {
_level0.currentSelected = this;
this._alpha = 50;
this.swapDepths(_level0.mc_doorpanels.depthCount);
// After much trouble with global and local coordinates, a shot in the dark...
point = new object();
point.x = this._x;
point.y = this._y;
globalToLocal(point);
// Don't know if above made a difference but below worked out...
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
// add the offset to position the MC centered with the panel MC...
y_pos = y_pos + 95;
x_pos = x_pos - 32;
startDrag(this, false, -190, -90, 175, 77);
setProperty(_level0._itemLib.mc_isSelected, _visible, 1);
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
}
on (release) {
this._alpha = 100;
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
y_pos = y_pos + 95;
x_pos = x_pos - 32;
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
_level0.thisStyle = this.mc_style_insert;
this.stopDrag();

}




So I need to get the bounds of whatever underneath _level0.currentSelected. I don't know what that name is but I should be able to get with hittest or droptarget, no?

I also haven't figured out how I'm going to determine whether the user released the MC closer to the right or left edge of another MC to snap to the appropriate side.

Any insight offered is greatly appreciated.

"snapping" Draggable Attached Clips To Each Others' Edges?
Sorry for the confused subject line, I've managed to confuse myself now regarding this...

I'm attaching MC's from the library when a button is clicked and changing the name and depth of each newly attached clip each time the button is clicked. Additionally I'm swapping depths of the clicked MC with the most recent (most current) MC when they are clicked and dragged around the stage. Now it works reasonably well so far. What I want to do now is have a clip snap to the edge of a previously spawned MC. All the clips being attached are just rectangles so their bounding box will do fine. But how do use the getBounds(); function when I don't know the name of the drop target?

All this is supposed to do is allow the user to select the shape they want from a "catalogue" and drag them around on screen to arrange them. While being arranged, the MCs should snap to the left or right edge of the MC it was released over.

How I'm attaching MCs...

Quote:




on (press){
// increment name and depth level of attached MCs...
nameCount = nameCount+1;
depthCount = depthCount+1;
//
//name the child object...
doorName = "doorpanel" + nameCount.toString();
//
// add a movieclip from the library
_level0._itemLib.empty_mc.attachMovie("mc_view_doo rpanels1", doorName, depthCount);
//
// store the path to the new object to make referencing shorter...
_level0.pathToObject = _level0._itemLib.empty_mc.doorName.toString();
//
// Tell the attached MC what frame it should be in.
_level0.pathToObject.gotoAndStop("flat");
//
// Start the property assignments...
_level0.pathToObject.setProperty (_level0.pathToObject, _x, 376);
_level0.pathToObject.setProperty (_level0.pathToObject, _y, 279);
//
// Add item to purchase array for the purchase order...
_level0.purchaseArray[nameCount] = new unitItem(doorName.toString(), "Display Frame", "80 x 96 Display Frame", "80 x 96", "100.00");
//
//
if (_level0.stylesLoaded == "") {
_level0.mc_styleselection.loadMovie("libs/lib_doorstyles.swf");
} else {
_level0.mc_styleselection.loadMovie("libs/lib_doorstyles.swf");
}
}





And what's attached to the button of the soon-to-be-draggable MC in the library...


Quote:




on (press) {
_level0.currentSelected = this;
this._alpha = 50;
this.swapDepths(_level0.mc_doorpanels.depthCount);
// After much trouble with global and local coordinates, a shot in the dark...
point = new object();
point.x = this._x;
point.y = this._y;
globalToLocal(point);
// Don't know if above made a difference but below worked out...
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
// add the offset to position the MC centered with the panel MC...
y_pos = y_pos + 95;
x_pos = x_pos - 32;
startDrag(this, false, -190, -90, 175, 77);
setProperty(_level0._itemLib.mc_isSelected, _visible, 1);
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
}
on (release) {
this._alpha = 100;
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
y_pos = y_pos + 95;
x_pos = x_pos - 32;
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
_level0.thisStyle = this.mc_style_insert;
this.stopDrag();

}




So I need to get the bounds of whatever underneath _level0.currentSelected. I don't know what that name is but I should be able to get with hittest or droptarget, no?

I also haven't figured out how I'm going to determine whether the user released the MC closer to the right or left edge of another MC to snap to the appropriate side.

Any insight offered is greatly appreciated.

Draggable Item On A Draggable Mask
hello, i was trying to make a sniping game, and i can get the mask to drag. but i want crosshairs and it won't appear in the mask, so i put it on a diff. layer and it still won't work. has anyone had this same problem, and if so, please help me.

Accessing Clips Inside Clips Of Dynamically Generated Clips
Make sense?

So here's the code I'm working with. For loop generates clips containing clips. I need to access a specific clip (look_back) within the parent clip generated by the loop. Not sure how to do this.

Thanks // help appreciated


HTML Code:
var spacing1:Number = 10;
var lookA:Array = new Array();
function buildLooks(lookNum:Number) {
var looks:MovieClip = new MovieClip();
addChild(looks);
looks.x = 644;
looks.y = 64;
////////////////////
for (var i:Number = 0; i < 4; i++) {
var look:MovieClip = new Lookmc();
look.y = i*(look.height + spacing1);
look.name = "look"+i;
looks.addChild(look);
lookA.push(look);

lookA[i].look_title_txt.text = externalXML.look[lookNum].product[i].titles;
lookA[i].look_copy_txt.text = externalXML.look[lookNum].product[i].copy;

var url:String = externalXML.look[lookNum].product[i].image;
var urlReq:URLRequest = new URLRequest(url);
var lookImg:Loader = new Loader();
lookImg.load(urlReq);
lookA[i].addChild(lookImg);

var proLink:String = externalXML.look[lookNum].product[i].link;
var request:URLRequest = new URLRequest(proLink);

lookA[i].addEventListener(MouseEvent.MOUSE_OVER, onBtn0_Over);
lookA[i].addEventListener(MouseEvent.MOUSE_OUT, onBtn0_Out);
lookA[i].addEventListener(MouseEvent.CLICK, onBtn0_Click);

}

}
var activeBtn:MovieClip;
function onBtn0_Over(evt:MouseEvent):void {
trace(evt.target);
evt.target.look_back.alpha =0; // failed attempt
}

function onBtn0_Out(evt:MouseEvent):void {
evt.target.look_back.alpha =0; // failed attempt
}

function onBtn0_Click(evt:MouseEvent):void {
navigateToURL(request, "_self");
}

[MX04]Movie That Works Fine When Clips Apart Acts Strange When Clips Are Together.
Hi,

I have a pretty basic movie in which a ball moves along a track.

The track is made up of 3 sections & all I want the movie to do is trace an ID number (num) that is an individual property of that clip when it goes over it.

In the first movie attached below “trackOne” the whole thing works great! However in the other movie “trackTwo” I have moved the clips closer together & the whole thing has gone crazy with the following issues.

1.)The “trace” command fires on every “onEnterClip” event

2.)A text field that is used to show the ID number only changes when the ball is fully over the clip not as it first touches it, as it does in the first movie

3.)Although the ball is full off a clip it keeps tracing it’s ID number together with the new clips number?

Anybody able to help me on this?

Embedding Smart Clips In Movie Clips Causes Crashes...?
i noticed that if you use more than one of those drop-down menu smart clip in the common library, you can't see all the choices...

e.g.
drop in one instance
then another directly below it.
publish the movie
select the third or fourth choice from the second drop-down
let go so that your choice is selected
now re-select the second drop-down menu...
the other choices are hidden by the menu above it.

this is also the case if you try the procedure in reverse...
i.e. if the second instance is on a higher z-plane, the choices in the first will be hidden.

it seemed logical to drop the smart clip into a movie clip then use mc.swapDepth to set the z-index

got swapDepth working perfectly
(thanks, Mac8myPC): http://www.flashkit.com/movies/Scrip...98/index.shtml

but as soon as you put an instance of the smart clip into a movie clip, flash (5 for mac, PPC, OS 9.1, g4 466, 384MB) crashes as soon as you try to publish/export/test movie.

i tried it in a button as well... same thing

i've been trying to rebuild the menu in a normal movie clip form but it seems like more pain than it's probably worth...

any suggestions?

thanks in advance,
--cera

Problem Sizing Buttons/clips In Nested Clips
Ok, please see the attached file. What I'm trying to do is create a vertical array of text clips nested in a single clip, then set that clip as the scrolContent for a scroll pane.

So far, I'm able to attach the text box movie clips in the parent clip, arrange them, and set their text values.

What i'm having trouble with is accessing that nested clip's functions, and more specifically, sizing a button in that clip to match the width of the scoll pane.

I know I must be missing something, but I've looked at this for hours. Any ideas? Thanks!

Movie Clips Inside Move Clips. How To Control?
I have an object in this case a foot with toes on it. the toes animate as well as the whole foot moving with the nails on it. I have instance names assigned for all the mc's problem is that the toes are buried about 3 layers down inside the foot_mc so they will move with the foot as well. When I assign a function to them the error compiler does not know where the nails are . What is the best way to fix or re-do this layout?

I am a total newbie to Flash and AS3, so any help would be great


I FIGURED IT OUT.

Draggable
hmm can someone tell me or point me in the direction of how to make a mc draggable using flash 5...
thanks

More Than Just A Draggable Map
All I need here is just a small push in the right direction and I am sure it will all click.

I have been looking for some time to get a map that I am going to use for navigating through a site, to drag on both the _x and _y axes. however rather than just creating a dragabble MC I was hoping to have a controller to make the animation look that much smoother. Has anyone seen a good tutorial or example to assist me or can recommend a solution.

Any response are greatly appreciated.

Draggable Help
problem:
i want to have a toolbar where you click the button, a movie clip will appear, and the user can drag it to any location they want.

Extra Credit:
in a perfect world, i would love to have a save button, that would save where the user placed these movie clips as a seperate swf file.


anyone that can help please do so...
thanks!

Draggable Nav Bar
ive made nav bar which i want to be draggable on my site, i made the background, then the buttons, grouped them as a movie clip and gme them the actions

onClipEvent (mouseDown) {
this.startDrag(true);
}
onClipEvent (mouseUp) {
this.stopDrag();
}

the problem is when people click one of the buttons it picks up the nav bar to be dragged and also when some clicks anywhere on the screen, the bar jumps there. how can i limit the bar from moving to only when its clicked on it a certain place and not the buttons or any random place on the page?

--> Following A Draggable MC?
I've been experimenting for several weeks now and haven't been able to figure this out.

I would like to set up my flash movie so that when the user drags a movie clip, other movie clips will move along with it depending on which variables are set. I can get one movie clip to follow another when dragged (using onClipEvent(enterFrame), but I would like to set this up on the individual buttons and only have it run when the user is in the process of moving an MC.

----------------------------------CODE----------------------------
on (press) {
_global.depth = _global.depth + 1;
this.swapDepths(_global.depth);
startDrag(this);
}
on (release) {
stopDrag();
//If piece is placed in following location lock it so that it can't be moved
if(this._x>467.5 && this._x<487.5 && this._y>53.75 && this._y<73.75){
this._x=477.5;
this._y=63.75;
_root.piece1MC.piece1._visible=false;

// If MC is placed in this position, it should be locked to the piece it was next to
}else if (_root.piece1MC._x < (_root.piece2MC._x - 62) && _root.piece1MC._x > (_root.piece2MC._x - 82) && _root.piece1MC._y > (_root.piece2MC._y - 8) && _root.piece1MC._y < (_root.piece2MC._y +12)){
_root.onetwo = "true";
}
----------------------END CODE------------------------

This is the code I have one MC (they're all similar to this). When variable "_root.onetwo" is set, I would like piece1MC to follow piece2MC and vice versa. The code to do this must be placed on each individual piece, otherwise only one will work.

Any help is greatly appreciated!

Draggable Mc
Hi, i have a function which allows me to drag my mc's on the x axis, but i now want them to be draggable on the y axis too.... so they can be put anywhere. My code for the x axis is below, any thoughts as to how i can make it completely draggable, not just on the x axis?

I'm fairly new to flash, thanks for your help.



onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, false) && _root.blocksDrag == false) {
this.startDrag(false, -800-this._width, this._y, 800, this._y);
}
}
onClipEvent (mouseUp) {
this.stopDrag();
}

Draggable MO + Following MC
Is there any simple actionscript to get a MC to follow a draggable MC.

Draggable MC
I basically need to drag a movie clip (just an image, nothing else) around the stage.. just did a search for it, but couldn't find anything in AS3.. anyone know where I would start?

Thanks!
Zg

Draggable MC Help
Hey folks,

I've been developing a little game thing...one part in particular is giving me problems.

There is a pic of a turtle, and a tortoise, and land and water. You're supposed to drag one of the two to its corresponding environment...if you're wrong, it goes back to the original spot, if it's right, it's supposed to stay.

It works on it's own (as seen here), but when loaded into the main container movie, they don't stay put.

Here's what i'm using on the MC's of the buttons of the turtles;


Code:


on (release) {
stopDrag ();
if (_parent.tortoise_drag._droptarget == "/tortoise_target") {
//_root.tortoise_target.gotoandStop("tortoise_hold");
_parent.tortoise_drag == stopDrag();
}
else {
this._x = 490//the old xposition of the MC
this._y = 145//the old yposition of the MC
}
}



I"m guessing i'm incorrectly using the _parent and _root somewhere, but not sure.

Thanks!

Movie Clips, Vs. Smart Clips Vs My Brain
I am having a difficult time trying to wrap my head around the MC process and its usefulness. I know they are very beneficial, make things easier, file sizes smaller etc. but I can't seem to make logic mesh with my brain cells.

Does anyone have a good way of explaining the "How to's" and "Why for's" of Movie Clip's????

Also, what is the difference between a Movie clip and a Smart clip?? (The latter I have the same questions about as well.)

Thanks,

Controlling Instances In Movie Clips From Other Clips
I am trying to get a button on my level 2 in my main movie to point to a frame inside a movie that has been loaded in on level 3 on the main movie. I have tried all different kinds of combinations and no success. I even tried putting the level 3 movie in an empty movie clip on the root, and naming the instance "music", and then writing in the button _root.music.GotoAndPlay(3); I need it to target frame 3 in my level 3 movie. Should I put the level 3 movie in its own empty movie clip? I was able to get the button to unload movie3, but I don't want it to dissapear, I just want it to go to frame 3 in the movie clip to turn off the music.. You can see what I mean at the address below. I have my audio player in the bottom right with an on/off that works fine, but when I go to the link in my site "Music" there are some downloadble MP3's, and when you click on one I want the "equalizer bars" you see in the audio in the lower right corner to stop, and it means I need it to go to frame "3" of tha movie clip for that to happen, just like it does when you click on "off" in the audio movie. Anyway, sorry this is long winded, but wanted to make sure it was clear as to what I am trying to do..

Thanks in advance,... Here is the link

http://www.incogneato.tv/stales


Mike

Movies Clips Called Within Other Movie Clips
I started this flash porject a while back and haven't touched it in a long time...a few problems to it, that I will fix one problem and then ask for the next problem.

I have a flash file called playin.fla with 2 frames, frame one has a movie clip that is a intro, frame 2 is my main screen with the nav and all the good stuff.

I have 4 buttons on that with a blank screen to load my stuff in, and it is called 'screen'

So here is my code that isn't working:
on (release) {
loadMovie("portfolio.swf", "_root.screen");
}

Easy to fix I am sure, I have tried _parent.screen as well, doesn't work....

Thank you very much for your help in advance.

Nested Clips Having Different Scale To Timeline Clips?
I have placed some movie clips inside another clip & I’m using their _width & _height properties to dynamically set the width & height sizes of some other clips that I’m placing on the main timeline. So the new clips on the main timeline will have the same _width & _height properties as the nested clips.

Problem I have got, & this has been confirmed by the dimensions in the Property Inspector panel, is although the clip that I’m placing on the main time line looks about 20 times the size of the nested clip,
When you check both clips dimensions in the inspector panel they are actually both around the same size?

Why do nested clips seem to have a different scale to timeline clips?

To confirm that a picture paints a thousand words a demo fla is attached which shows & explains everything much better.

I’ am aware of the “global & local” coordinates system but thought this was just for _x & _y positions not size.

Clips Within Movie Clips And Instance Troubles
I'm trying to create ultimately 9 seperate instances that function seperate from each other perhaps after being click on within their own hit box.

directions: up and down to cycle squares, click (anywhere) to rotate.

As it stands the first instance is the only one that reacts to the up and down commands and both react at the same time (bad) to the clicking for rotation...

go here http://maroonedmoon.com/cubes.swf to see the swf if action...

I need these two squares to act independent of each other, i've tried naming them different things, and even duplicating the symbol with different names... but it's not working. I imagine the issue is with my simplified actionscript...

any help is greatly appreciated

and here's my .fla

Empty Movie Clips And Duplicating Clips
I've been trying to reproduce an animation effect I've seen on the Armani website, but I'm stuck trying to duplicate an empty movie clip with image loaded into it. The duplicates exist and I can move them, but they are invisible. Since the duplicates reside on depths above the intitial clip I'm confused about why they are invisible. The duplicates are scripted to follow behind the initial clip - each offset by 30 pixels (though I don't have that working perfectly).

I'm attaching a simplified version of my file to isolate just the duplication troubles. Thanks for the help!

Nested Clips Targeting Other Clips On Root..
ok check this out guys.

3 frame movie

each frame has seperate clips

frame two has a animation clip nested inside another clip, so two clips up on frame two of root has navigation button "back"

i need to get back to root  frame 1 clip "intro" frame 250 of that clip

here is what i have on the button:

on (release) {
_root.intro.gotoAndPlay(250);
}

not working. Why?

Thanks in advance...

---------------------------------------------
www.orlandomediasolutions.com
www.mlstaffing.com
www.mwll.com

Draggable Mask?
I have tried but failed miserably to accomplish this task...

Using Startdrag, make a draggable mask layer to create a magnifier effect.

Can it be done?
Any hints?

Regards,

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