A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Flash Easy Question

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    51

    Flash Easy Question

    Hi am was wondering when I load a movie into an empty MC...and it is in the foreground....how do you close the movie...or make it stop?

    Example: I have 3 menu options that come to the foreground with 75% transparency..there is a close button on the menu options but what action do I use to terminate the menu movies?

    Case

  2. #2
    I'm not sure how your set up is like, but maybe you can try something like this to unload the MC:
    PHP Code:
    containerMC.onRelease = function() {
        
    containerMC.unloadMovie();

    ContainerMC would be the instance name of the Movieclip you loaded your external movie into. Just place the function above on the frame that contains your movieclip and it should work. I also attached a sample file to help you as well, I hope that is what you're looking for.
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    51
    I load it into

    filesmovie = empty movie clip

    loadmovie ("files.swf",0)

    then I have a button a named closeMovie in files.swf

    that I want to close "files.swf"

    will this work?

    Case

  4. #4
    Hmmm....I've used a similar setup and this is the method I use cause I think it's easier. Instead of using a empty moviecip that is sitting on the stage, we'll use createEmptyMovieClip which will create a empty movieclip so that you can load your external swf into. So on the button that loads the external swf, apply this script:
    PHP Code:
    on (release){
        
    _root.createEmptyMovieClip("emptyMC"0)
        
    _root.emptyMC._x Stage.width/3;
        
    _root.emptyMC._y Stage.height/4;
        
    _root.emptyMC.loadMovie("files.swf")

    You can also specify the x and y cordinates to wherever you want the movieclip to appear on the stage.

    Now on your close button, apply this script:
    PHP Code:
    on (release) {
        
    _root.emptyMC.removeMovieClip();

    That will remove the movieclip you just created. I hope that was clear enough.

  5. #5
    Member
    Join Date
    Feb 2003
    Posts
    51
    Ok looks great,


    Thanks very much by the way....

    just one question.

    _root.emptyMC._x = Stage.width/3;
    _root.emptyMC._y = Stage.height/4;


    what are those defining?

    and where do I enter in the coordinates for the location...is that where?


    Thanks so much so far,

    Case

  6. #6
    Yeah, those define the x and y cordinates of where your movieclip will be placed. You can actually replace Stage.width/2 and Stage.width/4 with actual numbers instead. Something like this:

    _root.emptyMC._x = 50
    _root.emptyMC._y = 50

    Just play around and plug in different numbers and see what happens.

  7. #7
    Member
    Join Date
    Feb 2003
    Posts
    51
    It works great!
    Last edited by casenote; 02-24-2003 at 06:33 PM.

  8. #8
    Member
    Join Date
    Feb 2003
    Posts
    51
    Thank you so much for your fast responses...and great advice

  9. #9
    no problem.

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