I've been trying to get this script working, to no avail. How do I
allow the system to show me the material's loading progress.

This is basically what I have at the moment.

function loadbmp () {
                        mainmat=new BitmapFileMaterial(root["loadfilename"]);
                        TopScreen.visible = true;
                        mainmat.addOnLaodProgress(lodProg);
                        mainmat.addOnLoadSuccess(loadedmats);
                        mainmat.addOnLoadError(errlod);
                }

                loadbmp();

                TopScreen.lods.scaleX = 0;
                if (root["loadfilename2"] != "") {
                        mainmat2=new BitmapFileMaterial(root["loadfilename2"]);
                        mainmat2.addOnLoadSuccess(loadedmats2);
                }

                function errlod(event):void {
                        trace("loaderrors");
                        TopScreen.visible = false;
                }

                function lodProg(event:ProgressEvent):void {
                        var percentLoadedi:Number = 
event.bytesLoaded/event.bytesTotal;
                        percentLoadedi = Math.round(percentLoadedi * 100);
                        TopScreen.lods.scaleX = percentLoadedi;
                        trace(percentLoadedi);
                }

                function loadedmats(event):void {
                        TopScreen.visible = false;
                        root["focusOn"].origMat = mainmat;
                        (root["focusOn"].plane as Mesh).material = mainmat;
                }
                function loadedmats2(event):void {
                        root["focusOn"].omaterial = mainmat2;
                        root["focusOn"].makerollover = true;
                }

Reply via email to