I am a long time Director programer and have worked with numerous Director code guys to build very usesful Director behaviors to make programming easier. One behavior we have had created in the past is used to load External Casts of unlimited memebers applied in a single frame to a progress bar to show the load time of the cast. An example of one site we made using this behavior is http://www.frightflix.com (This site was made for a horror film company and is very graphic, so be warned!) The reason this behavior is invaluable to me is that I can apply it to a progress bar in one frame and quickly load an external cast of my choosing from a pulldown menu without writting any additional code. This can be applied the same way for every section of you site. This makes building huge, multiple section sites easy becasue you can load it as the viewer clicks on each section, thus making the site load quickly and easy to program. Here is the code for this behavior:
--- --#behavior --Copyright 2003, MediaMacros, Inc. --Version History --1/22/03 - Created property spriteNum property pMember property pId property pWhatCast, pRect on getPropertyDescriptionList me p = [:] l =  repeat with x = 1 to the number of castlibs if castlib(x).filename = the moviePath & the movieName then next repeat l.add(castlib(x).name) end repeat p[#pWhatCast] = [#format : #string, #comment : "What Cast", #default : "", #range : l] return p end on beginSprite me pRect = sprite(spriteNum).rect pMember = new(#bitmap, castlib "temp") pMember.image = image(pRect.width, pRect.height, 32) --preload it pId = preloadNetThing(castlib(pWhatCast).filename) me.showProgress() sprite(spriteNum).member = pMember sprite(spriteNum).rect = pRect end on exitFrame me if netDone(pId) then --set it castlib(pWhatCast).filename = castlib(pWhatCast).filename else me.showProgress() go the frame end if end on endSprite me sprite(spriteNum).member = 0 sprite(spriteNum).rect = 0 end on showProgress me s = getStreamStatus(pId) per = float(s[#bytessofar]) / max(1, s[#bytestotal]) pMember.image.fill(pMember.rect, rgb(0,0,0)) a = pMember.image.extractAlpha() a.fill(a.rect, rgb(255,255,255)) w = integer(pMember.width * .75) h = integer(min(20, max(5, pMember.height / 30.0))) r = MMI_CenterRect(rect(0,0,w,h), pMember.rect) pMember.image.fill(r + rect(-1,-1,1,1), rgb(200,200,200)) a.fill(r + rect(-1,-1,1,1), rgb(0,0,0)) rFill = rect(r, r, r + (w * per), r) pMember.image.fill(rFill, rgb(200,0,0)) a.fill(rFill, rgb(0,0,0)) pMember.image.setALpha(a) pMember.useALpha = 1 end ----
Now for my question. Can a behavior like this in Director MX 2004 be made to work in Flash 8 in a similar way? I have noticed that Flash 8 does not have external casts like Director, so that makes this a bit harder to concieve, but can a behavior be made to load multple library items in the same way? Or is there a way to make "external casts or libraries" in Flash 8?
The script above has proven it self time and again when building Director (Shockwave) sites and I really need the same ability in Flash 8. Can anyone help me??? Your help will be grealy appreciated and quite possibly rewarded.... within reason of course:)