A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: load swf and goto a frame

  1. #1
    Member
    Join Date
    Apr 2001
    Posts
    35
    simple probably but i cant get it to work.

    use the loadMovNum to load an swf to level 0 (not into a MC)and at the same time tell it to start playing from a specific frame. i tried this


    loadMovieNum ("my.swf",0);
    _level0.gotoAndPlay(10);

    and it doesn't seem to work

    thanks in advance!

  2. #2
    Keeper of ubiquity bm289's Avatar
    Join Date
    Jun 2001
    Posts
    84

    try this

    try this instead of your code..it might be the problem?!?

    loadMovieNum("myswf.swf",1);
    _level1.gotoAndPlay(10);

    I think, not sure it has been awhile since i've used 0 as a level for an actual clip, but i think that _level0 is a null level. Used mainly to kick off the clip. Like i said i may be wrong. Flame if you want.


  3. #3
    couldnt you put the gotoAndPlay() code in the loaded movie clip, that would make it real easy...if not then you could do something like this which, as a concept, is quite useful for many aplications:


    when you push the button that you want to load the MC into (eg: _root) also add the line:

    _root.MCgo = "frame6";

    so the button code should lok like this:

    on(press)
    {
    loadMovieNum ("my.swf",_root);
    _root.MCgo = "frame6";
    }


    now inside the loaded movie clip add this if statement on the first frame:

    if (_root.MCgo == "frame6")
    {gotoAndPlay(6);
    }

    i use the _root to kepe the variable easy to reach and so it doesnt get confused with path names and stuff


    does that work for ya?


    -dave sharek


  4. #4
    Member
    Join Date
    Apr 2001
    Posts
    35

    still doesn't work

    i'm not loading into a movie clip or wanting to control a movie clip. i want to goto a frame on the main timeline of a swf that i'm loading into an existing swf. this occurs not on a button event but on a frame loaded event.

    Make sense basically i need to know how to load an swf onto the current level and start playing from a frame other than #1.

    thanks again!

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