dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Problem with exe - swf relationships

  1. #1
    Member
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    53

    Problem with exe - swf relationships

    Yes many posts have skirted around this one - basically I am setting up CD with an executable which calls swf's one at a time to play on main stage.

    Some of these swfs need to tell the exe to advance to next scene when they have finished playing.

    Is this possible?

    dman
    "Whether you believe you can or believe you can't, you are probably right"

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If you mean advance to the next SWF in your "playlist" of SWF files then yes, it is possible but you need to invoke some ActionScript magic to make it work. You'll have to replace the onEnterFrame for all movieclips with your own so you can watch _currentframe of the playing SWF. When _currentframe is equal to _totalframes then you want to load the next movie. To load the next movie, get the name of the playing movie (from _url), look that up in an XML file (your play list) and get the name that follows the current movie, load that movie and repeat...

  3. #3
    Member
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    53
    Thanks for the reply.

    It may technically require the same actions, but no, what I am trying to do is when the swf finishes, the exe that loaded it then continues, e.g.

    "mainstage.exe" is launched from CD, and scene 1 stops on Frame 1, and loads and plays MC "movie1.swf" which is a 400 frame MC.

    When "movie1.swf" gets to frame 400, it needs to tell "mainstage.exe" to go to scene 2. Scene 2 may not necesserily load more MC's.

    dman66
    "Whether you believe you can or believe you can't, you are probably right"

  4. #4
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If you have the source for movie1 then just add _parent.gotoAndPlay(2,1) to the last frame to tell the parent movie to goto to scene 2, frame 1. If you don't know where the clip will be loaded you can also say _level0.gotoAndPlay(2,1). In this case the loaded clip has to know something about the parent clip.

    If you don't have the source to movie1 then you need to monitor the _currentframe and _totalframes properties in the root onEnterFrame event and call gotoAndPlay to advance to the next scene when the loaded clip reaches the last frame.

  5. #5
    Member
    Join Date
    Mar 2003
    Location
    Melbourne
    Posts
    53
    Thanks, that works. You first solution will also come in handy!

    dman
    "Whether you believe you can or believe you can't, you are probably right"

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