Two movie, actionscript interaction

I have a 136k flash file (call it PK) that is to act as an intro to a 720k flash site (SK). I would like to have PK play while SK is loading so I put PK on a separate layer on top of SK using Dreamweaver. My question is how to get these seperate movies to:\r\rA: recognize each other\rB: have SK remove PK when SK is fully loaded or have PK remove itself\r\rAny advice would be helpful\r\rSynista

Whoa! That is a huge file… anyway, here it goes:\r\rIs PK a separate swf file? If so, go to SK and insert an empty scene before everything else. In this scene, add three frames. You won’t need to add any objects, just actionscript. So in the first frame, enter the following code:\r\rloadMovie(“PK.swf”, this);\r\rBasically it loads PK into this scene and it will get played until the rest of the site is loaded. Now go to the third frame and enter this actionscript:\r\rif (_root.getBytesLoaded() != _root.getBytesTotal()) {\r&nbsp &nbsp &nbsp &nbsp gotoAndPlay(2);\r} else {\r&nbsp &nbsp &nbsp &nbsp nextScene();\r}\r\rThis checks to see if the movie is all loaded and plays it when it is.

I suggest redoing that site and making it smaller and using LoadMovie. Just a suggestion. 720 is huge. too huge…

I do have a preloader already on there which is just a percent bar and text that says loading please wait. That takes up frames 1-9. I made a loop and the percent bar using script on another post on here. Here is the script on that:\r\rtotalK = getBytesTotal()/1000;\rloadedK = getBytesLoaded()/1000;\rremainingK = totalK-loadedK;\rpercentageK = (loadedK/totalK)*100;\rsetProperty (“bar”, _xscale, percentageK);\rif (loadedK>=totalK && totalK != 0) {\r gotoAndPlay (10);\r}\r\rWhere should I place the script you recommended? Somewhere in this preloader? I would like to be able to show how much time is left before SK is loaded while they watch PK.\r\rAlso I know that you can use dynamic text to show bytes loaded and bytes remaining and so forth but dynamic text boxes seem to have a white background instead of the transparent bkgrnd of regular text.

This site is an 8 page business site. How would you suggest I make it smaller? Are you sayin I should I have used the loadmovie fuction to load each page as a separate swf file?\r\rSynista

when renni girl says insert an empty scene, does she mean just a layer with nothing actually drawn on the stage, with as she said three frames in the timeline with the script in?\rI think I’m right?\r\rAlso I was asked to look at a site that was 1500k the other day. I waited forever and the thing never loaded in the end!

Yikes - it’s a business site! If so, I highly highly suggest you get the file size down! I have a flash site that has multiple sections and lots of animation but the main interface is only 54K. The main parts of the site are broken up into feasibly-sized pieces, but the whole size of the site doesn’t come near 200K. And this is an art site, not a business site.\r\rNow it’s ok to have a huge site - I have waited for huge sites to load before, but I must honestly tell you that the longer the wait - the higher my expectations are. If it’s bigger than 200 K, I’m expecting to see top of the line animation and imported art pieces (ie:, a huge download, but check out the artwork)! Anything falling short runs the risk of losing business. It’s just a thought.\r\rHow to shave it down: I could be wrong about this, but I’m willing to guess that you might have a lot of needless animation and effects going on in your flash site. Take a look at it and ask yourself what is the most pertinent animations and information. Yes, take advantage of the loadMovieclip feature, but the total size of swfs downloaded shouldn’t exceed, 300ish K (for a business site). Find ways to simplify your scripts by creating functions and having a neatly organized swf wouldn’t hurt you either. I know this isn’t what your main concern was but if you want more help on this, give me a link to the project and I’ll give you a hand.\r\rLobstars - yup, you’re right on the money! Completely empty stage with the Actionscript residing on the timeline, I recommend on a layer entitled “Scripts” or “Actions.” It’s good to put all your actions in the same place so you don’t go nuts trying to remember where you put it.\r\rBut you can still have the movie and your bar preloader working harmoniously together while the whole thing loads. Just do the following: create a movie clip, make it completely empty but add the loadMovie scripts as instructed above. Create a new layer on the main timeline (where the preloader is) and place an instance of the movie clip onto this new layer. Don’t put anything else on this layer but the clip. According to your preloder, when the SK is fully loaded, it goes to frame 10 and that’s when PK should disappear from the stage and from your life. So at frame 10, make sure you enter an empty keyframe on the layer containing the PK movie clip, so the PK movie clip should span only from frames 1-9.

yay hay :slight_smile: thanks renni, that has explained that nicely for me! I was sort of sure how to do that, but! and it was a preety big but!, I wasn’t certain…\rThanks again, I’m chuffed with that :wink: \rSimon

unfortunately I am a rookie at this flash thing so I don’t know how to make my animations more “economical”. I also have not put the site up on the web. I would be glad to email it to you so you can help me. Also, renni, if you have some sort of IM that would be a little easier than the post.\r\rSynista

It’s totally ok if you’re a “rookie at this flash thing.” We’ve all been there of course. You just might not want to promote a professional business site using Flash while you are still learning it. And making a professional flash site is hard to accomplish (I know I can’t do it, so I avoid it whenever possible). You can reach me via AIM: RenaissanceGerl.

I suggest more practice. I’m sure that your site can be cut to at least 1/4 the size if you use actionscript where ever necessary. Many times tweening can be replaced by actionscript and this cuts down the file size dramatically. If you aren’t all the good with actionscript I suggest you try some tutorials on this site and then just go from there. Ask quesitons and post all you want here. Thats just too dam big of a site. I know that I, personally would not wait for that to load.

Well my AIM ID is tml1200. Who ever would like to help please hit me up.