A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to close a "pop-up image"

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    4
    I've been looking all around for a tutorial on the following topic: how do you close pop-up images (don't have a better description for it I'm afraid).

    But if you don't know or aren't sure what I mean, take a look at what the guys at www.m-designers.com have.

    Go to the English section of their site and look at the opening screen. See the white X in the right upperhand corner with their latest news ? Click on it (it lights up in red) and this item is closed !!

    Well, that's what I need !! How do you do that ?

    Thanks to anyone (or all of you) that can help me out with this one.

    Werner

  2. #2
    There are 2 methods to closing a "popup". It depends on how they popped up.
    1) using Load and unLoad Movie
    2) using setProperty("MyMovieClip", _visible, false)

    USING LOAD AND UNLOAD MOVIE
    ---------------------------------------


    The following code will open a new movie:
    Code:
    on (release) {
      //popup.swf would be the file with the popup graphics
      //_level5 means it will load into level 5
      //NOTE: The base Level is 0: _level0
      loadMovie ( popup.swf, _level5 );
    }
    This will close the movie we just openned:(Like the X close box from the example you listed)
    Code:
    on (release) {
      // This unloads the file in level 5.
      unloadMovie ( level5 );
    
    }
    USING SetProperty
    ---------------------------------------
    The key to this method is to create your popup as a movie clip. The first thing we want to do is hide it until it is needed. The instance name in this example will be "MyMovieClip"

    Apply this code to the MovieClip:
    Code:
    onClipEvent(load) {
      setProperty("MyMovieClip, _visible, false");
    }
    Now we will use a button action to make it reappear:
    Code:
    on (release) {
      setProperty("MyMovieClip, _visible, true");
    }
    And we will use this to hide it:(Like the X close box from the example you listed)
    Code:
    on (release) {
      setProperty("MyMovieClip, _visible, false");
    }
    Hope this helps.

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