I am trying only simple away3d

//********************************//

package
{
        import away3d.containers.Scene3D;
        import away3d.containers.View3D;
        import away3d.materials.ColorMaterial;
        import away3d.primitives.Sphere ;

        import flash.display.Sprite;

        public class away3dLoader extends Sprite
        {
                //private var pl:Plane;
                private var scn:Scene3D;
                private var vew:View3D;

                public function away3dLoader()
                {
                        var view:View3D = new View3D({x:200,y:200});
                        addChild(view);
                        var sphere:Sphere = new Sphere();
                        view.scene.addChild(sphere);
                        view.render();
                }
        }
}

//*******************************//

Loader class

//*******************************//
package
{

        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.net.URLRequest;



        public class swfLoader extends Sprite
        {
                //public var swfURL:String=null;
                private var square:Sprite;

                private var mLoader:Loader;

                public function swfLoader()
                {
                        stage.align=StageAlign.TOP_LEFT;
                        stage.scaleMode=StageScaleMode.NO_SCALE;

                        mLoader = new Loader();

                        
//http://www.123-banner.com/preview/p_rolling_100618.swf //http://
away3d.com/swfs/HelloWorld.swf
                        var mRequest:URLRequest = new 
URLRequest("away3dLoader.swf");


                        mLoader.load(mRequest);


                        addChild(mLoader);

                }

        }
}

//***************************************//

This works with Flex SDK 3.5

But Same code with Flex SDK 4 or above doesn't work.

//***************************************//


Please help me how to solve this problem. Thanks


On Jul 20, 5:33 pm, Michael Iv <[email protected]> wrote:
> To tell you the truth , I need to run this app on my PC in order to debug
> and see what is wrong.I don't have time right now.Do you use Flash Builder
> for dev? In Debug Window you can see what is the problem usually.If you have
> this problem till the end of the week ,then post me the source code and I
> will take a look.Or may be someone else here would help.
>
>
>
>
>
> On Tue, Jul 20, 2010 at 5:41 PM, Ali <[email protected]> wrote:
> > It downloads the file but didn't display or play it
>
> > On Jul 20, 4:39 pm, Ali <[email protected]> wrote:
> > > you are right Michael. But I am having problem with away3dlite swf
> > > file. I am not able to load it. Below is link that loads simple swf
> > > file and other is that loads away3dlite swf file. I don't know what I
> > > am doing wrong. Code is same as above just changed the file name.
>
> > > Loader for Simple SWFhttp://riyasatali.com/site/aw/swfLoader.html
>
> > > Same Loader for Away3d SWF doesn't workhttp://
> > riyasatali.com/site/aw/swfLoader1.html
>
> > > Away3dSWF Linkhttp://riyasatali.com/site/aw/startPage.html
>
> > > There must be something that I am missing please help. Thanks
>
> > > On Jul 20, 12:44 pm, Michael Iv <[email protected]> wrote:
>
> > > > SWF loading is the same as it is in every flash app. Eventually we are
> > in
> > > > Flash don't we ? ;)
>
> > > > Tried to look here?
> >http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/d...
>
> > > > On Tue, Jul 20, 2010 at 1:29 PM, Ali <[email protected]> wrote:
> > > > > Sorry dude but I thought may be there is any other way in away3dlite
> > > > > to load it's swf files.
>
> > > > > On Jul 20, 12:23 pm, Michael Iv <[email protected]> wrote:
> > > > > > Man , this is Away3D oriented playground. For General AS3 you can
> > inquire
> > > > > in
> > > > > > the billions of  other blogs and forums . :)
>
> > > > > > On Tue, Jul 20, 2010 at 1:18 PM, Ali <[email protected]> wrote:
> > > > > > > Hi gurus,
>
> > > > > > > I need help. I am trying to create loader class for loading my
> > > > > > > external swf files. This Class worked good for images but it
> > doesn't
> > > > > > > load swf. However it download the swf but doesn't display on
> > stage.
>
> > > > > > > Bellow is code for the class
>
> > > > > > > //*****************************************************//
>
> > > > > > > package
> > > > > > > {
>
> > > > > > >        import flash.display.Loader;
> > > > > > >        import flash.display.MovieClip;
> > > > > > >        import flash.display.Sprite;
> > > > > > >        import flash.display.Stage;
> > > > > > >        import flash.display.StageAlign;
> > > > > > >        import flash.display.StageScaleMode;
> > > > > > >        import flash.events.Event;
> > > > > > >        import flash.events.ProgressEvent;
> > > > > > >        import flash.events.TimerEvent;
> > > > > > >        import flash.net.URLRequest;
> > > > > > >        import flash.utils.Timer;
>
> > > > > > >        import org.osmf.display.ScaleMode;
>
> > > > > > >        [SWF(backgroundColor="#000000",frameRate=30)]
> > > > > > >        public class swfLoader extends Sprite
> > > > > > >        {
> > > > > > >                //public var swfURL:String=null;
> > > > > > >                private var square:Sprite;
> > > > > > >                private var tmr:Timer;
> > > > > > >                private var mLoader:Loader;
> > > > > > >                public function swfLoader()
> > > > > > >                {
>
> > > > > > >                        stage.align=StageAlign.TOP_LEFT;
> > > > > > >                        stage.scaleMode=StageScaleMode.NO_SCALE;
> > > > > > >                        square = new Sprite();
>
> > > > > > >                        mLoader = new Loader();
> > > > > > >                        var mRequest:URLRequest = new
> > > > > > > URLRequest("assets/test.swf");
> > > > > > >                        //var mRequest:URLRequest = new
> > > > > > > URLRequest("assets/bg.jpg"); //
> > > > > > > This is working
>
> > > > > > >  mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
> > > > > > > onCompleteHandler);
>
> >  mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
> > > > > > > onProgressHandler);
> > > > > > >                        mLoader.load(mRequest);
>
> > > > > > >                        addChild(square);
>
> > > > > > >                }
> > > > > > >                private function
> > onCompleteHandler(loadEvent:Event):void
> > > > > > >                {
>
> > > > > > >                        addChild(mLoader);
>
> > > > > > >                }
> > > > > > >                private function
> > > > > > > onProgressHandler(mProgress:ProgressEvent):void
> > > > > > >                {
> > > > > > >                        var percent:Number =
> > > > > > > mProgress.bytesLoaded/mProgress.bytesTotal;
> > > > > > >                        drawProgress(percent);
> > > > > > >                }
>
> > > > > > >                public function drawProgress(prg:Number):void{
>
> >  square.graphics.beginFill(0x00FFF);
>
> > > > > > >  square.graphics.drawRect(0,0,stage.stageWidth*(prg/100),10);
> > > > > > >                                square.graphics.endFill();
> > > > > > >                                square.x =
> > > > > > > stage.stageWidth/2-square.width/2;
> > > > > > >                                square.y = stage.stageHeight-10
>
> > > > > > >                }
> > > > > > >        }
> > > > > > > }
>
> > > > > > > //*****************************************************//
>
> > > > > > > Please tell me what I am doing wrong.
>
> > > > > > > Riyasat
>
> > > > > > --
> > > > > > Michael Ivanov ,Programmer
> > > > > > Neurotech Solutions Ltd.
> > > > > > Flex|Air
> > > > > |3D|Unity|www.neurotechresearch.comhttp://blog.alladvanced.nethttp://
> > > > >www.meetup.com/GO3D-Games-Opensource-3D/
> > > > > > Tel:054-4962254
> > > > > > [email protected]
> > > > > > [email protected]
>
> > > > --
> > > > Michael Ivanov ,Programmer
> > > > Neurotech Solutions Ltd.
> > > > Flex|Air
> > |3D|Unity|www.neurotechresearch.comhttp://blog.alladvanced.nethttp://www.meetup...
> > > > Tel:054-4962254
> > > > [email protected]
> > > > [email protected]
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air 
> |3D|Unity|www.neurotechresearch.comhttp://blog.alladvanced.nethttp://www.meetup.com/GO3D-Games-Opensource-3D/
> Tel:054-4962254
> [email protected]
> [email protected]

Reply via email to