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




Movie Clip Collision



I have created a Movie Clip I can control with my keyarrows,now I want to steer that movieclip in to another movieclip andthen create a function that becouse of the collision of the twomovie clips takes me to another frame.How do I do?



Actionscript 2.0
Posted on: Tue Sep 12, 2006 4:46 am


View Complete Forum Thread with Replies

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

Collision In A Movie Clip
im makeing an isometric RPG game but i have a problem with the hitTest already and im not verry far in yet. im currently working on the walking engine. so far i simply have


function moveCharicter() {
if (key.isDown(Key.LEFT)) {
this._x -= 4;
this._y -= 2;
this.gotoAndStop(1);
if (this.hitTest(_root.wall)==true) {
this._x += 4;
this._y += 2;
}
} else {
if (key.isDown(Key.RIGHT)) {
this._x += 4;
this._y += 2;
this.gotoAndStop(2);
if (this.hitTest(_root.wall)==true) {
this._x -= 4;
this._y -= 2;
}
} else {
if (key.isDown(Key.UP)) {
this._x += 4;
this._y -= 2;
this.gotoAndStop(3);
if (this.hitTest(_root.wall)==true) {
this._x -= 4;
this._y += 2;
}
} else {
if (key.isDown(Key.DOWN)) {
this._x -= 4;
this._y += 2;
this.gotoAndStop(4);
if (this.hitTest(_root.wall)==true) {
this._x += 4;
this._y -= 2;
}
}
}
}
}
}



hero.onEnterFrame = moveCharicter

this works fine if i make the wall just a simple block but as its isometric i have made the wall one big black movie clip with an isometric shaped hole in it where the hero should be able to walk in. however i know as it counts the wall movieclip as one big thing so the heros movement was perminantly stuck i was wondering if anyone could help with the actionscript so the hit test was a shape hit test thingy?

help sum1 please? heh heh

[F8] Movie Clip Collision
I want to detect the point when a movie clip circle is colliding with a curved path . I want to detect the collision point not just the operlapping of the circle.

Any ideas.........

(can we post our files and images also in this forum? if yes! please tell me how. It will help me to explain the problem)

Movie Clip Collision?
I am very new to flash and playing around with it, and I am trying to make it so that when you rollover a movie clip, it plays the rollover action inside the movieclip (which is a mask of a portion of an image, then when rolled over shows more of that image)and cause the movieclip next to it to move over when the rolled over movieclip expands. So basically when one MC is rolled over and expands I want the other to move over too, in order to compensate for the rolled over MC.

Can anybody help?

Collision Within Movie Clip
Diagram:
//
on stage:
BOX
MOVIE CLIP WITH CIRCLE IN IT
//
How would I write a script to see if the box and circle collide?
(If possible, using shape flag)

Movie Clip Collision Detection
i have a lighter which i created and for an interface i would have 5 ropes, one for each of my menu options.

what i need is when the lighter is on and the flame movie clip is visible i need a collision detection for when the flame touches one of the ropes, then my movie will go to the frame where that option lies.

Trying To Remove Movie Clip With Collision?
I am creating empty movie clips and populating them with movie clips that have "drag and drop" functionality. I can create the empty movie clip and populate it with an external .swf. I've even got the drag-n-drop handled. But, I'd like to have them delete or disappear when they are dropped onto a trash can movie clip. I just can't seem to figure out the code for this. I would greatly appreciate any help you could give me.

Thanks.

Multiple Movie Clip Collision Detection
I have many instances of a movie clip (by using duplicateMovieClip) on my stage, each with a name of "clip1", "clip2", "clip3" etc.
I have many instances of another movie clip, like the one above, but all derived from a different original movie clip. They're named "something1", "something2" etc.
I want to put an "if" statement that performs a "hitTest" between one of the "something" movie clip instances and ANY of the "clip" instances.
This is the code I have inside the onClipEvent (enterFrame) of the "something" instance:
onClipEvent (enterFrame) {
if (this, hitTest(_root.varClip)) {
this.removeMovieClip();
}
}
and I have this code in a frame on the _root level
for (var i = 1; i<=3; i++) {
_root.varClip = ["clip"+i];
}
Nothing is working this way. Is there some other way that I can check the collision using arrays?
Am I mixing up the paths?
I'd really appreciat some help with this. I feel like I'm so close already.
Thanks
Kevin

[F8] Bitmap Collision Between Movie Clip And Bitmapdata
How can i do a collision check between a movie clip and a bitmap data level.

Adding Collision Detection To A Custom Movie Clip
Hey, guys. I've created a custom movie clip object (by extending the movieclip class) and instantiated a number of them for a game I'm making. From what I've read, you can add collision detection to the custom object. Before hand, with each frame I'd loop through every single object and see if something hit it. As a matter of fact, I did that for one game I just made and everything worked beautifully. However, can't I do something like


Code:


class Something extends MovieClip {
var someVar;
function Something (x,y,someVar) {
this._x = x;
this._y = y;
this.someVar = someVar;
}
function hitTest(someOtherObject) {
this.removeMovieClip();
}
}



If I can do this, the question becomes, how do I pass in the object to do the test? Do I pass it in as a member variable when I attach the movie clip? For example, I pass in values for the constructor with

_root.attachMovie("instance1","Something",this.getNextHighestDepth,{x:100,y:100,someVar:12});

where the final parameter is the initial values. Should I pass in all objects that could possible hit the attached movie clip then check within hitTest? Any help would be greatly appreciated.

Making A Movie Clip In A Movie Clip Go To The Next Frame Of The Original Movie Clip
I have a movie clip (for simplicity I'll call it movie_a) in movie_a I have another movie clip movie_b.

in movie_a i have a button that when pressed makes movie_b play (it has a stop frame every once in a while so the button acts as a "next" button)

I want it so that when i get to the last frame of movie_b and press the button, it will go to the next frame of movie_a

I hope that doesn't confuse u and u can help me solve this problem, as i am stumped and I've tried everything I could think of (which isn't that much as I'm not too good with actionscript)

thnx

Transfering Movie Properties On Collision
Need Help...

I am trying to force a transfer of properties from one movie to another, after collision has taken place. The main property I want to use is the _Alpha value. Bouncing it from one mov to another.

Collision Detection Between 2 Movie Clips
Hi, I was wondering if anyone could tell me how to detect if 2 movie clips are touching, even better, if one movie clip goes over a certain coordinate on another movie clip.

any help would be great
thanks, josh

Event Trigger On Movie Collision
Im trying to trigger some sound when movies collide (for a very basic game im doing for my 5 year old son). I have created a movie clip of an animated man walking. Inside of this movie clip i have created another clip which i intend to use as the hot spot for triggering sounds. This is all well and good but i cant sort out the action script need to trigger the sounds. Any tutorials i have found have all been for earlier versions of flash and therefore wont workwith the new action script. I also need to to you the collide movie function to load a new movie when the animated charector reaches his destination. This i would imagine would be very similar to the script needed for the sound trigger. Can anyone please help me with this or point me in the right direction for some tutorials? I promised him it would be done for the weekend (silly me)
Cheers
Crowds

Hittest On Complex Movie Clips (collision)
Hi!

I have problems testing the collision of two movieclips. My problem is that the collision is detected by the bouding boxes of the movieclips and not the actual surface of the shapes of the movieclips. This way it says they collide, even when they don't touch eachother (only the bounding boxes). I Searched for all kinds of possibilities to solve this, but I couldn't. If somebody has a creative idea, PLEASE let me know!!!!

thanx!

Robert

[F8] Collision Detection With Non Square Movie Clips
Hey im trying to make a game engine where you can angle up slopes. To do this im trying to do a do collision detection on two points of my object to see if i can rotate the object according to the slope of the ground. But one thing is really screwing me up. My ground is a simple black line with another line running out of it for a jump (as will be shown if i can include the fla). Right now i have it so i can go up the slope, but without rotating to fit the angle. Since the ground has a line coming up from it it makes the movie clip hitTest area into a big square. Is there any way of making the movie clip's hitTest area not in a square but tight to the drawing?

Collision Detection Between Attached Movie Clips
Hello there!
I'm new to this forum but I've been playing around with Flash since I was little.

Recently I made a simple first-step to a game where you can point the character with the mouse and shoot with a click.
I'm adding characters to the world with the attachMovie() method, which is also the way I'm adding the bullets or magic bolts or whatever it's going to be.
This is the unfinished code for creating an enemy. Sorry for the Swedish. I'm in a hurry.


Code:
getEnemy = function() {
++djup;
var name = "snubbe"+djup;
_root.attachMovie("snubbe", name, djup);
_root[name]._x = 550;
_root[name]._y = random(400);
_root[name].onEnterFrame = function() {
//I think it's here the code will fit in...
}
};
};
and the following is the code for the bullets(no rotation).


Code:
depth=0;
_root.onMouseDown = function() {
angle = gun._rotation;
angle = angle*Math.PI/180;
++depth;
name = "skott"+depth;
_root.attachMovie("skott", name, depth);
_root[name]._x = gun._x*Math.cos(angle);
_root[name]._y = gun._y*Math.sin(angle);
_root[name].xåk = speed*Math.cos(angle);
_root[name].yåk = speed*Math.sin(angle);
_root[name].onEnterFrame = function() {
this._x += this.xåk;
this._y += this.yåk;
};
};
Thank you for your help.

Collision Detection For Attached Movie Clips
Hello,

I have a difficulty that I need help overcoming. To give some background information, here are the movie clips used:

1 movie clip called 'skater'
1 movie clip called 'token'
In the actionscript, 'token' is incremented to become 'token1', 'token2', etc.

I am using attachMovie to place the new 'token(i)' at different points on the stage. I then want my 'skater' to be able to collect them using a hitTest. I know my code works for other things as I tried it by creating another movie clip called 'obstacle' and substituting it in place of 'token(i)' and it worked perfectly.

I don't understand why my code isn't detecting the attached movie clips.

If anyone can point me in the right direction, I would really appreciate it. I have attached my code for you to look at.

Looking forward to an answer soon.

Cheers
Psylova







Attach Code

var i = 0;
function tokens()
{
timeSinceLastToken ++;
trace(timeSinceLastToken);
if((timeSinceLastToken > 20) && (Math.random()<.1))
{
i++;
var newname = "token"+i;
_root.attachMovie("token", newname, i*100);
_root[newname]._y = Math.random()*490 +240;
_root[newname]._x = 520;
trace(newname);
trace(timeSinceLastToken);
}
}

// works up until here - I can't get the tokens to register that they've been hit.
// I know the code works as I've tried it out with another object 'obstacle'
function collectToken()
{
if (_root.skater, hitTest(_root[newname]))
{
//_root[newname].swapDepths(10000);
_root[newname].removeMovieClip();
trace("Token Hit!!");
score ++;
}
}

Making Movie Clips React To Collision
I am trying to get the effect of a snooker pack being broken up with a cue ball for my website, is there a way using action script i can achieve this. Also, is it possible to use a SWF as a background in Dreamweaver?

Targeting A Frame Label In A Movie Clip From A Button In A Separate Movie Clip.
I have two separate movie clips placed on a timeline-MovieclipA and MovieclipB. I have a button in MovieclipB clip that wants to target a frame label located in the MovieclipA timeline. Can someone help me?

Movie Clip Buttons Nested Inside Movie Clip Dont Work
Hi people!
im having a problem here.

in my first frame i have a movie clip named "menu_mc".
i have this AS for this movie:

Code:
this.menu_mc.onRollOver = function() {
menu_mc.gotoAndPlay(8);
}
this.menu_mc.onRollOut = function() {
menu_mc.gotoAndStop(7);
}

thats working ok, the menu_mc plays on rollover from frame 8 till frame 12 where stops.
On frame 12 (this is inside the menu_mc movie clip) i have another movie clip, named button1_mc.
and also i have AS controling that MC:

Code:
this.button1_mc.onRelease = function() {
getURL("index.htm", "_self");
}


The problem is that when i rollOver on menu_mc it work fine and the button1 appears, the problem is when i try to click button1...
doesnt work.

the swf you can see it on www.wt.com.mx/menu.swf
can anybody help me please?
what im doing wrong?
or what other ideas can you give me so i can make that work.

thanks!

Mouse Rollover On One Movie Clip Increase Decrease Alpha Of Another Movie Clip..
So I really haven't messed with Actionscript much for a couple years and here is my issue.

I have several movieclips I put together that will eventually be a menu for my website. When you roll over a menu option (movieclip) I am trying to get another movie clip to fade in giving the description of the menu item.

For example - when you roll your mouse over the 'Live Chat' option a brief text description would appear telling you what the live chat is about. This description is a seperate movie clip appearing away from the original menu.

I have made the movieclips for the menu and the movie clips for the descriptions. I tried this action on the menu option to get the description to fade in:


Code:
onClipEvent (load) {
this._parent.mc_text_discussionBoard._alpha = 0;
}
onClipEvent (enterFrame) {
this.onRollOver = function() {
if (this._parent.mc_text_discussionBoard._alpha<100) {
this._parent.mc_text_discussionBoard._alpha += 5;
}
};
}
But the alpha only increases on the description (mc_text_discussionBoard) by 5 when I keep rolling my move over and out and over again. It makes sense why it does that, but I'm not exaclty sure how to get it to continually increase the alpha by 5.

any help would be great and I am anxiously waiting to get this solved!
Kevin

Code 4 MovieClip Button To Load A Movie Clip Into A Placeholder Movie Clip.
Yeah that title sounds a little confusing...so i will explain:

Is there a way to tell a "movie clip button" that once it is clicked on to load a "movie clip" into a "movie clip placeholder". So instead of loading an external swf into the placeholder, it will be a movie clip from within the same library. Putting every single custom clip on the timeline would take a while, so that is why I thought it would be easier like this, and the other movie clips are not that large that I want to load into it so there is no need for external swfs, trying to keep it clean. Here is the code along the lines I am trying to go for.

__________________________________________

this.profile_mc.onRelease = function() {
placeholder_mc.loadMovie("profileSection_mc","plac eholder_mc","_root.content");
}
__________________________________________

- "profile_mc is the button I am trying to activate to load the
"profileSection_mc" into the "placeholder_mc". but so far no good.

- the movie clips are within the same library, not on the timeline or external library.

- Is this possible?

Using A Button In A Movie Clip To Control The Movie(and Not Movie Clip) Timeline
Ok i have a button placed in a movie clip. I want this button, when released, to go in another scene, frame one, on the movie(scene) timeline and not on the movie clip timeline.

So i tried: gotoAndPlay("mission", 1); (mission is the name of my scene)

But it goes to the frame 1 of my movie clip, It would be great if someone could tell me how i can control the movie timeline while my button is in a movie clip

thaks
Vakarm

A Movie Clip Inside A 2nd Movie Clip Colliding With 4th Movie Clip That's In The 3rd
sorry if that sounds a bit odd, this is really a simple problem that i can't seem to nail.

Can u please give the the hittest that shows when a movie clip collides with another regardless of their level.

How To 'stop' A Movie Clip Within A Movie Clip Within A Movie Clip Loop
I've done searches, laughed, cried, and punched holes through the wall, but I can't figure this out.

I'm in Flash MX (pro) and I have a MovieClip on my main timeline (frame 1). Inside that clip is another animation (the static animation scrolling across the screen), and another inside of it of the static animation (6 characters on a train each animated uniquely).

Confused yet? Ha! OK, so I just want the damned animation on the main timeline to run once and then stop (or to 270 frames). I've tried:

myMovieClip.stop()

to no avail. I've tried attaching the script to the movie clip itself, and also to the frame.

Any suggestions?

Collision Detect: Stopping A Movie From Moving On The Stage
Hey everyone,

I have multiple stationary movies on the stage (they dont move around on the stage) and I have a movie that is moved by the arrow keys (on the keyboard). How can I make it so that when the movable movie comes in contact with one of those statinary movies, they don't overlap each other?

(e.g. When Pac-Man hits a wall, he stops moving until the user gives another direction. Also, attempting to move in the blocked direction repeatedly doesn't allow you to pass through)

Thanks!!!

- OneMrBean

[MX] Collision Detection Between Objects In Nested Movie Clips
I'm normally not one to bother people when I can't figure something out in Flash, but I'm stumped, so I'd appreciate anyone helping me out. In short, I am trying to have circles grow and shrink whenever an object that is orbiting the mouse passes over them. I'll try to fill in as many details about the flash movie as possible here...

The cursor is comprised of two layers of nested movie clips. The bottom-most movie clip is a 15x15 instance of a circle labeled electron, offset from the center of its stage(x: -7.5, y: -50). This is inside another movie clip where electron rotates. This movie clip is called electron-anim. Finally, electron-anim is inside another movie clip called cursor. Cursor has the following actionscript applied to it to make it follow the mouse.

Code:
onClipEvent (load) {
startDrag(pointer,1);
}

Because electron is offset, its rotation gives the illusion that it is orbiting the mouse cursor.

The four red dots on the stage are instances of the same movie clip. This movie clip has a tween labeled "grow", where the circle increases in size, and a tween labeled "shrink", where the circle is reduced back to its original size. Also in this movie clip, on a layer on above of the tweens, is a 30x30 instance of a square with alpha set to 0. I included this invisible square so that there is a consistent bounding box regardless of the circle's current size.

So, my goal is to have the "grow" or "shrink" tweens triggered whenever electron passes over the invisible squares. I've tried looking up many different tutorials and threads on how to script this, but haven't found anything that works quite right. I hope someone here can provide some assistance. I'd really appreciate it.

Making A Draggable Movie Clip Control The Location Of Another Movie Clip
http://www.kineticz.net/jba/residental.jpg that is a picture of what i am trying to do. the white bar at the bottom is the draggable movie clip and the group of 3 pictures right above that is the movie clip that i am trying to control w/ the draggable clip. I am having trouble writing a script that will do this. any help you can give will be much appreciated.

When I Click On A Movie Clip I Need The Movie Clip To Goto And Play Frame 2
i have created a movieclip and draged it on to the stage i tryed used on mouse down then tell target goto and play but that ment when ever the mouse clicked any where, how do i tell in to only play when i click on the movieclip ?

How Can I Control A Movie Clip Which Was Loaded In To A Empty Movie Clip On Level 0
how can i control a movie clip which was loaded in to a empty movie clip on level 0 the name of the movie is 'imagemc.swf' and 'imagemc' for the empty movie clip on level 0. the movie doesn't have a movieclip name, how am i going to tell target the movie?

How To Manipulate A Movie Clip On The Main Stage From Inside Another Movie Clip
I have a button inside a movie clip, and I want it to work that when you hit the button, a different movie clip will go to frame 5. anyone know how to help? I think it has something to do with which level it is on, but I can't manage to figure out anything else.

A Button Inside A Movie Clip, Within A Movie Clip, Calling Another Scene:
Is it even possible?

I have been trying to do it for the last few days for a site I am working on.

I have done searches in many forums and it's foolish looking for an answer that way, because quite frankly every thread I opened was something to do with LoadMovie or GetURL, etc.

What I have right now is on the button in my Menu Bar Movie Clip:

on (release) {
gotoAndPlay(285);
}

Which plays a fancy little animation in the movie clip and then on the last frame of that movie clip I had:

gotoAndPlay("Contact", 1);

Which is the Scene for the "Contact Us" Scene named "Contact"

One would think that it would load up the scene and play at frame 1, however all that happens is it reloads the movie clip of the "Menu Bar" at frame 1 and starts over, not even realizing what I asked.

Anyways, I figured there's a script or something that tells it to look outside of the movie clip or to the _Root, or whatever.

If someone has a solution, it would be greatly appreciated.

Sorry I have no example to show, since I have yet to upload it. (It's my company's web site, and I don't think customers would want to see some half-arsed web site that's not complete.

Thanks in advance.

On Mouseover Show Movie Clip, On Mouseout Close Movie Clip *HELP*
Basically what I am trying to do is this...

I have a movie clip that is a name. When you put your mouseover the name I want another movie clip to display to the right of the name. This clip has a photo and bio of the person.

The photo and bio have an animation that fades it in and an animation to fade it out. I have 5 frames for the fade in, then stop frame, then 5 frames for the fade out.

What actionscript do I need to use to make that second movie clip load when a user mousesover the name (first movie clip) and to make the second half of the second movie clip play when the user removes their mouse from name (first movie clip).

NOTE: I tried using loadMovie and unLoad movie but I couldn't do it loading another swf. The reason being this is already an swf loaded inside a main movie. I guess you can't load an swf inside an swf that's already loaded inside an swf. I hope this all makes sense!

I appreicate all the help!

Thanks a lot!

Create A Movie Clip As A Button To Jump To Half Way Through Another Movie Clip?
hi guys and gals,
i am wondering if i can make a movie clip (as a link for a website) jump to half way through another movieclip...
thanks in advance

Create An Empty Movie Clip Inside An Existing Movie Clip?
I'm making sort of a tabbed navigation scheme by reading the data for each tab in from an XML file. What I'm wondering is if it's possible to use createEmptyMovieClip() to make a new empty movie clip inside a movie clip that already exists on the stage.

Using
ActionScript Code:
m_anchor.loadMovie(bg_image);
works as I would expect. bg_image is just the relative path to an image file, and m_anchor is a movieclip already on the stage. However, doing a similar thing:
ActionScript Code:
m_anchor.createEmptyMovieClip("textbox", this.getNextHighestDepth());
and then drawing a shape (a rounded rectangle, which I then want to put text on top of) doesn't work. It works if I just say "this.createEmptyMovieClip" instead of attempting to create it inside the m_anchor clip, but if I do that, the "textbox" is created at the root level and I can't unload it along with everything else in the "m_anchor" clip. Is it possible to create a new empty movie clip inside of one that is already on the stage?

Thanks!

Load An Internal Movie Clip To An Empty Movie Clip On The Stage
Can any of you shed some light as to why this is not working:

on (release) {
emptyMC.attachMovie("mrimc","instance1",this.getNe xtHighestDepth());
}

what I want to have happen is when the user clicks a button it loads the mirmc into emptyMC on the stage.

I have double checked that my empty movie clip does indeed have an instance name of emptyMC and that the movie I want to load into does in fact have the name mrimc in the library. Any ideas?

Problem Getting Movie Clip Inside Of Movie Clip To Face Mouse
I used the code below to make a movie clip face the mouse, it works when I use it on a movie clip that's not embedded in another movie clip, but when I used it on an embedded movie clip, it's axis seems to change.









Attach Code

var stickGun:MovieClip = this.stick_holder.stickGun_mc;
//stick_holder.stick_mc.stickGun_mc

stage.addEventListener(Event.ENTER_FRAME, onMove);
//stick_holder.stick_mc.stickGun_mc.addEventListener(MouseEvent.MOUSE_MOVE, onMove);

function onMove(event:Event):void {
// get the radian value of the angle between the clip and the mouse...
var myRadians:Number = Math.atan2(mouseY - stickGun.y, mouseX - stickGun.x);
// convert it to degrees...
var myDegrees:Number = Math.round((myRadians * 180 / Math.PI));
// get the horizontal and vertical distance between the clip and the mouse...
// rotate the clip toward the mouse...
stickGun.rotation = myDegrees;
}

Placing Actionscript Movie Clip Inside A Movie Clip Symbol
I'm loading an external image into an empty actionscript movie clip (holder1) using MovieClipLoader(); on frame one of my movie and is invisible. Then when the movie plays, there is an empty movie clip symbol (image1_mc) that is placed manually on the stage within another movie clip symbol (flash_mc), and is also on a bottom layer of a mask layer which is animated. Is it possible to place "holder1" inside of "image1_mc" so that I can treat it as if it were an embedded image? In other words, have the image in "holder1" inside of the manually placed movie clip symbol "image1_mc" so that I can use it like a regular symbol on the stage?

How Can I A Movie Clip Splash Prior To Attaching The Choose Movie Clip..Help
I have a presentation which I would like to publish on CD. What I want is to have movies attached to the container_mc on the stage upon clicking the desired navigation buttone. But before movie gets attached, I would like to have a logo_mc animation (from the library) to play itself before playing the selected clip.

I think I need to write up a function which will call the animation splash clip prior to attaching the clicked movie.

Appreaciate all the help.

Thanks so much.

Control Movie Clip In Container From Button Inside Other Movie Clip
There are three movie clips involved in this question.

1. A main movie clip that has a target empty movie clip where an external swf loads.

2. A menu movie clip that is built from button symbols and has its own timeline.

3. The external movie.

When a user clicks on the menu, the external swf loads into the empty movie clip target.  This part works fine. Here's the code:
on (release) {    
    loadMovie ("Lesson1.swf", "_root.container");
}

I want to use one external swf for all lesson, versus 20 external swfs. The problem I'm having is controling at what frame the external swf loads.  I've tried adding --gotoAndStop (15) -- for example. I've also tried adding, gotoAndStop "_root.container" (15), but that doesn't work either. The gotoAndStop action ends up controlling the menu movie clip timeline instead of the movie loaded into the container. I figure this is because the menu mc has "embedded" buttons and it's own timeline.

Any  help you can offer will be much appreciated.

Thanks
Sheila



Creating A Button To Open A Movie Clip From Inside A Movie Clip?
I'm using a hexagon menu to display some images. One image is placed on each slide of the hexagon menu (which can then be rotated left and right to see other "slides").

What I want to do now is to be able to click on the object (image) as a button and for it to go to another scene which shows the image blown up and some description next to it (which is another movie)

I have tried the following which doesn't seem to work:
Created an invisible button (or choosing the image as a button) and having

on(release) {
gotoAndPlay("scene 5", 1);
}

this doesn't work when I use it over the hexagonal menu, but when I move the button to somewhere else on the screen (not over the movie) it works.


Please can someone help with this - Ive been working on it flat out over the weekend and desperately want to make it work. any ideas would be appreciated!! thank you

Loading External Movie Clip With A Button Inside Another Movie Clip Help
Hi,

I am working on a scrolling thumbnail movie clip, that when you click on the thumbnail button inside the movie clip it will load an external movie clip. I have an empty movie clip on the main stage, and have been trying all sorts of code, but for some reason it doesn't like that I am inside a movie clip using buttons. It can't seem to find the external swf.

I have tried:

on (release) {
loadMovie (ithink.swf, "loader");

and

on (release) }
if (firstTime == true) {
loadMovie("ithink.swf", _root.loader);
firstTime = false;
} else {
_root.clicked = "ithink.swf";
_root.loader.gotoAndPlay("goback");
}
}

and so far nothing, for some reaosn when I click on a button outside of the movie clip with the above code it loads... and than the other works too, but if I click on the buttons inside the scolling movie clip first they won't work.

Any suggests or ideas!!?

I would really appreciate it... I am beyond frusterated!!

Unload A Movie Clip From The Movie Clip That Was Targeted From The Root Timeline
I have on the main timeline, a button that when it's pushed loads an external .swf into a blank MC. I need to be able to close the MC within the mc. I know I can do this is loadMovieNum and use levels, but then I can't target where I need it to load in...is there a way to do this?

Thanks
Stacy

Problems With Collision Detection Between Movie Clips And Text Boxes
I have a large map (movie clip) on a stage that is much smaller so that only a portion of the map is shown on the stage at a time. The map contains points of interest (movies clips) and labels (text boxes) for those points. These points and labels are dynamically created and placed on the map. The position of the map point is determined by an external XML file and the label is positioned next to the map point. Each map point links to a corresponding webpage. The map point for the page the user is on becomes the center of the map and determines the portion of the map shown.

I have been able to get the map to re-center with reasonable accuracy and I am planning on using variables from the URL or flashvars to determine what map point should be the center based on the page the user is on. The problem I am currently having is there are several labels that overlap map points or other labels. I have been attempting to use collision detection to determine which labels are overlapping and move those labels to an empty area on the map. My first attempt at collision detection was with hitTest() but this was not working. From what I found, hitTest() only works with movie clips and the labels are dynamically created text boxes. It is necessary to have the labels as text boxes because the labels need to have a background color and have a variable width to accommodate the longer text ; this didn’t seem possible with a movie clip. Below is the method I am currently trying to use:
1. Create an instance of a movie clip (pre-existing movie clip from the library, containing a dot) for each map point and place according to the information in an external XML file.
2. Create text boxes for each label and place the text boxes next to the appropriate map point
3. Determine which labels overlap other labels or map points
4. Determine if the labels that overlap can be moved above or below their current position without causing new collisions.
5. Check to see if the new position of the labels that need to be moved will overlap with other labels that are being moved. If they do, find a new place for the label then move it. If not, just move the label.

There are several problems with the current method:
1. For the best results I have to check each corner of every label and map point to see if it overlaps with other labels. This results in lots of if-statements with the code in the if-statements being very similar.
2. While loops and functions do not work so there is lots of repeated code. When I use while loops, the Flash movie runs very slow and eventually crash the program before anything is placed on the map. When I use functions, I am unable to access variables inside the functions and I end up with a blank map when I test the movie. I thought this might be a variable scope problem and declared my variables outside of the function but this didn’t fix the problem.
3. Several label overlaps are not detected. I was thinking this has something to do with the depths of the labels because collisions only seem to be detected with labels that were placed after the label being tested but I don’t know if or how this problem can be fixed.
4. I can’t seem to get the labels to a point where all labels are not overlapping no matter where the map is centered. I can usually manage to get one portion of the map to look decent but as soon as I re-center the map the labels are overlapping in that portion worse than they were before.

I have searched extensively on the internet and can only find collision detection used for creating games. As you can see, I have been unsuccessful at tailoring the gaming solutions to my problem. What I would appreciate is any suggestions, links to websites or tutorials, or anything else that might be helpful in solving my problem. Thank you in advance for your help.

Using A Movie Clip Inside A Movie Clip To Start A Frame Of An MC Inside A Movie Clip
Situation:
I have a movie clip inside a movie clip with a button inside of it.

This button on release goes to a different movie clip(svideo) in a different frame on the maintime. This movie clip has a movie clip(portfolio) inside of it.
Okay: I use an absolute path on the aforementioned button
on release
_root.svideo.portfolio.gotoAndPlay(60);

But, for some reason Flash won't go to frame 60 of the portfolio movie clip that is inside of the svideo.

I have tried numerous variations on reaching frame 60 of portfolio. Like going to the maintime line and going to the portfolio MC. Also, portfolio and svideo are the instance names and not the name of the actual movie clip.

If anybody could help, I would appreciate it. Thanks.

How Do You Make A Button Able To Jump From Movie Clip To Movie Clip
how do you make a button able to jump from movie clip to movie clip

I have 5 movies i the same scene , I need the buttons to jump from movie to movie ... how do I code this in the acrions ?

A Button Inside A Movie Clip To Move Another Movie Clip
I'm building a web page and I have a button that I need to make two movie clips play. The button is inside one movie clip and in addition to it playing I want it to make another movie clip play. It doesn't seem to recognize the movie clip target names. Any help as to how this can be done would be much appriciated.

Thanx

Movie Clip Tween From A Random Point To Another Movie Clip?
ok...
on a website I am trying to make...i have a rotating E (lowercase)

it flips around and does all kindsa crap

but when a person clicks on a button, i want it to tween from whatever frame it is on, to where all 3 of them line up and do a little flashy type thing

ei:
e#1 - upside down and backwards
e#2 - sideways and rotating on the y axis
e#3 - rotating on the x axis

now i want all of these to tween from the point they are at to a specific order....so they are all flat (ei: they look like this "e")

how the heck do i do this?!? i know i have seen it somewhere!!

Duplicate Movie Clip / Remove Movie Clip Woes
I have built a an MC that will Duplicate an MC it does this a specified 114 times.

Once all of the MCs are in the Movie I want to pick a movie clip and remove it randomly. I am doing this now but It takes to long because it is looking for numbers that are no longer existant instead of just going for the ones that are already there.

I was talking to one of the programmers at my work and he was telling me to build an array that adds in a each duplicate mc name

for instance
amount = 1
I have 114 boxes each box as it is duplicated gets renamed box + amount
amount + 1
until it gets to 114
then it looks for each box1 - box 114 and gets rid of each box 1 - 114

But how could I get it so I remove lets say box 84 it wont look for 84 for any more

I was thinking

I dynamically rename every mc > 85 to name amount - 1

and have it randomly look for 113 the next time around and so on til it finally gets to zero...

Any one have any suggestions for me?

Or if you can point me in a direction that would be good as well

Thanks a bunch

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