This is an example that I want to play movie after clicked, when movie
are play finished move object to 100 pixel along x-axis
but in this example object are move instantly after clicked

package
{
        import away3d.cameras.*;
        import away3d.containers.View3D;
        import away3d.core.base.Mesh;
        import away3d.core.utils.Cast;
        import away3d.events.MouseEvent3D;
        import away3d.materials.*;
        import away3d.primitives.Plane;

        import flash.display.MovieClip;
        import flash.events.Event;

        import mx.core.UIComponent;
        public class Test extends UIComponent{

        [Embed("images/castle-03.swf")]
        private var swfMaterial:Class

        [Embed("images/boy1.png")]
        private var boyMat:Class

        private var view:View3D
        private var camera:Camera3D = new Camera3D()

        private var swf:MovieClip
        private var animeM:MovieMaterial
        private var sand_castle:Mesh

        public function Test(){
                        camera.moveBackward(500)

                        view = new View3D({camera:camera})
                        addChild(view)

                        sand_castle = new Plane( { width:300, height:280, 
segmentsW:10,
segmentsH:10 } )
                        var mt:BitmapMaterial = new 
BitmapMaterial(Cast.bitmap(boyMat))
                        sand_castle.material = mt
                        sand_castle.rotationX = 90
                        sand_castle.x = 400
                        sand_castle.y = -200
                        view.scene.addChild(sand_castle)

                        addEventListener(Event.ENTER_FRAME,renderer)
                        sand_castle.addOnMouseDown(mouseDown)
        }

        private function renderer(event:Event):void{

                if(swf)
                        if(swf.currentFrame >= swf.totalFrames){
                                trace("do something")
                                sand_castle.x = 100
                        }

                view.render()
        }private function mouseDown(e:MouseEvent3D):void{
                swf = new swfMaterial() as MovieClip;
                        animeM = new MovieMaterial(swf)
                        sand_castle.material = animeM
        }

        }
}

On Oct 27, 6:40 am, "Rob Bateman" <[EMAIL PROTECTED]> wrote:
> Hey mindmidday
>
> not sure what the problem is, would it be possible to send a test class or
> fla for debug purposes?
>
> Rob
>
> On Sat, Oct 25, 2008 at 3:16 AM, mindmidday <[EMAIL PROTECTED]> wrote:
>
> > I'm using "totalFrames" but I'm forget to press 's' key sorry :P
>
> > It didn't work
>
> > thank
>
> --
> Rob Bateman
> Flash Development & Consultancy
>
> [EMAIL PROTECTED]

Reply via email to