dcsimg
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Can a button effect another SWF???

  1. #1
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347

    Can a button effect another SWF???

    Hi i am trying to figure out how a button in one flash movie can effect (stop) a movie clip in another. Ive tried but i just cant figure this one out. Please help! Any help would be appriciated.

    Thanx!
    Austin Condiff

    endless possibilities

  2. #2
    Member
    Join Date
    Nov 2004
    Location
    Athens, Greece
    Posts
    96

    Yes you can

    The method is as below;
    You have the one.swf file playing at _level0. You then load the two.swf file from the first one using the loadMovie() or loadMovieNum() command. When using loadMovieNum() you have to define a level at which the second swf will be loaded. So you have _level0 with one.swf and _level1 with two.swf. You, then, can create on one.swf a button with the following code on (release) {_level1.stop()}.
    If you choose the loadMovie() you need to have on one.swf a movie clip with an instance name e.g holder, on which you can load two.swf. In this case your button should say on (release){holder.stop()}

  3. #3
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    ok, thanx for the help but what if i wanted to stop the movie at a certain place and then start it again when i click a different button? and i am kinda new with actionscript but i think i can do what you said in your previous post. i am loading a swf with a sound and the sound controlls in it to the origional movie. i want to stop an action (notes dancing to music) in a MC in the origional movie when i click the stop sound button in the movie i am loading to the origional movie.
    i am working with http://www.koathletics.com/band.html .

    thanx again!
    austin condiff
    Last edited by MadDog 555; 11-09-2004 at 01:07 PM.

    endless possibilities

  4. #4
    you should then be able to just add the instance name (e.g. holder) in the script:

    on(release) {
    _level1.holder.stop();
    }

    or if it not loaded into a leve but rather into a movie clip with an instance name (eg. holder1), then you'd use:

    on(release) {
    holder1.holder.stop();
    }

    i think that should be correct. if not, then don't listen to anything i just said.

  5. #5
    Member
    Join Date
    Sep 2003
    Location
    Chicago
    Posts
    38
    Similar to the post above. Give your movie and instance name (e. g. holder)

    For the play button on the main mc;

    on (release) {
    _root.holder.stopped = false;
    _root.holder.play();

    }


    For the Stop/or Pause button on the main mc;

    on (release) {
    _root.holder.stopped = true;
    _root.holder.stop();

    }
    That should do it.

  6. #6
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    its not doing it. take a look at the website. ive updated it with the sound controllers up in the top left hand corner. when you click on the stop button i want the notes to stop moving to the music. right now i have it so that the movie with the sound and sound controllers loads in after the notes drop in. the action that does that is in the MC with the notes. i think that kinda interferes with what you were trying to do. what do i do?

    thanx for the help!
    austin condiff

    the website is @ http://www.koathletics.com/band.html .

    endless possibilities

  7. #7
    Member
    Join Date
    Nov 2004
    Location
    Athens, Greece
    Posts
    96
    As I can understand your notes are on a different movieclip or level. You should stop it with the same button e.g. on(release){_level1.holder1.stop(); _level1.notesmc.stop();}
    or if you don't want your notes to pause _level1.notesmc.gotoAndStop(1).

  8. #8
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    ok, i have it so that the sound.swf is the main movie and on the main timeline, in that movie in the first frame, notes.swf loads into it. on the stop button i put "_level1.notesmc.gotoAndStop(1)" into actionscript and this doesnt work. i get an erroe message that says "Scene=Scene 1, Layer=Layer 4, Frame=109: Line 2: on handlers may not nest within other on handlers
    on (release) {" when i test the movie.
    what is wrong???
    i will post sound.fla at http://www.koathletics.com/sound.fla

    thanx for the help
    austin
    Last edited by MadDog 555; 11-10-2004 at 06:48 PM.

    endless possibilities

  9. #9
    Member
    Join Date
    Nov 2004
    Location
    Athens, Greece
    Posts
    96
    As I saw you have loaded an swf in level1 and that swf contains a movieclip (abbreviation: mc) which plays the notes. You must control the mc in level1. So it is _level1.movieclip.doanything().
    I shall post your fla with the correct actions.
    Last edited by zafeiris; 11-11-2004 at 07:30 AM.

  10. #10
    Member
    Join Date
    Nov 2004
    Location
    Athens, Greece
    Posts
    96
    Here is your fla.

  11. #11
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    the fla is not attached. upload it somewhere and give me the link. i think the file size is too big

    thanx
    austin

    endless possibilities

  12. #12
    Member
    Join Date
    Nov 2004
    Location
    Athens, Greece
    Posts
    96
    Since this is impossible copy the following actions:
    for the stop sound bt:
    on (release) {
    stopAllSounds();
    gotoAndStop(2);
    _level1.notes.gotoAndStop(1);
    }


    For the start sound bt:
    on (release) {
    gotoAndPlay(108);
    _level1.notes.gotoAndPlay(110);
    }

  13. #13
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    thanx alot! i got it.

    thanx for the help,
    austin condiff

    endless possibilities

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