Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-09-2008, 02:59 PM   PM User | #1
JeremyH
New Coder

 
Join Date: Mar 2006
Location: Denver, CO
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
JeremyH is an unknown quantity at this point
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
JeremyH is offline   Reply With Quote
Old 09-09-2008, 04:48 PM   PM User | #2
Kirl
Regular Coder

 
Join Date: Jan 2006
Posts: 243
Thanks: 14
Thanked 2 Times in 2 Posts
Kirl is on a distinguished road
Not sure if I understand completely, but have you tried "movie.swapDepths(5)"?
Kirl is offline   Reply With Quote
Old 09-09-2008, 05:49 PM   PM User | #3
JeremyH
New Coder

 
Join Date: Mar 2006
Location: Denver, CO
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
JeremyH is an unknown quantity at this point
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.
JeremyH is offline   Reply With Quote
Old 09-09-2008, 08:29 PM   PM User | #4
Kirl
Regular Coder

 
Join Date: Jan 2006
Posts: 243
Thanks: 14
Thanked 2 Times in 2 Posts
Kirl is on a distinguished road
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.
Kirl is offline   Reply With Quote
Old 09-09-2008, 09:16 PM   PM User | #5
JeremyH
New Coder

 
Join Date: Mar 2006
Location: Denver, CO
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
JeremyH is an unknown quantity at this point
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
JeremyH is offline   Reply With Quote
Old 09-10-2008, 01:07 PM   PM User | #6
Kirl
Regular Coder

 
Join Date: Jan 2006
Posts: 243
Thanks: 14
Thanked 2 Times in 2 Posts
Kirl is on a distinguished road
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.
Kirl is offline   Reply With Quote
Old 09-10-2008, 05:12 PM   PM User | #7
JeremyH
New Coder

 
Join Date: Mar 2006
Location: Denver, CO
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
JeremyH is an unknown quantity at this point
(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.
JeremyH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:26 PM.


Advertisement
Log in to turn off these ads.