A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: loading individual movieclips

  1. #1
    Junior Member
    Join Date
    Dec 2002
    Posts
    29

    loading individual movieclips

    Is it possible to have two movie clips but load them individually? If so, How?

    halfeaten

  2. #2
    Member
    Join Date
    Nov 2002
    Location
    at the corner of flotsam & jetsam, just within the walls of reality
    Posts
    91
    are you trying to do something where you click on a button and it causes a movie clip to load?

    if so, yes... you can either do attachMovie, if your symbol is in the library of this movie (.fla) or loadMovie, if you're trying to load an external movie (.swf).

    so, a sample might be:

    thisButton.onEnterFrame = function(){
    this.onPress = function(){
    _root.createEmptyMovieClip("nuMovie",1);
    _root.nuMovie.attachMovie("ball","ball_mc",2);
    _root.nuMovie._x = 0;
    _root.nuMovie._y = 0;
    }
    }

    where you have a symbol on the stage whose instance name = thisButton. this code would have been written on an actions layer. so, this AS is saying, "when the movie is loaded, watch for the following actions that may be applied to thisButton."

    if the user presses on thisButton, an empty movie clip will be created and the symbol that has a linkName = ball will be added to the stage. this will then be given an instance name of ball_mc, and set to depth = 2. the last two root lines set the coordinates for ball_mc, in the case, the upper left hand corner of the stage.

    hope this helps. good luck.
    best,

    Mos
    wei wu wei

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