AC3 Collison detection inside a movie clip (rather than with its bounding box)

I want to navigate a maze and therefore I want to create collison detection with the maze itself, but when I try the collison is made with the entire maze movieclip, so even if my character is safe in a corridor without touching the walls of the maze it still counts as collisons.
Is there a way to detect collison with the content iside the movieclip rather than it's bounding box?

Check out Collision Detection Kit: http://code.google.com/p/collisiondetectionkit/

Similar Messages

  • Problems with button inside draggable movie clip

    I am building a click through presentation that has some small text in it. To maintain the design and allow for readability, I have added a zoom feature.
    Here is the structure of the movie,
    Stage - contains pages movie clip and forward/reverse click buttons for changing pages
         pages_mc - contains 24 frames, one page per frame and buttons
    There is a button at the _root level that uses a tweener to scale the pages_mc up to 170%. When this is clicked, it allows the pages to be dragged around the screen so you can look at different sections. When you click the button again, it returns the pages back to their original size stops drag.
    My problem is, on the pages, there are buttons with links to external sites. Once startDrag has been invoked, I cannot touch the buttons inside the movie clip. Is there a way to make these buttons work?
    I need the finished quickly so any assistance is welcome.
    Code below
    magUp_btn.onRelease = function() {
    this._visible = false;
    TweenLite.to(pages_mc, .25, {_x:-250, _y:-193, _xscale:170, _yscale:170});
    TweenLite.to(magUp_mc, .75, {_alpha:0});
    TweenLite.to(magDown_mc, .75, {_alpha:25});
    magDown_btn._visible = true;
    pages_mc.onPress = function(){
    this.startDrag();
    pages_mc.onRelease = function(){
    this.stopDrag();
    pages_mc.onReleaseOutside = function(){
    this.stopDrag();
    pages_mc.useHandCursor = false;
    TweenLite.to(instr_mc, 1, {_alpha:100});
    magDown_btn.onRelease = function() {
    TweenLite.to(pages_mc, .25, {_x:0, _y:0, _xscale:100, _yscale:100});
    TweenLite.to(magUp_mc, .75, {_alpha:25});
    TweenLite.to(magDown_mc, .75, {_alpha:0});
    this._visible = false;
    magUp_btn._visible = true;
    pages_mc.onPress = function(){
    this.stopDrag();
    TweenLite.to(instr_mc, 1, {_alpha:0});
    I don't know how to turn drag off when I zoom out without using the onPress command, but I know that this is probably what is getting in the way of the button working?
    Thanks!

    One option is to make the background of the pages be the draggable parts rather than the movieclips that contain the pages and buttons.  That way, the buttons could be atop the background and not have their access blocked.
    Instead of coding the pages_mc, you would essentially have the background coded for the drag...
    pages_mc.bkgnd.onPress = function(){
        startDrag(this._parent);

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • Button no longer works when inside a Movie Clip?

    Again I turn to the almighty Adobe forums for help...
    So basically, I've had this problem for over a day now, and I've posted on Experts-Exchange.com... to no avail really.
    So here we go:
    I have a button in a Flash project I've made. It's used to jump to another place on the root timeline, labelled "Why". It used to work perfectly.
    I have now placed the button inside a movie clip (it has to be in an animated sequence), but now it no longer works. It appears to work fine, the rollover state works and all. But when clicked it does nothing.
    The code I use to work the buttons goes on the main timeline, the code for this button is:
    mc_anim_backdrops_menu.btn_subsection1.onRelease = function() {
    gotoAndStop("Why");
    _global.swfloaded = "";
    Why does it no longer work? and what can I do to fix it?
    The question is posted here over at Experts Exchange - http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Act ionScript/Q_24888850.html
    what we've tried there is tracing the problem. The code seems to be pointing to the right place, but none of the actual function works.. as you'll be able to see if you open up the attached file (and change it's extension from .txt to .fla to get it working)
    So would someone be able to open it up, have a look and tell me what's wrong? Because I'm stumped. And frustrated.

    My guess is that you have a scope problem. By putting the button inside a movieclip you have made the buttons scope the same as that clip.
    So if you add a trace inside the release event handler, what do you get?
    trace("My current scope is: "+this);
    I'm guessing it is "_level0.mc_anim_backdrops_menu," right?
    So since you are using the global function of gotoAndPlay() it is looking for that label in the current timeline and not finding it.
    You should probably use the MovieClip method and specifiy which timeline it should look in.
    _root.gotoAndPlay("Why");
    _level0.gotoAndPlay("Why")
    _parent.gotoAndPlay("Why");
    both would probably work. I would never use the first two, other than to make sure that there wasn't something else going on...

  • Movie clip inside a movie clip

    Hi everybody,
    I'm creating a slideshow with Flash, like the  ones done with Powerpoint. I would like to create a movie clip inside  another movie clip, that is, say I have a clip called button1, and when I  click it, frame number 2 in this clip is displayed, and then more  information appears. Inside this frame 2, there are other clips, for  example an X button to close and return to frame number 1 in the clip  button1, as the image shows:
    What I have done is convert the button1 text into a movie  clip, and assign an action to it:
    on (press){
        gotoAndStop(2);
    When frame 2 is displayed, I would like to  click to the X-button to get back to frame number1, so what I've done  is, again, convert it into a movie clip and assign the following action:
    on (press){
        _root.gotoAndStop(1);
    But this doesn't work. I've been trying as  well changing other things, but no way... At first I thought it had  something to do with the _root or _parent, but now it looks as when  using gotoAndStop in the "parent" button (button1), no actions work for  the "child" buttons.
    I've loaded the fla and the swf files here, just in case  someone would like to check.
    Thank you very much in advance for your help.  I've been checking other posts, but apparently I couldn't find the  appropriate info.

    "_root" is only used to reference the very first level of your flash file. Right now you are telling flash to go to the second frame in your root timeline but you want to go to the second frame in your button1 timeline.
    Change the code that is on the X-button to
    on(press){
         gotoAndStop(1);
    Remove the "_root" and it should work.
    If it still doesn't work, make sure the button has an instance name of "button1" and use this code.
    on(press){
         _root.button1.gotoAndStop(1);
    This is using "_root.button1" as the 'address' of your movieclip and it wont matter where the code is.

  • Going Back to the main frame, from inside a movie clip time line.

    In flash CS5 I want to go back to the main time line, from inside a movie clip button, so when i click the the movie clip it goes to another frame on the main time line..
    Can anyone help me?
    Thanks
    Daniel Derrick

    your can use _root to reference the main timeline from anywhere though that can lead to problems if your swf is loaded by another swf.  because of that eventuality, it would be better to use a relative path back to the main timeline.
    so, from a movieclip's timeline (when the movieclip is on the main timeline), you can use _parent to reference the main timeline.
    but even better would be to use no code on that movieclip's timeline and keep all your code on one timeline (the main one).

  • Button inside a movie clip

    Ok, i'm new at action script so i have a problem
    I have a sound inside a movie clip (sound_MC) in the main
    timeline, and i have another movie clip with a button inside, and I
    need that button to control that sound movie clip
    on (release) {
    gotoAndStop("off_radio"); // this goes to another frame in
    the movieclip with the button (works fine)
    on (release) {
    _root.gotoAndPlay("stop_loop"); // this goes to another
    frame of the sound MC (doesn't work)
    // i have this in the stop button
    on (release) {
    gotoAndStop("on_radio");
    on (release) {
    _root.gotoAndPlay("start_loop");
    // and this for the play button
    whats the code for that ?
    what should i do?

    i solve the problem !! :-D
    but now i hold like to now how i make a fade out sound
    command when i enter a frame and a fade in when i enter in another
    frame
    here are the examples:
    http://tubo_centeno.web.simplesnet.pt/problem/problem.html
    http://tubo_centeno.web.simplesnet.pt/problem/problem.fla
    can anyone help me?

  • Next/previous inside the movie Clip.

    Hi,
    I try to made Next/previous inside the movie Clip.But When I try to this next previous animation inside movie clip but not working.
    I have attached both sample files.
    The files are on following link:
    http://www.4shared.com/file/125612766/28c58a99/fla.html

    your code was _root.gotoAndStop(contor+1); but your root level only had 1 frame. I took out the "_root." and it worked fine. Here is the working file.

  • How to detect when 2 movie clips have been clicked?

    Hello:
    I'd like to know how can I detect when 2 movie clips have been clicked (irregardles of the order).
    What I have is this:
    In my main timeline I have 2 independent movie clips (mc_him and mc_her) each in it's own layer that, when clicked, play an internal animation without moving my main playhead anywhere. What I need to do is, once they are both clicked (as I said, it doesen't matter in what order), a button that sends me to another section of my movie has to appear. It really doesen't matter if the button shows by enabling it with alpha or by sending me to a specific frame where my button lies. What I need to detect is both clicks so that the button shows up.
    How can I achieve this?
    Thank you very much.

    btn1.onRelease=function(){
    // do whatever
    this.clicked = true;
    checkBothClickedF();
    btn2.onRelease=function(){
    // do whatever
    this.clicked = true;
    checkBothClickedF();
    function checkBothClickedF():Void{
    if(btn1.clicked&&btn2.clicked){
    // do something. both clicked
    // reset both clicked properties?

  • TextArea link inside a move clip

    The actionscript calls textArea to have a rollover action and
    then link to another site when released. However when placed inside
    a movie clip the rollOver works but not the link. I need someone to
    tell me what syntax I'm missing. It's gotta be possible.
    Please help.
    Here's the Code:
    var feature_styles:TextField.StyleSheet = new
    TextField.StyleSheet();
    feature_styles.setStyle("backgroundColor", 0x000000);
    feature_styles.setStyle("mainbody", {color: "#333333",
    fontFamily: "FFF Hero", fontSize: "8", display: "inline"});
    feature_styles.setStyle("a:link", {color: "#333333",
    fontFamily: "FFF Hero", fontSize: "8", display: "inline"});
    feature_styles.setStyle("a:hover", {color: "#FF0000"});
    background1_mc.textbox_1.links_1.label.condenseWhite=true;
    background1_mc.textbox_1.links_1.styleSheet = feature_styles;
    background1_mc.textbox_1.links_1.wordWrap = true;
    background1_mc.textbox_1.links_1.html = true;
    background1_mc.textbox_1.links_1.label.selectable=false;
    background1_mc.textbox_1.links_1.editable=false;
    background1_mc.textbox_1.links_1.vScrollPolicy = "off";
    background1_mc.textbox_1.links_1.hScrollPolicy = "off";
    background1_mc.textbox_1.links_1.embedFonts = true;
    background1_mc.textbox_1.links_1.text += "<a
    href=\"Fall08images/downloads/FALLOUT_1600x1200.jpg\"
    target=\"_blank\">1600 x 1200</a><br>";
    _global.styles.TextArea.setStyle("backgroundColor" , "none");
    _global.styles.TextArea.setStyle("borderStyle", "none");
    _global.styles.TextArea.setStyle("borderColor", "none");
    stop();

    Try:
    background1_mc.textbox_1.links_1.htmlText += "<a
    href=\"F...

  • Link a button inside a movie clip to a scene

    I am trying to link a button that is inside a movie clip to a scene. The button has the instance name "cosmetic_btn" and the scene is called "Cosmetic Treatments".
    On my main timeline I have the code:
    cosmetic_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndStop(1, "Cosmetic Treatments");
    And on the timeline inside the movie clip I have this code:
    MovieClip(root).gotoAndStop("Cosmetic Treatments");
    When I run the document I get the following error:
    Home, Layer 'actions', Frame 101, Line 1
    1120: Access of undefined property cosmetic_btn.
    I have the instance name "cosmetic_btn" set on the button so I am unsure what is wrong here?
    http://img600.imageshack.us/img600/3236/gp2g.png

    One other thing you should correct is to add a frame number/label for the line....
    MovieClip(root).gotoAndStop("Cosmetic Treatments");
    otherwise you are likely to get an error regarding there not being a frame with that label

  • How do i reference a movie clip instance name from inside child movie clips.

    I have a label I am referencing form a movie clip inside the movie clip which contains the "label_2."
    Here is the code I used:
    MovieClip(parent.parent).gotoAndPlay("return_2");
    Now I need to reference a instance name of a movie clip in side the same scene.
    What would the code be?

    You should probably start by reading the docs and/or google:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7fca.html
    http://www.google.com/search?hl=en&q=AS3+events
    Once you got the basics down, look into creating/using your own custom events:
    http://www.google.com/search?hl=en&q=AS3++custom+events
    http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html
    Event dispatching and event handling is one of the most important things about ActionScript. The sooner you get into them, the better.

  • Option to move files rather than to copy them in "consolidate Project"

    The option to move files rather than to copy them in "consolidate Project" seems to be missing in LPX. Bummer. Am I missing something?

    Hello Darlene.
    I don't know if this is what you want, but you may try configuring your applications screen to handle specific file types in a way you prefer:
    https://support.mozilla.com/en-US/kb/Options+window+-+Applications+panel

  • Forcing onPress to react on the exact shape, rather then on the bounding box

    If I have a clip with an imported image then clip.onPress
    reacts on the
    bounding box of the clip rather then on the exact shape of
    the imported
    image even if the imported image has a transparent
    background.
    To make it to react to in image shape only I have to use
    Trace BitMap which
    results in deterioration of the image quality and if the clip
    is moving,
    Trace BitMap also slows down computer perfprmance.
    Is there other technique to make onPress to react on the
    exact shape, rather
    then on the bounding box?

    An image is always rectangular, it just may have transparent
    parts. So an MC containing an image is always as big as the whole
    image (at least).
    You could use the MovieClip.hitArea property, and create
    another MC inside your clip that specifies the active area for
    mouse clicks. This is easy if you have the image loaded into the
    clip inside the Flash IDE.
    If it's loaded on runtime, you might use the BitmapData class
    (if you use Flash 8) to get the pixel value of the image at the
    position where the image was clicked, check if it's transparent or
    opaque, and decide whether to call the onPress action or not.
    hth,
    blemmo

  • Flash CS4 Link to a Movie Clip from inside another Movie Clip

    I am working on a Flash CS4 project which has 5 buttons with 5 corresponding movie clips all on the main timeline. Everything in functional so far.
    My problem is this: I want to be able to mouse click on a particular word in the text inside movie clip 4 ("mc4") and have it link to movie clip 3 ("mc3") (on the main timeline).
    I've tried many things, and I can't get it working.
    I have tried to highlight the word then link it to "mc3" in the properties panel where it says link (I successfully linked to an email address and to an outside website in other parts of the project)....
    I tried to link it in the properties panel to "mc3", I tried & "parent.mc3", "root.mc3";
    Linking it this ways seems to be the simplest, logical thing to do, but I don't know what kind of prefix it needs.
    Then, I tried making the word (inside mc4) an invisible button (button6) then linking it to the mc3, with it's actionscript in the main timeline with the other button functions.
    I tried duplicating mc3 and duplicating invisible button 3 and moving it's hotspot to over the word.
    I tried putting a copy of mc3 and the button inside mc4, with the actionscript also inside mc4.
    I tried duplicating mc3 and calling it mc6, and putting that inside mc4, with the actions back on the main timeline, and tried again with the actions inside mc4.
    I tried with mc6 and invisible button 6 on the main timeline, but that doesn't seem possible.
    I tried using this code from Adobe Actionscript 3.0:
    button6.addEventListener(MouseEvent.CLICK, startMovie);
    function startMovie(e:MouseEvent):void
            this.play(&quot;mc6&quot;); [and I also tried with &quot;mc3&quot;]
    Nothing works!! Please, I would appreciate any suggestions!!
    Thanks,
    Suzanne

    If I limit my attention to the second sentence of your posting, then I suggest the following (borrowing from the rest of your posting)...
    If that invisible button6 is inside MC3 (on MC3's main timeline), atop the word you are trying to link to the movieclip, and you just want to make mc4 play by clicking that invisible button6, then assign the following code to the button6 inside MC3...
    button6.addEventListener(MouseEvent.CLICK, startMovie);
    function startMovie(e:MouseEvent):void
            MovieClip(this.parent).MC4.play();
    If I missed, then I missed following your explanation.

Maybe you are looking for

  • Problems opening project in CS5

    Hi all, I've been working on a CS5 project for 6 months. 2 weeks ago I tried to open the project and Premiere hanged when loading media. I have load the project closing the the opened sequences while loading the media files, but when I try to open an

  • How to send a JSP file in a MAU patch

    Hi friends, We need to send a patch for enhancement, which contains classes and a JSP file also.  So, we know how to send class files, but we are not aware of how to send a JSP file in the patch. Please help us if anybody know this. Thanks & Regards,

  • JDBC for Microsoft SQL Server 2000

    Hello, I have installed Microsoft SQL Server 2000 to establish a connection with JDK 1.4.1 and run the following code: import java.sql.Connection.*; import java.sql.*; public class Connect private java.sql.Connection con = null; private final String

  • Consider costs when implementing SQL server cluster.

    Hi, I had this question on an interview and i would like to have your opinion. When designing a cluster environment (Windows cluster i.c.m with SQL cluster). It is never Available/Available but Available/Not Available. How can i work cost effective a

  • Private Browser - Sign-in to separate Browser settings for different people

    I am the main user of my computer at work. However, other people use it too (unfortunately with my same login! not ideal but I don't have a choice). I'd like to use Firefox as my main browser but want my settings to be my own private settings - inclu