Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing movie level

    Is there a way to change the level of a movie that is already loaded?

    "base.swf" is my level 0 movie. On opening, I have a script loadMovie("map.swf", 10). On "map.swf" is a button with this script:

    on(release) {
    loadMovieNum("site.swf", 15);
    }

    "site.swf" is a large file so I would hate for the user to have to reaload it if they closed it but wanted to view it again. Instead of unloading the movie, I thought I could just change the level so it would sit below "map.swf" at level 5 so when the user hit the button again in "map.swf", the level would change again to level 15, putting it on top of "map.swf".

    I thought loadMovieNum("site.swf", 5) would change the movie level, putting it at a lower level than "map.swf" which is at 10. It didn't work.

    Is there a way to do this?

    I am no Flash genius, so if you have a different approach to this project, please share it.

    Thanks a lot!
    Jeremy

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Not sure if I understand completely, but have you tried "movie.swapDepths(5)"?

  • #3
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Kirl, I didn't know about swapDepths. After looking at some examples online, it looks like that will only work with movie clips within a movie. This link had more info:

    http://www.kirupa.com/developer/actionscript/depths.htm

    But I want to move a swf files among levels, not a movie clip. I wonder if what I want to do is even possible.

  • #4
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    So you want to swap the complete Flash movie with another flash movie?

    You can change depth (z-index) with css and javascript but I'm not sure if that's a good idea. If you don't want to have them load the file twice you might consider opening another window.

  • #5
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Kirl,

    You got me thinking about this some more. I think the root of my problem is that I want "site.swf" to remain in the cache so it can be called up quickly when the user hits the button to view it again.

    When I test my movie (with Simulate Download) I can tell that unloadMovie removes it from the cache because "site.swf" has to completely reload. What method would keep a previously loaded movie in the cache?

    Jeremy

  • #6
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    I'm not sure, can't you store it in another variable before unloading? If you load it into Flash, you should be able to save it as some kind of variable, so you can call it later without downloading again.

  • #7
    New Coder
    Join Date
    Mar 2006
    Location
    Denver, CO
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    (this reply keeps getting eaten up, so here is my 3rd retype...)

    I think the problem was that the Simulate Download setting made it look like my "site.swf" files would need to completely reload each time a button is clicked to open them. On the Adobe forum, I read that the images in those swf's should be cached by the browser and will open quickly on revisits. I'll upload and see how my project works in the real world.

    Thanks, Kirl, for your help. I guess this was aconfusing post.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •