7 Replies Latest reply: Aug 14, 2012 11:56 AM by kglad RSS

    when object is remove then it can't create again

    Amit Shakya Community Member

      Hi there is an problem I can't understand why this is happening

       

      when user send one string to video class then this creates object for that request, if again user send same request then it can't create object.

       

      see www.fltech.in/tab2

       

      1) Click on any product,

      2) then guy stands and ask something

      3) after that youtube video will appear <skip that>

      4) you will see the form

      5) fill that form or you can leave that as it is click on close button,

      6) click on same product which you click last time <<< ERROR HERE

       

      here is my video class

       

      ///////////////////////////////////

      package code {

                import flash.display.MovieClip;

                import code.walktv;

                import code.walkcamera;

                import code.walklaptop;

                import code.walkphone;

       

                public class allvideos extends MovieClip{

                          private var video:MovieClip

       

                          public function allvideos() {

       

                          }

       

                          public function playvideo(str:String):void{ <<<this function plays videos

       

                                    if(str=='tv'){

                                              video=new walktv()

                                              addChild(video)

                                              video.x=502;

                                              video.y=-51;

                                    }else if(str=='phone'){

                                              video=new walkphone()

                                              addChild(video)

                                              video.x=425

                                              video.y=-67

                                    }else if(str=='camera'){

                                              video=new walkcamera()

                                              addChild(video)

                                              video.x=503

                                              video.y=-48

                                    }else if(str=='laptop'){

                                              video=new walklaptop()

                                              addChild(video)

                                              video.x=500

                                              video.y=-84

                                    }

                          }

       

                          public function continuevideo(){

                                    video.play()

                          }

       

                          public function stopvideo():void{

                                    video.stop()

                                    removeChild(video)

       

       

                                    MovieClip(parent).gotoAndStop('reset')

                          }

                }

      }