Hi Daniel,

Flash CS3 ignores the Embed metadata tag, and CS4 requires some massaging.
Work-arounds for each are described at:
"http://www.flashmagazine.com/Tutorials/detail/using_flex_actionscript_files
_with_metadata_in_flash_cs3/"

HTH,

David Z

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of justaddice
Sent: Tuesday, July 28, 2009 9:17 PM
To: away3d.dev
Subject: [away3d] Preloader to show loading of meshes + textures.


Hi,

I'm using Flash with the 'document class' pointing at my code. I'd
like to make a pre-loader so that users don't just get a blank-white
screen while the swf loads. I've had a go at trying to implement a
standard-preloader, but as I'm using the document class feature in
Flash, things mess up.

Some (cut-down) code to illustratate what I've got so far:

public class ddGame extends Sprite
{

                [Embed(source="/../images/earth.jpg")] private var
EarthImage:Class;
                private var earthBitmap:Bitmap = new EarthImage();



                public var scene:Scene3D;
                private var camera:Camera3D;
                private var view:View3D;


                public function ddGame()
                {
                        // set up the stage
                        stage.align = StageAlign.TOP_LEFT;
                        stage.scaleMode = StageScaleMode.NO_SCALE;

                        // Add resize event listener
                        //stage.addEventListener(Event.RESIZE, onResize);

                        // Load in the pre-loader movie clip
                        mLoader = new mPreLoader();
                        addChild(mLoader);

                        // Trigger updates
                        this.addEventListener(Event.ENTER_FRAME, loading);


                        // Initialise
                        init3D();


                        // Create the 3D objects
                        createScene();

                        //  etc..
                }

                private function loading(e:Event):void
                {

                        var total:Number = this.stage.loaderInfo.bytesTotal;
                        var loaded:Number =
this.stage.loaderInfo.bytesLoaded;


                        mLoader.loader_txt.text =
Math.floor((loaded/total)*100)+ "%";

                        if (total == loaded)
                        {
                                this.addEventListener(Event.ENTER_FRAME,
loop);
                        }

                }
}


I've done searches for how to do this online, but nothing has come up.

Any help appretiated,

Cheers,

Daniel.


Reply via email to