A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loading a movie by a button on a previous frame

  1. #1
    Member
    Join Date
    Aug 2014
    Posts
    51

    loading a movie by a button on a previous frame

    Hi all,

    I am unable to resolve the following issue:-

    I have a main movie which loads another swf by using a button. The button is on a frame (25) prior to the frame (26) that holds the movie clip into which the swf is to be loaded.

    If I add this line of code
    Code:
    loadMovie("split_word.swf",holder_mc);
    directly on the frame where the holder_mc is located then it works fine. However, if I put it in a button on a previous frame and want to invoke it on a button press the movie does not load.

    How can I target the holder_mc from a frame other than on which it is loacted.

    Thanks.
    Attached Files Attached Files

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    That should be pretty obvious, it won't load into something that does not exist.

    Either span the empty movieclip across the two frames, or create an empty one on the press/release of the button before the load command.

  3. #3
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi fruitbeard,

    I know that my logic there as it is, is wrong. What I intend doing and tried to do as well (with a number of variations) was to declare a temp movieclip tmp_mc variable that will start to load the movie in the second frame so that once the "welcome" animations was over the movie would be loaded in tmp_mc. Then on button press, it goes the next frame which holds the holder_mc. This tmp_mc should be assigned to the holder_mc (since both are movies i guess they can be somehow equated) and made to play.

    I can put an invisible holder_mc and button on the same frame and do this but I would very much want to do it as above.

    I have torn my hair out trying to achieve this but could not. Please help.
    Thank you very much.

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    As I say, you can not load something into something that does not exist.

    If you are looking for preloader type things and/or more control over loading external files, then look into AS2 MovieClipLoader

  5. #5
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi fruitbeard,

    Thanks for the advice. No I am not looking for the preloader because my swf's are very small in size. Guess I am trying to achieve something which it seems is not possible. I think that the next best thing would be to put the button on the same frame as the holder_mc and make it invisible once clicked.

    Thanks Sir.

Tags for this Thread

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