PDA

View Full Version : Project Structure ?s


vilehelm
12-08-2001, 01:47 PM
Ok i think i'm gonna break the long post rule but...

Working on a new project and am trying to make a few decisions and ferret out a few opinions and experience here. Simply put it'll be an ever expanding "Corporate capabilities" presentation. It will probably reside on a CD originally and then migrate to the web at some point as it starts to expand into areas that the CD should not cover. We'll be self burning very small #s of these 3 or so at a time.

The layout will be be a menuMC that calls sectionMCs to a place holder via attachMC or a menu .swf that switches content .swfs. I'm hung up on which way to go.

The MC method seems that it will get very large and that dosen't concern me with the CD but it does with the web later on. However I think that programming wise it might be easier and more elegant to do it this way.

The .swf switch method is more appealing for web performance as it only loads what you need. The problem that i'm running into this way is figuring out how to get one movie to exit while the other is called up. I get kinda clunky programming wise so don't giggle but what I'm considering doing is using a variable to determine which movie is up sending that file to the exit frame (which will probably animate out), reset the variable to the new selection and load that selection up...it sounds good in theory but my harebrained ideas sometimes do not work out so well.

Sorry to ask hypothetical questions but this is something that i'll have to work with a lot and i'm wanting to set up the structure that will be easiest to modify and work with.

Tink
12-08-2001, 03:59 PM
k i think i gotta break the worng post rule as well. i guess it is ok if it is neccessary?

Scene 1 name = preloader (has a frame label on frame 4 – preloaderloop)
Scene 2 name = main (has a frame label on frame 1 - first frame)
Intro.swf is an external swf

All on the main timeline (scene – preloader)

frame - blank
if (_root._framesloaded == _root._totalframes) { frames loaded = total frames (on root)
gotoAndPlay ("main", "startmain"); play the scene titled ‘main’
} else {
loadMovieNum ("intro.swf", 1); play the swf titled ‘intro’
}

frame 2 - blank
stop (); stops to let ‘intro.swf play. At the end of intro.swf in plays level 0 (this) and moves it to frame 3

frame 3 - blank
if (_root._framesloaded == _root._totalframes) { frames loaded = total frames (on root)
gotoAndPlay ("main", "startmain"); play the scene titled ‘main’
}

frame 4 – text and preloader start (frame label – preloaderloop)
framesLoaded = _level0._framesloaded; set variable of frames loaded
totalFrames = _level0._totalframes; set variable of total frames
percentLoaded = Math.round ((framesLoaded/totalFrames)*100 ); set variable of percent loaded
bar._xscale = percentloaded; scale progress bar on (x) axis by percent loaded

frame 5 – text and preloader loop
if (framesLoaded == totalFrames) { frames loaded = total frames (using variables)
gotoAndPlay ("main", 1); play the scene titled ‘main’ frame 1
} else {
gotoAndPlay ("preloaderloop"); play frame 4
}

to turn the preloader into an advanced bandwidth manager means splitting the main site up into more than one .swf. the preloader will look at the current levels .swf, and if that has loaded, loads the next one. Each loaded level is ‘parked’ at a blank first frame so it’s invisible, and the site only shows them (by running them with a play(); action) when the user requests them. If the user requests a .swf that hasn’t loaded, the manager discards the currently loading .swf, and starts loading the requested one, and restarts the loading od any missing .swf’s later.

To turn the preloader into this manager doesn’t take much (hint – try to do loop that carries on running untill all the levels are loaded fully. If the user forces the .swf to be run out of sequence, re-run the loop from the start again making sure that it skips any .swf.s that are already loaded).

i've not had a go at getting this working but it sounds like what you want (if you get it working please post it back). when someone calls a new swf. it will stop loading which ever and load the 1 that is needed. then go back to loading all the others. seems to me you don't want to unload the swf's just in case some1 goes back to them they will have to load them up again!

hope this helps

BLEEDA

vilehelm
12-08-2001, 11:00 PM
I hadn't thought about just leaving or moving the .swf rather than unloading it. Will that do anything to the overhead performance? Say if i get 10 or 20 sections going. I guess if they aren't doing anything they shouldn't affect performance that much...huh interesting. i think i've decided on hoing with the load movies rather than the attach MC. that seems like it's intended for smaller uses.

thanks, i'll let you know how it works.