A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: How do I insert a Flash Movie in another w/ buttons?

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Posts
    4

    How do I insert a Flash Movie in another w/ buttons?

    Hey,

    I have inserted a Flash Movie (Flash Movie #2) as an object in my Flash Movie (Flash Movie #1). In Flash Movie #2 there are buttons which when clicked load another movie (Flash Movie #3). I want it to load where Flash Movie #2 is. I set the levels to 0, but clicking the button does nothing. Any ideas? Thanks.

    BJ Watts
    [email protected]

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    I set the levels to 0.

    -> The main movie must be level 0, in your case movie 1.

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Posts
    4

    Levels?

    The buttons in Movie #2 reference Level 0. This replaces the main movie (Flash Movie #1). I don't want this. I want to load the new movie in Movie # 2.

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    I would import movie 2 into a level (_level1) rather than import as an object, and then from that movie have the button do something like this:

    on(click){
    loadMovie("movie3.swf","_level1");
    }

    this assumes movie 2 is loaded into _level1

    Hilary

    --

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    Likewise you could also use load Movie AS with to target the MC (Object).

    loadMovie("uri","Name of MC");

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    I have created an Example and included it.
    Attached Files Attached Files

  7. #7
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890

    Re: How do I insert a Flash Movie in another w/ buttons?

    Originally posted by bjwatts
    I want it to load where Flash Movie #2 is.
    BJ Watts
    In this case you must add this script for the button from "Movie2":

    on(click){
    _root.movie2.loadMovie("movie3.swf","_self");
    }


  8. #8
    MaD Member : )
    Join Date
    Oct 2002
    Posts
    28
    I have been wondering how to do this and the example helped, but how do i set where the movie pops up??

    TriX

  9. #9
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Originally posted by trixter2
    I have been wondering how to do this and the example helped, but how do i set where the movie pops up??
    TriX
    The Movie3 left-upper corner will be the Movie2 center.
    (all you have to do is to set the Movie2 center)
    p.s.
    You can check my "KOOL STUFF/DEMO" section to see how it works.
    Last edited by necromanthus; 12-07-2002 at 01:58 AM.

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    In my example it loads into MC1. Wherever MC1 is the movie loads into it.

    You can actually target any MC to load a new movie into. Likewise you can target any _level also.

    A full explanation of this can be found in the MM TechNotes here http://www.macromedia.com/support/fl...ovie_clips.htm

    The Technote is for Flash 4 but the basic concepts are the same except you would no longer use tell target which was depreciated in Flash 4 but rather the Flash 5/MX dot syntax for targeting . The actual syntax is loadMovie(url [,location/target, variables]]);. KM adopts the Flash MX/5 AS Model (KM Supports just about all of the Flash 5 model in 3.5 and 3.6 will support all of the Flash 5 model and a good portion of the MX Model) and just about completly Ignores the Flash 4 Model although some very limited support is included. Likewise Support for the Flash 2 Action Model is supported.

    The Unsuported Model Syntax is Pascal like and is programatically signifigantly different than the Flash 5/MX Model.

    The Flash 5/MX model is built around ECMA(262) - Standardized Javascript for those of you who don't know that. In Fact the Flash 5 model is 95% ECMA with its own DOM. ECMAscript is an object based language very loosly based on C++ Concepts.

    Becuase The two models are programatically signifigantly different instead of implementing both and increasing bloat only the Flash 5/MX Model is supported.

    This is important to remember when doing tutorials online as Flash MX and Flash 5 will still execute the Flash 4 Syntax and thus you must convert the depreciated Syntax to the new Model.

  11. #11
    MaD Member : )
    Join Date
    Oct 2002
    Posts
    28
    Thanks guys, I have two more questions to ask you though. How do you make the the movie that the button loads a smaller size through actionscript, i want to know this because it is going out the side of the screen.

    Also, How do i make my other shapes to appear ontop of the movie not below, because the movie is covering everything else.

    TriX.

  12. #12
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    How do you make the the movie that the button loads a smaller size through actionscript, i want to know this because it is going out the side of the screen.

    on(click){
    _root.movie2.loadMovie("movie3.swf","_self");
    }
    _root.movie2._xscale = xval;
    _root.movie2._yscale = yval;

    (set xval & yval as you wish,but smaller than 100)

    How do i make my other shapes to appear ontop of the movie not below, because the movie is covering everything else.

    1)Convert the shapes into movies.
    2)add this script for each one:

    onClipEvent(load){
    this.duplicateMovieClip("clone1",10);
    this.duplicateMovieClip("clone2",11);
    ...
    }

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