Skip navigation
Currently Being Moderated

when object is remove then it can't create again

Aug 14, 2012 7:33 AM

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')

                    }

          }

}


 
Replies
  • kglad
    72,373 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 14, 2012 7:43 AM   in reply to Amit Shakya

    rewind your video and then play it

     
    |
    Mark as:
  • kglad
    72,373 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 14, 2012 8:15 AM   in reply to Amit Shakya

    show the code that does that.

     
    |
    Mark as:
  • kglad
    72,373 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 14, 2012 9:01 AM   in reply to Amit Shakya

    that's not rewinding the video.  use:

     

       public function stopvideo():void{

                                  video.gotoAndStop(1);

                                  removeChild(video)

     

     

                                  MovieClip(parent).gotoAndStop('reset')

                        }

     
    |
    Mark as:
  • kglad
    72,373 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 14, 2012 11:56 AM   in reply to Amit Shakya

    your last message doesn't make sense.

     

    the code i suggested will work unless you have other code that changes video's frame and that executes after that gotoAndStop.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points