A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: .visible or reset flash movie help! PLEASE!!!!

  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    64

    .visible or reset flash movie help! PLEASE!!!!

    hi all,

    i have a problem, and there are two ways i can think of solving it.

    in my scene using buttons i have managed to "dynamically" (if thats the word) load movieclips from the library which at start time were not present.

    i wish to remove these movieclips with a button called "start over" however i dont know what code to use.

    i tried the .visible thing but flash doesnt like that because the movieclips arent in the scene as yet. would it require an IF statement today?

    OR is there a code to reset the flash movie which would work as well. Im really stumped at the moment and i cant complete my project without this.

    i hope someone can help me thanks in advance

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    If you're using attachMovieClip, you can use removeMovieClip() to get rid of the clip...think that's what you're asking.

    Hope that helps!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    Member
    Join Date
    Feb 2004
    Posts
    64
    Hi, no im not using attach movie clip. the code is below. ive coded about 30 buttons to this code, so dont really wanna have to change it. Can you see a way of working with this?


    for an example button that brings on the movieclip:

    wallbut1.addEventListener(MouseEvent.CLICK, wallbut1Function);

    and its corresponding function is:

    function wallbut1Function (event:MouseEvent):void
    {
    var myVariableName:wallswhiteClass = new wallswhiteClass();
    this.addChild(myVariableName);

    myVariableName.x = 1190.1;
    myVariableName.y = 529.0;

    }


    so now i need a button to remove all or specific one OR reset the flash movie?

    cheers

  4. #4
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    I'm guessing that addChild is a custom function to create the instance of the clip? It has to use either duplicateMovieClip, loadMovieClip or attachMovieClip...I think those are about the only ways to get a new clip on the stage...you'll probably just need a way to implement some sort of removeChild function or remove all your variable names...hard to say without seeing wallswhiteClass
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center